-
Notifications
You must be signed in to change notification settings - Fork 504
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(seamless limits): fixed issue with send crypto, added missing ba…
…nner
- Loading branch information
Showing
7 changed files
with
154 additions
and
3 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
33 changes: 33 additions & 0 deletions
33
packages/blockchain-wallet-v4-frontend/src/components/Flyout/Banners/BuyMoreLine.stories.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,33 @@ | ||
import React from 'react' | ||
import { IntlProvider } from 'react-intl' | ||
import { Provider } from 'react-redux' | ||
import { ComponentMeta, ComponentStory } from '@storybook/react' | ||
import { combineReducers, createStore } from 'redux' | ||
|
||
import BuyMoreLine from './BuyMoreLine' | ||
|
||
const store = createStore(combineReducers({})) | ||
|
||
export default { | ||
args: { | ||
buyAmount: '333 ETH', | ||
close: () => {}, | ||
coin: 'ETH', | ||
startBuy: () => {} | ||
}, | ||
component: BuyMoreLine, | ||
decorators: [ | ||
(Story) => ( | ||
<Provider store={store}> | ||
<IntlProvider locale='en'> | ||
<div style={{ display: 'flex', height: '100vh', width: '480px' }}>{Story()}</div> | ||
</IntlProvider> | ||
</Provider> | ||
) | ||
], | ||
title: 'Flyouts/Banners/BuyMoreLine' | ||
} as ComponentMeta<typeof BuyMoreLine> | ||
|
||
export const Template: ComponentStory<typeof BuyMoreLine> = (args) => <BuyMoreLine {...args} /> | ||
|
||
export const Default = Template.bind({}) |
98 changes: 98 additions & 0 deletions
98
packages/blockchain-wallet-v4-frontend/src/components/Flyout/Banners/BuyMoreLine.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,98 @@ | ||
import React from 'react' | ||
import { FormattedMessage } from 'react-intl' | ||
import styled from 'styled-components' | ||
|
||
import { Button, Icon, Text } from 'blockchain-info-components' | ||
import { media } from 'services/styles' | ||
|
||
const Wrapper = styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
align-items: center; | ||
border: 1px solid ${(props) => props.theme.blue400}; | ||
border-radius: 12px; | ||
padding: 16px 18px; | ||
margin: 10px 0; | ||
${media.atLeastLaptop` | ||
height: 72px; | ||
padding: 0 20px; | ||
`} | ||
${media.mobile` | ||
padding: 12px; | ||
flex-direction: column; | ||
`} | ||
` | ||
const Row = styled.div` | ||
display: flex; | ||
align-items: center; | ||
` | ||
|
||
const SpacedRow = styled(Row)` | ||
justify-content: space-between; | ||
width: 100%; | ||
` | ||
|
||
const Column = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
flex: 1; | ||
` | ||
const PendingIconWrapper = styled.div` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 40px; | ||
width: 40px; | ||
min-width: 40px; | ||
border-radius: 20px; | ||
` | ||
|
||
const BannerButton = styled(Button)` | ||
height: 32px; | ||
width: 46px; | ||
font-size: 14px; | ||
border-radius: 42px; | ||
min-width: 0; | ||
text-transform: uppercase; | ||
` | ||
|
||
const BuyMoreLine = ({ buyAmount, coin, startBuy }: Props) => { | ||
return ( | ||
<Wrapper> | ||
<SpacedRow> | ||
<PendingIconWrapper> | ||
<Icon size='32px' color={coin} name={coin} /> | ||
</PendingIconWrapper> | ||
<Column> | ||
<Text size='12px' weight={500} color='grey900'> | ||
<FormattedMessage | ||
id='copy.get_more_coin' | ||
defaultMessage='Get More {coin}' | ||
values={{ | ||
coin | ||
}} | ||
/> | ||
</Text> | ||
<Text size='14px' weight={500} color='grey900'> | ||
<FormattedMessage | ||
id='buttons.buy_coin' | ||
defaultMessage='Buy {displayName}' | ||
values={{ | ||
displayName: buyAmount | ||
}} | ||
/> | ||
</Text> | ||
</Column> | ||
<BannerButton onClick={startBuy} data-e2e='continueToBuy' nature='primary'> | ||
<FormattedMessage id='buttons.buy' defaultMessage='Buy' /> | ||
</BannerButton> | ||
</SpacedRow> | ||
</Wrapper> | ||
) | ||
} | ||
|
||
type Props = { buyAmount: string; coin: string; startBuy: () => void } | ||
|
||
export default BuyMoreLine |
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
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