From 7cc5511bc1ece66e5543d1b08f8ec4720bd0c009 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Wed, 6 Mar 2024 13:54:01 -0300 Subject: [PATCH] Learn more url --- app/lib/encryption/constants.ts | 1 + app/lib/encryption/index.ts | 2 ++ app/views/RoomView/components/EncryptedRoom.tsx | 5 +++-- app/views/RoomView/components/MissingRoomE2EEKey.tsx | 5 +++-- 4 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 app/lib/encryption/constants.ts diff --git a/app/lib/encryption/constants.ts b/app/lib/encryption/constants.ts new file mode 100644 index 000000000..15da8e6ef --- /dev/null +++ b/app/lib/encryption/constants.ts @@ -0,0 +1 @@ +export const LEARN_MORE_E2EE_URL = 'https://go.rocket.chat/i/e2ee-guide'; diff --git a/app/lib/encryption/index.ts b/app/lib/encryption/index.ts index 9033aa251..9f2e69145 100644 --- a/app/lib/encryption/index.ts +++ b/app/lib/encryption/index.ts @@ -1,4 +1,6 @@ import Encryption from './encryption'; import EncryptionRoom from './room'; +export * from './constants'; + export { Encryption, EncryptionRoom }; diff --git a/app/views/RoomView/components/EncryptedRoom.tsx b/app/views/RoomView/components/EncryptedRoom.tsx index 0813cad89..c69e63a9f 100644 --- a/app/views/RoomView/components/EncryptedRoom.tsx +++ b/app/views/RoomView/components/EncryptedRoom.tsx @@ -1,5 +1,5 @@ import React, { ReactElement } from 'react'; -import { StyleSheet, Text, View } from 'react-native'; +import { Linking, StyleSheet, Text, View } from 'react-native'; import { StackNavigationProp } from '@react-navigation/stack'; import { ChatsStackParamList } from '../../../stacks/types'; @@ -8,6 +8,7 @@ import { CustomIcon } from '../../../containers/CustomIcon'; import Button from '../../../containers/Button'; import sharedStyles from '../../Styles'; import { useAppSelector } from '../../../lib/hooks'; +import { LEARN_MORE_E2EE_URL } from '../../../lib/encryption'; import I18n from '../../../i18n'; import { TNavigation } from '../../../stacks/stackType'; @@ -47,7 +48,7 @@ export const EncryptedRoom = ({ title={I18n.t('Learn_more')} type='secondary' backgroundColor={colors.chatComponentBackground} - onPress={() => alert('learn more')} // TODO: missing url + onPress={() => Linking.openURL(LEARN_MORE_E2EE_URL)} /> diff --git a/app/views/RoomView/components/MissingRoomE2EEKey.tsx b/app/views/RoomView/components/MissingRoomE2EEKey.tsx index c73dbb688..7ad944509 100644 --- a/app/views/RoomView/components/MissingRoomE2EEKey.tsx +++ b/app/views/RoomView/components/MissingRoomE2EEKey.tsx @@ -1,11 +1,12 @@ import React, { ReactElement } from 'react'; -import { StyleSheet, Text, View } from 'react-native'; +import { Linking, StyleSheet, Text, View } from 'react-native'; import { useTheme } from '../../../theme'; import { CustomIcon } from '../../../containers/CustomIcon'; import Button from '../../../containers/Button'; import sharedStyles from '../../Styles'; import I18n from '../../../i18n'; +import { LEARN_MORE_E2EE_URL } from '../../../lib/encryption'; const GAP = 32; @@ -26,7 +27,7 @@ export const MissingRoomE2EEKey = (): ReactElement => { title={I18n.t('Learn_more')} type='secondary' backgroundColor={colors.chatComponentBackground} - onPress={() => alert('learn more')} // TODO: missing url + onPress={() => Linking.openURL(LEARN_MORE_E2EE_URL)} />