From bebcf4908f94510cf5cc958c6f780b4f3dc4dfe4 Mon Sep 17 00:00:00 2001 From: mannipje <135017126+mannipje@users.noreply.github.com> Date: Tue, 3 Dec 2024 11:42:28 +0000 Subject: [PATCH] feat(web): Add search input to organization standalone theme mobile frontpage (#17095) * Add search input to organization standalone theme frontpage * chore: nx format:write update dirty files --------- Co-authored-by: andes-it Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .../standalone/components/Header.tsx | 104 +++++++++++------- .../organization/standalone/standalone.tsx | 1 + 2 files changed, 66 insertions(+), 39 deletions(-) diff --git a/apps/web/layouts/organization/standalone/components/Header.tsx b/apps/web/layouts/organization/standalone/components/Header.tsx index 919361d42d5f..0ec899b9ea58 100644 --- a/apps/web/layouts/organization/standalone/components/Header.tsx +++ b/apps/web/layouts/organization/standalone/components/Header.tsx @@ -2,8 +2,17 @@ import { useEffect, useState } from 'react' import { useWindowSize } from 'react-use' import cn from 'classnames' -import { ResponsiveSpace, Text, TextProps } from '@island.is/island-ui/core' +import { + Box, + Hidden, + ResponsiveSpace, + Stack, + Text, + TextProps, +} from '@island.is/island-ui/core' import { theme } from '@island.is/island-ui/theme' +import { SearchInput } from '@island.is/web/components' +import { useI18n } from '@island.is/web/i18n' import * as styles from './Header.css' @@ -21,6 +30,7 @@ export interface HeaderProps { imageObjectPosition?: 'left' | 'center' | 'right' className?: string isFrontpage?: boolean + organizationSlug?: string } export const Header: React.FC> = ({ @@ -36,8 +46,10 @@ export const Header: React.FC> = ({ imageObjectPosition = 'center', className, isFrontpage = false, + organizationSlug, }) => { const { width } = useWindowSize() + const { activeLocale } = useI18n() const imageProvided = !!image const [isMobile, setIsMobile] = useState(false) @@ -46,50 +58,64 @@ export const Header: React.FC> = ({ setIsMobile(width < theme.breakpoints.lg) }, [width]) return ( -
+
- {underTitle && isFrontpage && ( -
- - {underTitle} - -
+
+ {underTitle && isFrontpage && ( +
+ + {underTitle} + +
+ )} +
+ {imageProvided && isFrontpage && ( + )}
- {imageProvided && isFrontpage && ( - - )}
-
+ {isFrontpage && ( + + + + + + )} + ) } diff --git a/apps/web/layouts/organization/standalone/standalone.tsx b/apps/web/layouts/organization/standalone/standalone.tsx index e170c447de52..0546ad67422a 100644 --- a/apps/web/layouts/organization/standalone/standalone.tsx +++ b/apps/web/layouts/organization/standalone/standalone.tsx @@ -67,6 +67,7 @@ export const StandaloneLayout = ({ mobileBackground: organizationPage?.themeProperties.mobileBackgroundColor, isFrontpage: isFrontpage, underTitle: bannerTitle, + organizationSlug: organizationPage?.organization?.slug ?? '', } const { activeLocale } = useI18n()