Skip to content

Commit

Permalink
chore(details): nextjs-15 update
Browse files Browse the repository at this point in the history
  • Loading branch information
Lillebo committed Nov 22, 2024
1 parent a57f9f9 commit 4050937
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 79 deletions.
3 changes: 2 additions & 1 deletion apps/data-norge/src/app/[lang]/view/api/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { i18n, getDictionary } from '@fdk-frontend/dictionaries';
import DetailsPage from '../../../components/details/details-page/api';
import { DetailsPageWrapperProps } from '../page';

const APIPageWrapper = async ({ params }: DetailsPageWrapperProps) => {
const APIPageWrapper = async (props: DetailsPageWrapperProps) => {
const params = await props.params;
const locale = params.lang ?? i18n.defaultLocale;
const commonDictionary = await getDictionary(locale, 'common');

Expand Down
3 changes: 2 additions & 1 deletion apps/data-norge/src/app/[lang]/view/begrep/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { i18n, getDictionary } from '@fdk-frontend/dictionaries';
import DetailsPage from '../../../components/details/details-page/begrep';
import { DetailsPageWrapperProps } from '../page';

const BegrepsPageWrapper = async ({ params }: DetailsPageWrapperProps) => {
const BegrepsPageWrapper = async (props: DetailsPageWrapperProps) => {
const params = await props.params;
const locale = params.lang ?? i18n.defaultLocale;
const commonDictionary = await getDictionary(locale, 'common');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { i18n, getDictionary } from '@fdk-frontend/dictionaries';
import DetailsPage from '../../../components/details/details-page/datasett-worstcase';
import { DetailsPageWrapperProps } from '../page';

const DatasettRichPageWrapper = async ({ params }: DetailsPageWrapperProps) => {
const DatasettRichPageWrapper = async (props: DetailsPageWrapperProps) => {
const params = await props.params;
const locale = params.lang ?? i18n.defaultLocale;
const commonDictionary = await getDictionary(locale, 'common');

Expand Down
6 changes: 4 additions & 2 deletions apps/data-norge/src/app/[lang]/view/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import DocsLayout, { generateStaticParams } from '@fdk-frontend/ui/layouts/docs-layout';
import DocsLayout from '@fdk-frontend/ui/layouts/docs-layout';

export const revalidate = 0;
export const dynamic = 'force-dynamic';

export default DocsLayout;
export { generateStaticParams };
7 changes: 4 additions & 3 deletions apps/data-norge/src/app/[lang]/view/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ import { i18n, getDictionary, type LocaleCodes } from '@fdk-frontend/dictionarie
import DetailsPage from '../../components/details/details-page';

export type DetailsPageWrapperProps = {
params: {
params: Promise<{
lang: LocaleCodes;
slug: string[];
};
}>;
};

const DetailsPageWrapper = async ({ params }: DetailsPageWrapperProps) => {
const DetailsPageWrapper = async (props: DetailsPageWrapperProps) => {
const params = await props.params;
const locale = params.lang ?? i18n.defaultLocale;
const commonDictionary = await getDictionary(locale, 'common');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { PropsWithChildren } from 'react';
import NextLink from 'next/link';

import { Heading, Button, Link, Paragraph, Alert } from '@digdir/designsystemet-react';
import { ExternalLinkIcon } from '@navikt/aksel-icons';
Expand Down Expand Up @@ -104,10 +105,10 @@ const CommunityTab = ({ children }: PropsWithChildren) => {
</Paragraph>
<HStack>
<Button variant='secondary' size='sm' asChild>
<a href="https://datalandsbyen.norge.no/">Gå til Datalandsbyen <ExternalLinkIcon /></a>
<NextLink href="https://datalandsbyen.norge.no/">Gå til Datalandsbyen <ExternalLinkIcon /></NextLink>
</Button>
<Button variant='secondary' size='sm' asChild>
<a href="/docs/community">Mer informasjon</a>
<NextLink href="/docs/community">Mer informasjon</NextLink>
</Button>
</HStack>
</VStack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export default function DetailsPage({ locale, commonDictionary }: DetailsPageTyp

const breadcrumbList = [
{
href: '#',
text: 'Datasett',
href: '/data-services',
text: 'API-er',
},
{
href: '#',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ export type DetailsPageType = {
export default function DetailsPage({ locale, commonDictionary }: DetailsPageType) {
const breadcrumbList = [
{
href: '#',
text: 'Datasett',
href: '/concepts',
text: 'Begreper',
},
{
href: '#',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function DetailsPage({ locale, commonDictionary }: DetailsPageTyp

const breadcrumbList = [
{
href: '#',
href: '/datasets',
text: 'Datasett',
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default function DetailsPage({ locale, commonDictionary }: DetailsPageTyp

const breadcrumbList = [
{
href: '#',
href: '/datasets',
text: 'Datasett',
},
{
Expand Down Expand Up @@ -291,29 +291,6 @@ For datasettene *Vannforsyningssystem*, *Transportsystem*, og *Inntakspunkt* er
</tr>
</tbody>
</table>
{/*<ul className={cn(styles.related)}>
<li>
<Link href="#">
<span>Hydrologiske data</span>
<span>Norges vassdrags- og energidirektorat (nve)</span>
<Tag color='success' size='sm'>Åpne data</Tag>
</Link>
</li>
<li>
<Link href="#">
<span>Standard for yrkesklassifisering (STYRK08)</span>
<span>Statistisk sentralbyrå</span>
<Tag color='success' size='sm'>Åpne data</Tag>
</Link>
</li>
<li>
<Link href="#">
<span>Folketeljinga 1910</span>
<span>Arkivverket</span>
<Tag color='warning' size='sm'>Begrenset tilgang</Tag>
</Link>
</li>
</ul>*/}
</section>
</TabContent>
<TabContent value='distribusjoner'>
Expand All @@ -323,45 +300,6 @@ For datasettene *Vannforsyningssystem*, *Transportsystem*, og *Inntakspunkt* er
apis={apis}
className={cn({ [styles.highlight]: highlight })}
/>
{/*<BrandDivider className={styles.divider} />
<section className={styles.section}>
<Heading
level={4}
size='xxsmall'
>
Relaterte APIer
</Heading>
<table className='table'>
<tbody>
<tr>
<td>
<Link href='#'>Transportsystem API</Link>
</td>
<td>
<span className={styles.relatedPublisher}>
Mattilsynet
</span>
</td>
<td align='right'>
<Button variant='secondary' size='sm'>Gå til API</Button>
</td>
</tr>
<tr>
<td>
<Link href='#'>Trafikkdata 2024</Link>
</td>
<td>
<span className={styles.relatedPublisher}>
Vegvesenet
</span>
</td>
<td align='right'>
<Button variant='secondary' size='sm'>Gå til API</Button>
</td>
</tr>
</tbody>
</table>
</section>*/}
</TabContent>
<TabContent value='detaljer'>
<DatasetDetails details={fullDetails} />
Expand Down
1 change: 0 additions & 1 deletion libs/ui/src/lib/language-switcher/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const LanguageSwitcher = ({ inverted }: LanguageSwitcherProps) => {
defaultValue={defaultCode}
size='sm'
onChange={(code) => onLanguageSelect(code as LocaleCodes)}
name='Select language'
>
{i18n.locales.map((locale) => (
<ToggleGroup.Item
Expand Down

0 comments on commit 4050937

Please sign in to comment.