Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passed Active Origin to Allow Spend Panel #11132

Merged
merged 1 commit into from
Nov 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ import {
export type confirmPanelTabs = 'transaction' | 'details'

export interface Props {
siteURL: string
accounts: WalletAccountType[]
visibleTokens: ERCToken[]
fullTokenList: ERCToken[]
Expand All @@ -95,6 +96,7 @@ export interface Props {

function ConfirmTransactionPanel (props: Props) {
const {
siteURL,
accounts,
selectedNetwork,
transactionInfo,
Expand Down Expand Up @@ -129,10 +131,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