Skip to content

Commit a00726a

Browse files
committed
feat: add ogp logo header
1 parent a06c05f commit a00726a

File tree

2 files changed

+28
-10
lines changed

2 files changed

+28
-10
lines changed

frontend/src/features/public-form/components/FormLogo/FormBannerLogo.tsx

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { useEffect, useMemo, useState } from 'react'
22
import { BiImage } from 'react-icons/bi'
33
import {
44
Box,
5+
Divider,
56
Flex,
67
Grid,
78
Icon,
@@ -11,9 +12,13 @@ import {
1112
Stack,
1213
Text,
1314
} from '@chakra-ui/react'
15+
import { useFeatureValue } from '@growthbook/growthbook-react'
1416

17+
import { featureFlags } from '~shared/constants'
1518
import { FormColorTheme } from '~shared/types'
1619

20+
import { OgpLogoFull } from '~assets/svgrs/brand/OgpFullLogo'
21+
1722
import { FormLogoutButton } from './FormLogoutButton'
1823

1924
export interface FormBannerLogoProps {
@@ -79,21 +84,33 @@ export const FormBannerLogo = ({
7984
}
8085
}, [fallbackType, logoImgSrc])
8186

87+
const enableOgpHeader = useFeatureValue(featureFlags.ogpHeader, false)
88+
8289
if (!hasLogo && !isLoading) return null
8390

8491
return (
8592
<Grid p="1rem" bg="white" gridTemplateColumns="1fr auto 1fr">
8693
<Spacer />
87-
<Flex maxW="57rem">
88-
<Image
89-
fallback={fallback}
90-
onLoad={() => setFallbackType('loaded')}
91-
onError={() => setFallbackType('error')}
92-
src={logoImgSrc}
93-
alt={logoImgAlt}
94-
minH="1.25rem"
95-
maxH="4rem"
96-
/>
94+
<Flex alignItems={'center'} justifyContent="center" p={4}>
95+
<Flex maxW="57rem">
96+
<Image
97+
fallback={fallback}
98+
onLoad={() => setFallbackType('loaded')}
99+
onError={() => setFallbackType('error')}
100+
src={logoImgSrc}
101+
alt={logoImgAlt}
102+
minH="1.25rem"
103+
maxH="4rem"
104+
/>
105+
</Flex>
106+
{enableOgpHeader && (
107+
<>
108+
<Divider orientation="vertical" />
109+
<Box ml={3}>
110+
<OgpLogoFull fontStyle={'3rem'} height={`3rem`} />
111+
</Box>
112+
</>
113+
)}
97114
</Flex>
98115
<FormLogoutButton
99116
colorScheme={`theme-${colorTheme}`}

shared/constants/feature-flags.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ export const featureFlags = {
2828
singpassMrf: 'singpass-mrf' as const,
2929
enableSaveDraftButtonFloating: 'enable-save-draft-button-floating' as const,
3030
enableSaveDraftButtonHeader: 'enable-save-draft-button-header' as const,
31+
ogpHeader: 'enable-ogp-header' as const,
3132
}

0 commit comments

Comments
 (0)