Skip to content

Commit

Permalink
Merge pull request #11132 from brave/allow-spend-active-origin
Browse files Browse the repository at this point in the history
Passed Active Origin to Allow Spend Panel
  • Loading branch information
Douglashdaniel committed Nov 19, 2021
1 parent 7532b35 commit 0506971
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ import {
export type confirmPanelTabs = 'transaction' | 'details'

export interface Props {
siteURL: string
accounts: WalletAccountType[]
visibleTokens: TokenInfo[]
fullTokenList: TokenInfo[]
Expand All @@ -92,6 +93,7 @@ export interface Props {

function ConfirmTransactionPanel (props: Props) {
const {
siteURL,
accounts,
selectedNetwork,
transactionInfo,
Expand Down Expand Up @@ -126,10 +128,6 @@ function ConfirmTransactionPanel (props: Props) {
const [currentTokenAllowance, setCurrentTokenAllowance] = React.useState<string>('')
const [isEditingAllowance, setIsEditingAllowance] = React.useState<boolean>(false)

// Will remove this hardcoded value once we know
// where the site info will be coming from.
const siteURL = 'https://app.compound.finance'

const findSpotPrice = usePricing(transactionSpotPrices)
const parseTransaction = useTransactionParser(selectedNetwork, accounts, transactionSpotPrices, visibleTokens, fullTokenList)
const transactionDetails = parseTransaction(transactionInfo)
Expand Down
21 changes: 11 additions & 10 deletions components/brave_wallet_ui/panel/container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -484,16 +484,16 @@ function Container (props: Props) {

if (selectedPendingTransaction && selectedPanel === 'connectHardwareWallet') {
return (
<PanelWrapper isLonger={false}>
<StyledExtensionWrapper>
<ConnectHardwareWalletPanel
onCancel={onCancelConnectHardwareWallet}
walletName={selectedAccount.name}
hardwareWalletError={props.panel.hardwareWalletError}
retryCallable={onConfirmTransaction}
/>
</StyledExtensionWrapper>
</PanelWrapper>
<PanelWrapper isLonger={false}>
<StyledExtensionWrapper>
<ConnectHardwareWalletPanel
onCancel={onCancelConnectHardwareWallet}
walletName={selectedAccount.name}
hardwareWalletError={props.panel.hardwareWalletError}
retryCallable={onConfirmTransaction}
/>
</StyledExtensionWrapper>
</PanelWrapper>
)
}

Expand All @@ -502,6 +502,7 @@ function Container (props: Props) {
<PanelWrapper isLonger={true}>
<LongWrapper>
<ConfirmTransactionPanel
siteURL={activeOrigin}
onConfirm={onConfirmTransaction}
onReject={onRejectTransaction}
onRejectAllTransactions={onRejectAllTransactions}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ export const _ConfirmTransaction = () => {
return (
<StyledExtensionWrapperLonger>
<ConfirmTransactionPanel
siteURL='https://app.uniswap.org'
selectedNetwork={mockNetworks[0]}
onQueueNextTransction={onQueueNextTransction}
onRejectAllTransactions={onRejectAllTransactions}
Expand Down

0 comments on commit 0506971

Please sign in to comment.