-
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 yomo-1944
- Loading branch information
Showing
35 changed files
with
1,142 additions
and
831 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
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
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
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.