-
Notifications
You must be signed in to change notification settings - Fork 6
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
c70de0f
commit ddaabad
Showing
6 changed files
with
73 additions
and
1 deletion.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -131,3 +131,5 @@ export const Typography = ({ | |
</Text> | ||
) | ||
} | ||
|
||
export { styles as typographyStyles } |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { StyleSheet } from 'react-native' | ||
import { MessageOptions, hideMessage } from 'react-native-flash-message' | ||
|
||
import { AppTouchable, Typography, typographyStyles } from 'components/index' | ||
|
||
import { sharedColors } from '../constants' | ||
import { castStyle } from '../utils' | ||
|
||
export const getPopupMessage = ( | ||
message: string, | ||
actionTitle: string, | ||
onPress?: () => void, | ||
): MessageOptions => { | ||
const executePress = () => { | ||
onPress?.() | ||
hideMessage() | ||
} | ||
|
||
return { | ||
message, | ||
style: { | ||
justifyContent: 'center', | ||
backgroundColor: sharedColors.primary, | ||
paddingHorizontal: 24, | ||
borderBottomLeftRadius: 12, | ||
borderBottomRightRadius: 12, | ||
}, | ||
titleStyle: { | ||
...typographyStyles.body3, | ||
textAlign: 'center', | ||
}, | ||
renderAfterContent: () => ( | ||
<AppTouchable width={150} style={styles.textLink} onPress={executePress}> | ||
<Typography style={styles.text} type={'h4'}> | ||
{actionTitle} | ||
</Typography> | ||
</AppTouchable> | ||
), | ||
duration: 6000, | ||
} | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
textLink: castStyle.view({ | ||
marginTop: 6, | ||
alignSelf: 'center', | ||
}), | ||
text: castStyle.text({ textDecorationLine: 'underline' }), | ||
}) |