Skip to content

Commit

Permalink
feat: pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Shamoil authored and Shamoil committed Sep 9, 2024
1 parent e9f2eee commit 83de9eb
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
13 changes: 6 additions & 7 deletions app/scenes/ExampleScreen/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -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);
Expand All @@ -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();
Expand All @@ -59,7 +58,7 @@ const ExampleScreen = () => {
}, [userLoadable?.contents?.character]);

const refreshButtonHandler = () => {
posthog.capture('refresh_button_clicked');
posthog.capture(POSTHOG_EVENTS.REFRESH_BUTTON_CLICKED);
requestFetchUser();
};

Expand Down
4 changes: 3 additions & 1 deletion app/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
3 changes: 3 additions & 0 deletions app/utils/posthogEvents.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const POSTHOG_EVENTS = {
REFRESH_BUTTON_CLICKED: 'refresh_button_clicked'
};
4 changes: 1 addition & 3 deletions app/utils/posthogUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
);

Check warning on line 16 in app/utils/posthogUtils.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}

Check warning on line 17 in app/utils/posthogUtils.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 17 in app/utils/posthogUtils.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
Expand Down

0 comments on commit 83de9eb

Please sign in to comment.