diff --git a/app/scenes/ExampleScreen/index.js b/app/scenes/ExampleScreen/index.js index 23ec7fe..eb27126 100644 --- a/app/scenes/ExampleScreen/index.js +++ b/app/scenes/ExampleScreen/index.js @@ -14,6 +14,7 @@ import SimpsonsLoveWednesday from '@organisms/SimpsonsLoveWednesday'; import If from '@app/components/atoms/If'; import { conditionalOperatorFunction } from '@app/utils/common'; import { LoadingStates } from '@app/utils/constants'; +import { POSTHOG_EVENTS } from '@app/utils/posthogEvents'; import { userState, fetchUserSelector, fetchTriggerState } from './recoilState'; @@ -32,12 +33,6 @@ const CustomButtonParentView = styled(View)` align-self: center; `; -const instructions = Platform.select({ - ios: 'Press Cmd+R to reload,\nCmd+D or shake for dev menu.', - android: - 'Double tap R on your keyboard to reload,\nShake or press menu button for dev menu.' -}); - const ExampleScreen = () => { const [user, setUser] = useRecoilState(userState); const setFetchTrigger = useSetRecoilState(fetchTriggerState); @@ -47,6 +42,10 @@ const ExampleScreen = () => { const requestFetchUser = () => { setFetchTrigger(prev => prev + 1); }; + const instructions = Platform.select({ + ios: t('ios_instructions'), + android: t('android_instructions') + }); useEffect(() => { requestFetchUser(); @@ -59,7 +58,7 @@ const ExampleScreen = () => { }, [userLoadable?.contents?.character]); const refreshButtonHandler = () => { - posthog.capture('refresh_button_clicked'); + posthog.capture(POSTHOG_EVENTS.REFRESH_BUTTON_CLICKED); requestFetchUser(); }; diff --git a/app/translations/en.json b/app/translations/en.json index 0b511b1..92c7e12 100644 --- a/app/translations/en.json +++ b/app/translations/en.json @@ -5,5 +5,7 @@ "because": "because", "wednesday_lover": "{{username}} loves Wednesday", "get_started": "To get started, edit App.js", - "refresh": "Refresh" + "refresh": "Refresh", + "ios_instructions": "Press Cmd+R to reload,\nCmd+D or shake for dev menu.", + "'android_instructions": "Double tap R on your keyboard to reload,\nShake or press menu button for dev menu." } diff --git a/app/utils/posthogEvents.js b/app/utils/posthogEvents.js new file mode 100644 index 0000000..79b7ccb --- /dev/null +++ b/app/utils/posthogEvents.js @@ -0,0 +1,3 @@ +export const POSTHOG_EVENTS = { + REFRESH_BUTTON_CLICKED: 'refresh_button_clicked' +}; diff --git a/app/utils/posthogUtils.js b/app/utils/posthogUtils.js index 3501300..1dda108 100644 --- a/app/utils/posthogUtils.js +++ b/app/utils/posthogUtils.js @@ -11,9 +11,7 @@ export const getPostHogClient = () => { posthog, 'client', new PostHog(POSTHOG_KEY, { - // usually 'https://us.i.posthog.com' or 'https://eu.i.posthog.com' - - host: 'https://us.i.posthog.com' + // In-case of custom endpoint please add 'host' property here with url }) ); }