forked from keep-starknet-strange/joyboy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: tipping success modal (keep-starknet-strange#168)
* feat: tipping success modal * feat: tipping success modal * refac: tipping success modal * refac: remove icon * Remove package-lock.json * remove yarn.lock * refac: improve ui * refac: improve tipping modal ui
- Loading branch information
1 parent
4d10802
commit 2c03f39
Showing
3 changed files
with
116 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,69 @@ | ||
import {useNavigation} from '@react-navigation/native'; | ||
import React from 'react'; | ||
import {Image, View} from 'react-native'; | ||
import {Portal} from 'react-native-portalize'; | ||
|
||
import {useStyles} from '../../hooks'; | ||
import {MainStackNavigationProps} from '../../types'; | ||
import {Button, Text} from '..'; | ||
import stylesheet from './styles'; | ||
|
||
export type TippingModalProps = { | ||
user: string; | ||
symbol: string; | ||
amount: number; | ||
visible?: boolean; | ||
}; | ||
|
||
export const TippingModal: React.FC<TippingModalProps> = ({ | ||
user, | ||
symbol, | ||
amount, | ||
visible = true, | ||
}) => { | ||
const styles = useStyles(stylesheet); | ||
|
||
const navigation = useNavigation<MainStackNavigationProps>(); | ||
|
||
if (!visible) return null; | ||
|
||
return ( | ||
<Portal> | ||
<View style={styles.container}> | ||
<View style={styles.modalContainer}> | ||
<View style={styles.modal}> | ||
<View style={styles.logo}> | ||
<Image | ||
style={styles.logoImage} | ||
source={require('../../assets/tipping-modal.png')} | ||
resizeMode="cover" | ||
/> | ||
</View> | ||
|
||
<View style={styles.content}> | ||
<Text color="text" weight="bold" fontSize={21} lineHeight={24}> | ||
Tipped {user} | ||
</Text> | ||
<Text color="primary" weight="bold" fontSize={21} lineHeight={24}> | ||
{amount} {symbol} | ||
</Text> | ||
<Text color="textSecondary" weight="medium" fontSize={15} lineHeight={24}> | ||
Keep spreading love | ||
</Text> | ||
|
||
<Button | ||
style={styles.button} | ||
onPress={() => { | ||
navigation.navigate('Home'); | ||
}} | ||
variant="secondary" | ||
> | ||
Home | ||
</Button> | ||
</View> | ||
</View> | ||
</View> | ||
</View> | ||
</Portal> | ||
); | ||
}; |
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,47 @@ | ||
import {Spacing, ThemedStyleSheet} from '../../styles'; | ||
|
||
export default ThemedStyleSheet((theme) => ({ | ||
container: { | ||
flex: 1, | ||
}, | ||
modalContainer: { | ||
position: 'absolute', | ||
bottom: 0, | ||
left: 0, | ||
right: 0, | ||
backgroundColor: 'rgba(0, 0, 0, 0.4)', | ||
width: '100%', | ||
height: '100%', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
}, | ||
modal: { | ||
width: '80%', | ||
height: '40%', | ||
backgroundColor: theme.colors.surface, | ||
borderRadius: 24, | ||
}, | ||
logo: { | ||
position: 'absolute', | ||
top: '-43%', | ||
width: '100%', | ||
height: '100%', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
}, | ||
logoImage: { | ||
width: 238, | ||
}, | ||
content: { | ||
gap: Spacing.small, | ||
width: '100%', | ||
height: '100%', | ||
alignItems: 'center', | ||
justifyContent: 'flex-end', | ||
paddingHorizontal: Spacing.large, | ||
paddingVertical: Spacing.medium, | ||
}, | ||
button: { | ||
width: '100%', | ||
}, | ||
})); |