-
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.
- Loading branch information
1 parent
f89a9b3
commit 24a425d
Showing
9 changed files
with
121 additions
and
80 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
apps/wallet-mobile/src/components/ChainWarning/ChainWarning.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,52 @@ | ||
import {Text} from '../Text' | ||
import LinearGradient from 'react-native-linear-gradient' | ||
import React from 'react' | ||
import {useTheme} from '@yoroi/theme' | ||
import {StyleSheet} from 'react-native' | ||
|
||
type Props = { | ||
title: string | ||
description: string | ||
} | ||
|
||
export const ChainWarning = ({title, description}: Props) => { | ||
const {isDark, color} = useTheme() | ||
const styles = useStyles() | ||
|
||
return ( | ||
<LinearGradient | ||
colors={isDark ? ['rgba(19, 57, 54, 1)', 'rgba(20, 24, 58, 1)', 'rgba(22, 25, 45, 1)'] : color.bg_gradient_1} // it fixes a weird bug | ||
start={{x: isDark ? 0.5 : 0.5, y: isDark ? 0 : 0.5}} | ||
end={{x: isDark ? 0 : 0, y: isDark ? 0.5 : 0}} | ||
style={styles.disclaimer} | ||
> | ||
<Text style={styles.title}>{title}</Text> | ||
|
||
<Text style={styles.description}>{description}</Text> | ||
</LinearGradient> | ||
) | ||
} | ||
|
||
const useStyles = () => { | ||
const {atoms, color} = useTheme() | ||
const styles = StyleSheet.create({ | ||
disclaimer: { | ||
...atoms.px_lg, | ||
...atoms.py_md, | ||
...atoms.gap_sm, | ||
overflow: 'hidden', | ||
borderRadius: 8, | ||
}, | ||
title: { | ||
...atoms.body_1_lg_medium, | ||
...atoms.font_semibold, | ||
color: color.gray_cmax, | ||
}, | ||
description: { | ||
...atoms.body_2_md_regular, | ||
...atoms.font_normal, | ||
color: color.gray_c900, | ||
}, | ||
}) | ||
return styles | ||
} |
23 changes: 23 additions & 0 deletions
23
apps/wallet-mobile/src/features/Discover/common/ChainDAppsWarning.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,23 @@ | ||
import {ChainWarning} from '../../../components/ChainWarning/ChainWarning' | ||
import * as React from 'react' | ||
import {useWalletManager} from '../../WalletManager/context/WalletManagerProvider' | ||
import {Chain} from '@yoroi/types' | ||
import {useStrings} from './useStrings' | ||
|
||
export const ChainDAppsWarning = () => { | ||
const strings = useStrings() | ||
const { | ||
selected: {network}, | ||
} = useWalletManager() | ||
const isMainnet = network === Chain.Network.Mainnet | ||
|
||
if (isMainnet) return null | ||
return ( | ||
<ChainWarning | ||
title={'Testnet DApps 🚧'} | ||
description={ | ||
'This is a list of DApps designed for testnet use. Note that it may be limited, as not all DApps are deployed in the testnet environment.' | ||
} | ||
/> | ||
) | ||
} |
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.