Skip to content

Commit

Permalink
Merge pull request #370 from lifeomic/support-link
Browse files Browse the repository at this point in the history
Replace supportLink with support.url
  • Loading branch information
aymanenadi authored Sep 20, 2023
2 parents 177f945 + fe50d84 commit 40a87cc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/hooks/useAppConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export interface AppConfig {
url: string;
title?: string;
};
supportLink?: string;
support?: { url: string };
brand?: Record<string, any>;
}

Expand Down
4 changes: 3 additions & 1 deletion src/screens/SettingsScreen.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ beforeEach(() => {
});
useAppConfigMock.mockReturnValue({
data: {
supportLink: 'http://unit-test/support',
support: {
url: 'http://unit-test/support',
},
},
});
});
Expand Down
6 changes: 3 additions & 3 deletions src/screens/SettingsScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const SettingsScreen = ({
const { useWearableIntegrationsQuery } = useWearables();
const { data: wearablesData } = useWearableIntegrationsQuery();
const { data: appConfigData } = useAppConfig();
const supportLink = appConfigData?.supportLink;
const support = appConfigData?.support;

return (
<View style={styles.container}>
Expand All @@ -50,12 +50,12 @@ export const SettingsScreen = ({
/>
</>
)}
{!!supportLink && (
{!!support?.url && (
<>
<Divider />
<MainMenuItem
title={t('settings-support', 'Support')}
action={() => openURL(supportLink)}
action={() => openURL(support.url)}
/>
</>
)}
Expand Down

0 comments on commit 40a87cc

Please sign in to comment.