Skip to content

Commit

Permalink
Merge branch 'main' into ci/revert-pr-workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
busla authored Nov 28, 2024
2 parents 459b1f8 + 9ea0c3d commit 529a85b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/web/layouts/organization/standalone/standalone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
SkipToMainContent,
} from '@island.is/web/components'
import { PRELOADED_FONTS } from '@island.is/web/constants'
import { GlobalContextProvider } from '@island.is/web/context'
import { OrganizationPage } from '@island.is/web/graphql/schema'
import { useLinkResolver } from '@island.is/web/hooks'
import { useI18n } from '@island.is/web/i18n'
Expand Down Expand Up @@ -87,7 +88,7 @@ export const StandaloneLayout = ({
const featuredImage = seo?.image ?? organizationPage.featuredImage

return (
<>
<GlobalContextProvider>
<Head>
{PRELOADED_FONTS.map((href, index) => {
return (
Expand Down Expand Up @@ -270,6 +271,6 @@ export const StandaloneLayout = ({
url('/fonts/ibm-plex-sans-v7-latin-600.woff') format('woff');
}
`}</style>
</>
</GlobalContextProvider>
)
}
7 changes: 7 additions & 0 deletions apps/web/screens/Organization/Standalone/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
QueryGetOrganizationPageArgs,
} from '@island.is/web/graphql/schema'
import { useNamespace } from '@island.is/web/hooks'
import useContentfulId from '@island.is/web/hooks/useContentfulId'
import { StandaloneLayout } from '@island.is/web/layouts/organization/standalone'
import type { Screen, ScreenContext } from '@island.is/web/types'
import { CustomNextError } from '@island.is/web/units/errors'
Expand All @@ -27,6 +28,11 @@ export interface StandaloneHomeProps {
namespace: Record<string, string>
}

const LanguageToggleSetup = (props: { id: string }) => {
useContentfulId(props.id)
return null
}

const StandaloneHome: Screen<
StandaloneHomeProps,
StandaloneHomeScreenContext
Expand All @@ -43,6 +49,7 @@ const StandaloneHome: Screen<
isFrontpage={true}
bannerTitle={n('bannerTitle', '')}
>
<LanguageToggleSetup id={organizationPage.id} />
<Stack space={SLICE_SPACING}>
<Stack space={SLICE_SPACING}>
{organizationPage.slices.map((slice) => {
Expand Down
9 changes: 9 additions & 0 deletions apps/web/screens/Organization/Standalone/ParentSubpage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
QueryGetOrganizationSubpageArgs,
} from '@island.is/web/graphql/schema'
import { useLinkResolver } from '@island.is/web/hooks'
import useContentfulId from '@island.is/web/hooks/useContentfulId'
import { useI18n } from '@island.is/web/i18n'
import { StandaloneLayout } from '@island.is/web/layouts/organization/standalone'
import type { Screen, ScreenContext } from '@island.is/web/types'
Expand Down Expand Up @@ -52,6 +53,11 @@ export interface StandaloneParentSubpageProps {
namespace: Record<string, string>
}

const LanguageToggleSetup = (props: { ids: string[] }) => {
useContentfulId(...props.ids)
return null
}

const StandaloneParentSubpage: Screen<
StandaloneParentSubpageProps,
StandaloneParentSubpageScreenContext
Expand All @@ -69,6 +75,9 @@ const StandaloneParentSubpage: Screen<

return (
<StandaloneLayout organizationPage={organizationPage}>
<LanguageToggleSetup
ids={[organizationPage.id, parentSubpage.id, subpage.id]}
/>
<GridContainer>
<GridRow>
<GridColumn span={['9/9', '9/9', '7/9']} offset={['0', '0', '1/9']}>
Expand Down
1 change: 1 addition & 0 deletions apps/web/screens/queries/Organization.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ export const GET_ORGANIZATION_PARENT_SUBPAGE_QUERY = gql`
$input: GetOrganizationParentSubpageInput!
) {
getOrganizationParentSubpage(input: $input) {
id
title
childLinks {
label
Expand Down

0 comments on commit 529a85b

Please sign in to comment.