forked from GaloyMoney/blink-mobile
-
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: username validation (GaloyMoney#618)
- Loading branch information
1 parent
5b291dc
commit 8067b26
Showing
19 changed files
with
1,368 additions
and
159 deletions.
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
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,87 @@ | ||
import { useI18nContext } from "@app/i18n/i18n-react" | ||
import { bankName } from "@app/screens/send-bitcoin-screen/send-bitcoin-destination-screen" | ||
import { palette } from "@app/theme" | ||
import * as React from "react" | ||
import { Text, View, TouchableOpacity, ScrollView } from "react-native" | ||
import { Icon } from "react-native-elements" | ||
import EStyleSheet from "react-native-extended-stylesheet" | ||
import Markdown from "react-native-markdown-display" | ||
import Modal from "react-native-modal" | ||
|
||
const styles = EStyleSheet.create({ | ||
modalStyle: { margin: 0, flexDirection: "column", justifyContent: "flex-end" }, | ||
fillerOpacity: { flex: 3 }, | ||
modalCard: { | ||
backgroundColor: palette.white, | ||
flex: 2, | ||
borderTopLeftRadius: 40, | ||
borderTopRightRadius: 40, | ||
padding: 24, | ||
}, | ||
modalTitleContainer: { flexDirection: "row", alignItems: "center", marginBottom: 10 }, | ||
modalTitleText: { fontSize: 24 }, | ||
iconContainer: { marginRight: 12 }, | ||
markdownText: { fontSize: 20, marginBottom: 20 }, | ||
}) | ||
|
||
type FloorTooltipProps = { | ||
size?: number | ||
type: "info" | "advice" | ||
title?: string | ||
text: string | ||
} | ||
|
||
export const FloorTooltip: React.FC<FloorTooltipProps> = ({ | ||
size, | ||
type, | ||
title, | ||
text, | ||
}) => { | ||
const { LL } = useI18nContext() | ||
const [isVisible, setIsVisible] = React.useState(false) | ||
const toggleModal = () => setIsVisible(!isVisible) | ||
|
||
let iconParams | ||
let defaultTitle | ||
switch (type) { | ||
case "info": | ||
iconParams = { | ||
name: "info", | ||
type: "fontisto", | ||
} | ||
defaultTitle = LL.common.bankInfo({ bankName }) | ||
break | ||
case "advice": | ||
iconParams = { | ||
name: "lightbulb", | ||
type: "foundation", | ||
} | ||
defaultTitle = LL.common.bankAdvice({ bankName }) | ||
break | ||
} | ||
const modalTitle = title || defaultTitle | ||
|
||
return ( | ||
<View> | ||
<Icon raised {...(size ? { size } : {})} {...iconParams} onPress={toggleModal} /> | ||
<Modal | ||
isVisible={isVisible} | ||
onBackdropPress={() => toggleModal} | ||
coverScreen | ||
style={styles.modalStyle} | ||
backdropOpacity={0.2} | ||
> | ||
<TouchableOpacity style={styles.fillerOpacity} onPress={toggleModal} /> | ||
<View style={styles.modalCard}> | ||
<View style={styles.modalTitleContainer}> | ||
<Icon size={24} {...iconParams} containerStyle={styles.iconContainer} /> | ||
<Text style={styles.modalTitleText}>{modalTitle}</Text> | ||
</View> | ||
<ScrollView> | ||
<Markdown style={{ body: styles.markdownText }}>{text}</Markdown> | ||
</ScrollView> | ||
</View> | ||
</Modal> | ||
</View> | ||
) | ||
} |
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.