Skip to content

Commit

Permalink
Make Share URL configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
anishsheela committed Dec 23, 2024
1 parent 0f69564 commit 742412d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const config: ExpoConfig = {
imagesUrl: process.env.DUO_IMAGES_URL,
audioUrl: process.env.DUO_AUDIO_URL,
statusUrl: process.env.DUO_STATUS_URL,
webUrl: process.env.DUO_WEB_BASE_URL,
},
web: {
favicon: "./assets/favicon.png"
Expand Down
5 changes: 3 additions & 2 deletions components/traits-tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { DuoliciousTopNavBar } from './top-nav-bar';
import { referrerId } from '../App';
import { api } from '../api/api';
import { useFocusEffect } from '@react-navigation/native';
import { WEB_BASE_URL } from '../env/env';

const sideMargins: StyleProp<ViewStyle> = {
marginLeft: 10,
Expand All @@ -32,12 +33,12 @@ const sideMargins: StyleProp<ViewStyle> = {
const ShareNotice = ({personId}) => {
const [isCopied, setIsCopied] = useState(false);

const url = `https://web.duolicious.app/me/${personId}`;
const url = `${WEB_BASE_URL}/me/${personId}`;

const onPressNotice = useCallback(async () => {
await Clipboard.setStringAsync(url);
setIsCopied(true);
}, []);
}, [url]);

return (
<Pressable
Expand Down
1 change: 1 addition & 0 deletions env/env.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ export const CHAT_URL = Constants.expoConfig?.extra?.chatUrl ?? 'ws://localhost:
export const IMAGES_URL = Constants.expoConfig?.extra?.imagesUrl ?? 'http://localhost:9090/s3-mock-bucket';
export const AUDIO_URL = Constants.expoConfig?.extra?.audioUrl ?? 'http://localhost:9090/s3-mock-audio-bucket';
export const STATUS_URL = Constants.expoConfig?.extra?.statusUrl ?? 'http://localhost:8080';
export const WEB_BASE_URL = Constants.expoConfig?.extra?.webUrl ?? 'https://web.duolicious.app';

0 comments on commit 742412d

Please sign in to comment.