-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(wallet-mobile): Change copy and add warning in dapp explorer (#3673)
Signed-off-by: Juliano Lazzarotto <[email protected]> Co-authored-by: Juliano Lazzarotto <[email protected]>
- Loading branch information
1 parent
f6cd0c3
commit 5c1d9d1
Showing
6 changed files
with
311 additions
and
231 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
apps/wallet-mobile/src/components/InfoBanner/InfoBanner.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,10 @@ | ||
import {storiesOf} from '@storybook/react-native' | ||
import * as React from 'react' | ||
|
||
import {InfoBanner} from './InfoBanner' | ||
|
||
storiesOf('InfoBanner', module).add('initial', () => <Initial />) | ||
|
||
const Initial = () => { | ||
return <InfoBanner content="Example info message" /> | ||
} |
43 changes: 43 additions & 0 deletions
43
apps/wallet-mobile/src/components/InfoBanner/InfoBanner.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,43 @@ | ||
import {useTheme} from '@yoroi/theme' | ||
import * as React from 'react' | ||
import {StyleSheet, Text, View} from 'react-native' | ||
|
||
import {Icon} from '../Icon' | ||
import {Space} from '../Space/Space' | ||
|
||
type Props = {content: React.ReactNode; iconSize?: number} | ||
|
||
export const InfoBanner = ({content, iconSize = 30}: Props) => { | ||
const {styles, colors} = useStyles() | ||
|
||
return ( | ||
<View style={styles.notice}> | ||
<Icon.Info size={iconSize} color={colors.icon} /> | ||
|
||
<Space height="sm" /> | ||
|
||
<Text style={styles.text}>{content}</Text> | ||
</View> | ||
) | ||
} | ||
|
||
const useStyles = () => { | ||
const {color, atoms} = useTheme() | ||
const styles = StyleSheet.create({ | ||
notice: { | ||
backgroundColor: color.sys_cyan_100, | ||
...atoms.p_md, | ||
borderRadius: 8, | ||
}, | ||
text: { | ||
...atoms.body_2_md_regular, | ||
color: color.gray_max, | ||
}, | ||
}) | ||
|
||
const colors = { | ||
icon: color.primary_500, | ||
} | ||
|
||
return {colors, styles} | ||
} |
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
Oops, something went wrong.