aboutsummaryrefslogtreecommitdiff
path: root/src/components/taggs/Tagg.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-03-26 17:28:23 -0400
committerIvan Chen <ivan@tagg.id>2021-03-26 17:28:23 -0400
commit64f8829ab55bfe6851f10ca933043877769c56bf (patch)
tree1e28d37d626b85bf5f131f5a1f9e8b787f3cf069 /src/components/taggs/Tagg.tsx
parent82acd049763452decdab0c40e6cf7286dd2ed57d (diff)
show taggsbar, prevent taggsbar navigation on profile and SP
Diffstat (limited to 'src/components/taggs/Tagg.tsx')
-rw-r--r--src/components/taggs/Tagg.tsx30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/components/taggs/Tagg.tsx b/src/components/taggs/Tagg.tsx
index 547a77cb..ae9ab091 100644
--- a/src/components/taggs/Tagg.tsx
+++ b/src/components/taggs/Tagg.tsx
@@ -34,6 +34,7 @@ interface TaggProps {
userXId: string | undefined;
user: UserType;
whiteRing: boolean | undefined;
+ allowNavigation?: boolean;
}
const Tagg: React.FC<TaggProps> = ({
@@ -45,6 +46,7 @@ const Tagg: React.FC<TaggProps> = ({
userXId,
user,
whiteRing,
+ allowNavigation = true,
}) => {
const navigation = useNavigation();
const [modalVisible, setModalVisible] = useState(false);
@@ -70,19 +72,21 @@ const Tagg: React.FC<TaggProps> = ({
const modalOrAuthBrowserOrPass = async () => {
if (youMayPass) {
- if (INTEGRATED_SOCIAL_LIST.indexOf(social) !== -1) {
- navigation.push('SocialMediaTaggs', {
- socialMediaType: social,
- userXId,
- });
- } else {
- getNonIntegratedURL(social, user.userId).then((socialURL) => {
- if (socialURL) {
- Linking.openURL(socialURL);
- } else {
- Alert.alert(ERROR_UNABLE_TO_FIND_PROFILE);
- }
- });
+ if (allowNavigation) {
+ if (INTEGRATED_SOCIAL_LIST.indexOf(social) !== -1) {
+ navigation.push('SocialMediaTaggs', {
+ socialMediaType: social,
+ userXId,
+ });
+ } else {
+ getNonIntegratedURL(social, user.userId).then((socialURL) => {
+ if (socialURL) {
+ Linking.openURL(socialURL);
+ } else {
+ Alert.alert(ERROR_UNABLE_TO_FIND_PROFILE);
+ }
+ });
+ }
}
} else {
if (isIntegrated) {