diff --git a/messages/en.json b/messages/en.json index 398dfcf..44f1e18 100644 --- a/messages/en.json +++ b/messages/en.json @@ -43,6 +43,7 @@ "news": { "title": "News", "page": "Page", - "internalArticle": "This is an internal article" + "internalArticle": "This is an internal article", + "newArticle": "New article" } } diff --git a/messages/no.json b/messages/no.json index 0fa4ec2..ba6a4bd 100644 --- a/messages/no.json +++ b/messages/no.json @@ -43,6 +43,7 @@ "news": { "title": "Nyheter", "page": "Side", - "internalArticle": "Dette er en intern artikkel" + "internalArticle": "Dette er en intern artikkel", + "newArticle": "Ny artikkel" } } diff --git a/src/app/[locale]/(dashboard)/news/page.tsx b/src/app/[locale]/(dashboard)/news/page.tsx index d007fca..3564e60 100644 --- a/src/app/[locale]/(dashboard)/news/page.tsx +++ b/src/app/[locale]/(dashboard)/news/page.tsx @@ -1,10 +1,13 @@ +import { SquarePen } from 'lucide-react'; import { useTranslations } from 'next-intl'; import { getTranslations, unstable_setRequestLocale } from 'next-intl/server'; +import { Link } from '@/lib/navigation'; import { cx } from '@/lib/utils'; import { NewsCard } from '@/components/news/NewsCard'; import { NewsItemGrid } from '@/components/news/NewsItemGrid'; +import { Button } from '@/components/ui/Button'; import { Separator } from '@/components/ui/Separator'; export async function generateMetadata({ @@ -190,9 +193,18 @@ export default function News({ ]; unstable_setRequestLocale(locale); const t = useTranslations('news'); + // TODO: Button to create new article should only be visible when logged in return ( <> -

{t('title')}

+
+

{t('title')}

+ +
{mockData.slice(0, 4).map((data, index) => ( diff --git a/src/lib/config.ts b/src/lib/config.ts index e289056..e6aca37 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -18,6 +18,10 @@ const pathnames = { en: '/news', no: '/nyheter', }, + '/news/new': { + en: '/news/new', + no: '/nyheter/ny', + }, '/news/[articleId]': { en: '/news/[articleId]', no: '/nyheter/[articleId]',