From d8a27841c090bcafb3a8bbb712dc9cac451cc6ee Mon Sep 17 00:00:00 2001 From: thoreyjona Date: Fri, 11 Oct 2024 16:11:02 +0000 Subject: [PATCH] feat: extract heading section into a prop --- .../src/screens/health/health-overview.tsx | 144 ++++++------------ 1 file changed, 48 insertions(+), 96 deletions(-) diff --git a/apps/native/app/src/screens/health/health-overview.tsx b/apps/native/app/src/screens/health/health-overview.tsx index ea48fe36970e..ed458a3adbb9 100644 --- a/apps/native/app/src/screens/health/health-overview.tsx +++ b/apps/native/app/src/screens/health/health-overview.tsx @@ -32,9 +32,46 @@ const Host = styled(SafeAreaView)` const ButtonWrapper = styled(View)` flex-direction: row; margin-top: ${({ theme }) => theme.spacing[3]}px; + margin-bottom: ${({ theme }) => -theme.spacing[1]}px; gap: ${({ theme }) => theme.spacing[2]}px; ` +interface HeadingSectionProps { + title: string + onPress: () => void +} + +const HeadingSection: React.FC = ({ title, onPress }) => { + const theme = useTheme() + return ( + + + + + + + + } + > + {title} + + + ) +} + const { getNavigationOptions, useNavigationOptions } = createNavigationOptionHooks((theme, intl) => ({ topBar: { @@ -160,44 +197,15 @@ export const HealthOverviewScreen: NavigationFunctionComponent = ({ } /> - openBrowser( `${origin}/minarsidur/heilsa/heilsugaesla`, componentId, ) } - style={{ marginTop: theme.spacing[1] }} - > - - openBrowser( - `${origin}/minarsidur/heilsa/heilsugaesla`, - componentId, - ) - } - style={{ - flexDirection: 'row', - alignItems: 'center', - }} - > - - - - - - } - > - - - + /> - openBrowser(`${origin}/minarsidur/heilsa/yfirlit`, componentId) } - style={{ marginTop: theme.spacing[2] }} - > - - openBrowser( - `${origin}/minarsidur/heilsa/yfirlit`, - componentId, - ) - } - style={{ - flexDirection: 'row', - alignItems: 'center', - }} - > - - - - - - } - > - - - + /> {healthInsuranceRes.data?.rightsPortalInsuranceOverview?.isInsured || healthInsuranceRes.loading ? ( @@ -312,44 +291,17 @@ export const HealthOverviewScreen: NavigationFunctionComponent = ({ hasBorder /> )} - openBrowser( `${origin}/minarsidur/heilsa/greidslur/greidsluthatttaka`, componentId, ) } - style={{ marginTop: theme.spacing[2] }} - > - - openBrowser( - `${origin}/minarsidur/heilsa/greidslur/greidsluthatttaka`, - componentId, - ) - } - style={{ - flexDirection: 'row', - alignItems: 'center', - }} - > - - - - - - } - > - - - + />