diff options
author | Paul Frazee <pfrazee@gmail.com> | 2022-10-04 10:53:08 -0500 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2022-10-04 10:53:08 -0500 |
commit | bf39791f011f19c6ff192eb223e15259dc9de53a (patch) | |
tree | 2dd108a78cae54565f18c11aade32cc028bd2e5b /src/view/com/modals/LinkActions.tsx | |
parent | c5ab005908457761abe9a1d67d7e1a4a2796a0fe (diff) | |
download | voidsky-bf39791f011f19c6ff192eb223e15259dc9de53a.tar.zst |
Implement a couple missing bits
Diffstat (limited to 'src/view/com/modals/LinkActions.tsx')
-rw-r--r-- | src/view/com/modals/LinkActions.tsx | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/view/com/modals/LinkActions.tsx b/src/view/com/modals/LinkActions.tsx index aa185026f..deb1518ec 100644 --- a/src/view/com/modals/LinkActions.tsx +++ b/src/view/com/modals/LinkActions.tsx @@ -8,7 +8,15 @@ import {s, colors} from '../../lib/styles' export const snapPoints = ['30%'] -export function Component({title, href}: {title: string; href: string}) { +export function Component({ + title, + href, + newTab, +}: { + title: string + href: string + newTab: boolean +}) { const store = useStores() const onPressOpenNewTab = () => { @@ -28,13 +36,15 @@ export function Component({title, href}: {title: string; href: string}) { <View> <Text style={[s.textCenter, s.bold, s.mb10, s.f16]}>{title || href}</Text> <View style={s.p10}> - <TouchableOpacity onPress={onPressOpenNewTab} style={styles.btn}> - <FontAwesomeIcon - icon="arrow-up-right-from-square" - style={styles.icon} - /> - <Text style={[s.f16, s.black]}>Open in new tab</Text> - </TouchableOpacity> + {newTab ? ( + <TouchableOpacity onPress={onPressOpenNewTab} style={styles.btn}> + <FontAwesomeIcon + icon="arrow-up-right-from-square" + style={styles.icon} + /> + <Text style={[s.f16, s.black]}>Open in new tab</Text> + </TouchableOpacity> + ) : undefined} <TouchableOpacity onPress={onPressCopy} style={styles.btn}> <FontAwesomeIcon icon="link" style={styles.icon} /> <Text style={[s.f16, s.black]}>Copy to clipboard</Text> |