-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into fix/swap-slippage-screen-input-2
- Loading branch information
Showing
15 changed files
with
1,066 additions
and
186 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
7 changes: 7 additions & 0 deletions
7
.../wallet-mobile/src/features/Exchange/common/ShowBuyBanner/PreprodFaucetBanner.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,7 @@ | ||
import {storiesOf} from '@storybook/react-native' | ||
import React from 'react' | ||
|
||
import {PreprodFaucetBanner} from './PreprodFaucetBanner' | ||
|
||
storiesOf('Exchange PreprodFaucetBanner', module) // | ||
.add('initial', () => <PreprodFaucetBanner />) |
111 changes: 111 additions & 0 deletions
111
apps/wallet-mobile/src/features/Exchange/common/ShowBuyBanner/PreprodFaucetBanner.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,111 @@ | ||
import {useTheme} from '@yoroi/theme' | ||
import * as React from 'react' | ||
import {Linking, StyleSheet, Text, View} from 'react-native' | ||
import LinearGradient from 'react-native-linear-gradient' | ||
|
||
import {Button, Spacer} from '../../../../components' | ||
import {Space} from '../../../../components/Space/Space' | ||
import {PreprodFaucetBannerLogo} from '../../illustrations/PreprodFaucetBannerLogo' | ||
import {useStrings} from '../useStrings' | ||
|
||
export const PreprodFaucetBanner = () => { | ||
const strings = useStrings() | ||
const {styles, colors} = useStyles() | ||
|
||
const handleOnPress = () => { | ||
Linking.openURL('https://docs.cardano.org/cardano-testnets/tools/faucet/') | ||
} | ||
|
||
return ( | ||
<> | ||
<View style={styles.root}> | ||
<LinearGradient style={styles.gradient} start={{x: 1, y: 1}} end={{x: 0, y: 0}} colors={colors.gradientColor}> | ||
<View style={styles.viewTitle}> | ||
<Text style={styles.title}>{strings.preprodFaucetBannerTitle}</Text> | ||
|
||
<Space height="xs" /> | ||
</View> | ||
|
||
<View style={styles.content}> | ||
<View style={styles.contentInner}> | ||
<Spacer height={8} /> | ||
|
||
<Text style={styles.text}>{strings.preprodFaucetBannerText}</Text> | ||
|
||
<Space height="lg" /> | ||
|
||
<Button | ||
testID="rampOnOffButton" | ||
shelleyTheme | ||
title={strings.preprodFaucetBannerButtonText} | ||
onPress={handleOnPress} | ||
style={styles.spaceButton} | ||
/> | ||
</View> | ||
|
||
<View style={styles.logo}> | ||
<PreprodFaucetBannerLogo /> | ||
</View> | ||
</View> | ||
</LinearGradient> | ||
</View> | ||
|
||
<Spacer height={18} /> | ||
</> | ||
) | ||
} | ||
|
||
const useStyles = () => { | ||
const {color, atoms} = useTheme() | ||
const styles = StyleSheet.create({ | ||
root: { | ||
backgroundColor: color.bg_color_high, | ||
}, | ||
gradient: { | ||
...atoms.flex_1, | ||
opacity: 1, | ||
borderRadius: 8, | ||
...atoms.flex_col, | ||
}, | ||
viewTitle: { | ||
...atoms.flex_row, | ||
...atoms.justify_between, | ||
...atoms.flex_1, | ||
...atoms.px_lg, | ||
...atoms.pt_md, | ||
}, | ||
title: { | ||
...atoms.body_1_lg_medium, | ||
color: color.gray_cmax, | ||
...atoms.flex_wrap, | ||
...atoms.flex_shrink, | ||
}, | ||
content: { | ||
position: 'relative', | ||
...atoms.flex_1, | ||
...atoms.px_lg, | ||
...atoms.pb_lg, | ||
}, | ||
contentInner: { | ||
...atoms.flex_1, | ||
}, | ||
logo: { | ||
position: 'absolute', | ||
bottom: 0, | ||
right: 0, | ||
}, | ||
text: { | ||
...atoms.body_2_md_regular, | ||
color: color.gray_cmax, | ||
maxWidth: 270, | ||
}, | ||
spaceButton: { | ||
maxWidth: 180, | ||
}, | ||
}) | ||
const colors = { | ||
gradientColor: color.bg_gradient_1, | ||
gray: color.gray_cmax, | ||
} | ||
return {styles, colors} as const | ||
} |
7 changes: 7 additions & 0 deletions
7
apps/wallet-mobile/src/features/Exchange/common/ShowBuyBanner/ShowBuyBanner.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
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
Oops, something went wrong.