-
Notifications
You must be signed in to change notification settings - Fork 888
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement buy options new design (#13708)
* Implement buy options new design * Feedback fixes
- Loading branch information
1 parent
f01e9da
commit e2062a8
Showing
17 changed files
with
321 additions
and
262 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 68 additions & 0 deletions
68
components/brave_wallet_ui/components/buy-option/buy-option-item-styles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* Copyright (c) 2022 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
import styled from 'styled-components' | ||
import { WalletButton } from '../shared/style' | ||
|
||
export const StyledWrapper = styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
padding: 16px 0; | ||
align-items: flex-start; | ||
` | ||
|
||
export const Logo = styled.img` | ||
width: 46px; | ||
height: auto; | ||
margin-right: 20px; | ||
margin-top: 16px; | ||
` | ||
|
||
export const Content = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
` | ||
|
||
export const Name = styled.span` | ||
font-family: 'Poppins'; | ||
font-style: normal; | ||
font-size: 18px; | ||
line-height: 26px; | ||
font-weight: 600; | ||
letter-spacing: 0.02em; | ||
color: ${p => p.theme.color.text01}; | ||
padding-bottom: 2px; | ||
` | ||
|
||
export const Description = styled.span` | ||
font-family: 'Poppins'; | ||
font-weight: 400; | ||
font-size: 12px; | ||
line-height: 18px; | ||
letter-spacing: 0.01em; | ||
color: ${p => p.theme.color.text01}; | ||
margin-bottom: 12px; | ||
` | ||
|
||
export const StyledButton = styled(WalletButton)` | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
cursor: pointer; | ||
border-radius: 44px; | ||
padding: 10px 20px; | ||
outline: none; | ||
background-color: transparent; | ||
border: ${p => `1px solid ${p.theme.color.interactive08}`}; | ||
` | ||
|
||
export const ButtonText = styled.span` | ||
font-family: 'Poppins'; | ||
font-size: 13px; | ||
font-weight: 600; | ||
color: ${p => p.theme.color.interactive07}; | ||
text-align: center; | ||
` |
45 changes: 45 additions & 0 deletions
45
components/brave_wallet_ui/components/buy-option/buy-option-item.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* Copyright (c) 2022 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
import * as React from 'react' | ||
|
||
// Utils | ||
import { BraveWallet, BuyOption } from '../../constants/types' | ||
|
||
// Styled Components | ||
import { | ||
Logo, | ||
Content, | ||
StyledWrapper, | ||
Name, | ||
Description, | ||
StyledButton, | ||
ButtonText | ||
} from './buy-option-item-styles' | ||
|
||
interface Props { | ||
option: BuyOption | ||
onSelect: (option: BraveWallet.OnRampProvider) => void | ||
} | ||
export const BuyOptionItem = (props: Props) => { | ||
const { option, onSelect } = props | ||
const { id, icon, name, description, actionText } = option | ||
|
||
const onClick = React.useCallback(() => { | ||
onSelect(id) | ||
}, [onSelect, id]) | ||
|
||
return ( | ||
<StyledWrapper> | ||
<Logo src={icon} /> | ||
<Content> | ||
<Name>{name}</Name> | ||
<Description>{description}</Description> | ||
<StyledButton onClick={onClick}> | ||
<ButtonText>{actionText}</ButtonText> | ||
</StyledButton> | ||
</Content> | ||
</StyledWrapper> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...ts/brave_wallet_ui/components/buy-send-swap/select-buy-option/select-buy-option-styles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* Copyright (c) 2022 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
import styled from 'styled-components' | ||
|
||
export const StyledWrapper = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
` | ||
|
||
export const SubDivider = styled.div` | ||
width: 100%; | ||
height: 1px; | ||
background-color: ${(p) => p.theme.color.divider01}; | ||
` |
Oops, something went wrong.