1
- import { useBanner , useBanners } from '@yoroi/banners'
1
+ import { shouldShowDRep2UsOnStakingCenter , useBanner , useBanners } from '@yoroi/banners'
2
2
import { useTheme } from '@yoroi/theme'
3
+ import { Banners } from '@yoroi/types'
3
4
import * as React from 'react'
4
5
import { StyleSheet , TouchableOpacity , View } from 'react-native'
5
6
import LinearGradient from 'react-native-linear-gradient'
6
7
7
8
import { Button } from '../../../../components/Button/Button'
9
+ import { DismissibleView } from '../../../../components/DismissableView'
8
10
import { Icon } from '../../../../components/Icon'
9
11
import { Text } from '../../../../components/Text'
10
12
import { yoroiDRepIdHex } from '../../../../kernel/constants'
11
- import { DismissibleBanner } from '../../common/DismissableBanner'
12
- import { shouldShowDRepConsiderDelegating } from '../../common/should-show-drep-consider-delegating'
13
13
import { useStrings } from '../../common/strings'
14
- import { BannerId , BannerStorageKey } from '../../common/types'
15
14
16
15
export const ConsiderDelegatingToYoroiBanner = ( ) => {
17
16
const { styles, colors} = useStyles ( )
18
17
const { title, description, cta} = useStrings ( )
19
- const { manager} = useBanners < BannerStorageKey > ( )
20
- const { dismiss, dismissedAt} = useBanner ( { id : BannerId . DRepConsiderDelegating , manager} )
18
+ const { manager} = useBanners < Banners . StorageKey > ( )
19
+ const { dismiss, dismissedAt} = useBanner ( { id : Banners . Id . DRep2UsStakingCenter , manager} )
21
20
22
21
const handleOnClose = React . useCallback ( ( ) => dismiss ( ) , [ dismiss ] )
23
22
const handleOnCta = React . useCallback ( ( ) => console . log ( 'cta' ) , [ ] )
24
23
25
- const shouldShow = shouldShowDRepConsiderDelegating ( {
24
+ const shouldShow = shouldShowDRep2UsOnStakingCenter ( {
26
25
yoroiDRepIdHex,
27
26
currentDRepIdHex : 'hi' ,
28
27
isStaking : true ,
29
28
dismissedAt,
30
29
} )
31
30
32
31
return (
33
- < DismissibleBanner isVisible = { shouldShow } >
32
+ < DismissibleView isVisible = { shouldShow } >
34
33
< LinearGradient start = { { x : 1 , y : 1 } } end = { { x : 0 , y : 0 } } colors = { colors . gradient } style = { styles . gradient } >
35
34
< View style = { styles . root } >
36
35
< TouchableOpacity onPress = { handleOnClose } style = { styles . closeButton } >
@@ -44,7 +43,7 @@ export const ConsiderDelegatingToYoroiBanner = () => {
44
43
< Button style = { styles . cta } type = "Secondary" size = "S" onPress = { handleOnCta } title = { cta } />
45
44
</ View >
46
45
</ LinearGradient >
47
- </ DismissibleBanner >
46
+ </ DismissibleView >
48
47
)
49
48
}
50
49
0 commit comments