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

feat(wallet) Move help centre link from account modal to main container #18739

Merged
merged 1 commit into from
Jun 6, 2023
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 @@ -32,7 +32,6 @@ import { RefreshBlockchainStateParams } from '../../../constants/types'

// Components
import { AccountListItemButton } from './account-list-item-button'
import { AccountModalButton } from './account-modal-button'

// Styled Components
import { ModalBox, Title } from './account-modal.style'
Expand Down Expand Up @@ -81,14 +80,6 @@ export const AccountModal = (props: Props) => {
]
)

const onClickHelpCenter = React.useCallback(() => {
window.open(
'https://support.brave.com/hc/en-us/articles/8155407080845-Brave-Swaps-FAQ',
'_blank',
'noopener'
)
}, [])

return (
<ModalBox>
{/*
Expand Down Expand Up @@ -166,11 +157,6 @@ export const AccountModal = (props: Props) => {
icon={PortfolioIcon}
onClick={onClickViewPortfolio}
/> */}
<AccountModalButton
text={getLocale('braveSwapHelpCenter')}
iconName='info-outline'
onClick={onClickHelpCenter}
/>
</Column>
</ModalBox>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,13 @@ export const Container = styled(StyledDiv)`
}
`

export const PrivacyButton = styled(StyledButton)`
export const Row = styled.div`
display: flex;
flex-direction: row;
gap: 5px;
`

export const ActionButton = styled(StyledButton)`
font-family: 'Poppins';
font-style: normal;
font-weight: 500;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ import { Header } from '../header/header'
import {
Background,
Container,
PrivacyButton,
Wrapper
ActionButton,
Wrapper,
Row
} from './swap-container.style'

interface Props {
Expand All @@ -49,6 +50,15 @@ export const SwapContainer = (props: Props) => {
// Refs
const ref = React.createRef<HTMLInputElement>()

// Methods
const onClickHelpCenter = React.useCallback(() => {
window.open(
'https://support.brave.com/hc/en-us/categories/360001059151-Brave-Wallet',
'_blank',
'noopener'
)
}, [])

// Effects
React.useEffect(() => {
// Keeps track of the Swap Containers Height to update
Expand All @@ -65,15 +75,16 @@ export const SwapContainer = (props: Props) => {

return (
<Wrapper>
<Header
refreshBlockchainState={refreshBlockchainState}
/>
<Header refreshBlockchainState={refreshBlockchainState} />
<Container ref={ref}>{children}</Container>
<PrivacyButton
onClick={showPrivacyModal}
>
{getLocale('braveSwapPrivacyPolicy')}
</PrivacyButton>
<Row>
<ActionButton onClick={showPrivacyModal}>
{getLocale('braveSwapPrivacyPolicy')}
</ActionButton>
<ActionButton onClick={onClickHelpCenter}>
{getLocale('braveSwapHelpCenter')}
</ActionButton>
</Row>
<Background
height={backgroundHeight}
network={selectedNetwork?.chainId ?? ''}
Expand Down