diff --git a/lib/facts/links.js b/lib/facts/links.js new file mode 100644 --- /dev/null +++ b/lib/facts/links.js @@ -0,0 +1,7 @@ +// @flow + +function inviteLinkUrl(secret: string): string { + return `https://comm.app/invite/${secret}`; +} + +export { inviteLinkUrl }; diff --git a/native/invite-links/manage-public-link-screen.react.js b/native/invite-links/manage-public-link-screen.react.js --- a/native/invite-links/manage-public-link-screen.react.js +++ b/native/invite-links/manage-public-link-screen.react.js @@ -9,6 +9,7 @@ disableInviteLink as callDisableInviteLink, disableInviteLinkLinkActionTypes, } from 'lib/actions/link-actions.js'; +import { inviteLinkUrl } from 'lib/facts/links.js'; import { primaryInviteLinksSelector } from 'lib/selectors/invite-links-selectors.js'; import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors.js'; import type { ThreadInfo } from 'lib/types/thread-types.js'; @@ -147,7 +148,7 @@ <Text style={styles.sectionTitle}>INVITE URL</Text> <View style={styles.section}> <View style={styles.inviteLink}> - <Text style={styles.inviteLinkPrefix}>https://comm.app/invite/</Text> + <Text style={styles.inviteLinkPrefix}>{inviteLinkUrl('')}</Text> <TextInput style={styles.input} value={name} diff --git a/native/invite-links/view-invite-links-screen.react.js b/native/invite-links/view-invite-links-screen.react.js --- a/native/invite-links/view-invite-links-screen.react.js +++ b/native/invite-links/view-invite-links-screen.react.js @@ -5,6 +5,7 @@ import { Text, View } from 'react-native'; import { TouchableOpacity } from 'react-native-gesture-handler'; +import { inviteLinkUrl } from 'lib/facts/links.js'; import { primaryInviteLinksSelector } from 'lib/selectors/invite-links-selectors.js'; import { threadHasPermission } from 'lib/shared/thread-utils.js'; import type { InviteLink } from 'lib/types/link-types.js'; @@ -40,7 +41,7 @@ const styles = useStyles(unboundStyles); const { modalForegroundLabel } = useColors(); - const linkUrl = `https://comm.app/invite/${inviteLink?.name ?? ''}`; + const linkUrl = inviteLinkUrl(inviteLink?.name ?? ''); const onPressCopy = React.useCallback(() => { Clipboard.setString(linkUrl); setTimeout(confirmCopy);