From 224314e06205e50a7a435122db2f438013f518e1 Mon Sep 17 00:00:00 2001 From: Fernando Lucchesi Date: Thu, 26 Oct 2023 11:03:47 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20Cleanup=20not=20needed=20code=20?= =?UTF-8?q?and=20fix=20console=20warning=20#1944?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/pageComponents/shared/MagazineTagBar.tsx | 10 +++++----- web/pages/magasin/index.global.tsx | 4 +--- web/pages/magazine/index.global.tsx | 4 +--- web/pages/news/index.global.tsx | 4 +--- web/pages/nyheter/index.global.tsx | 4 +--- 5 files changed, 9 insertions(+), 17 deletions(-) diff --git a/web/pageComponents/shared/MagazineTagBar.tsx b/web/pageComponents/shared/MagazineTagBar.tsx index 979777f98..16f5406d8 100644 --- a/web/pageComponents/shared/MagazineTagBar.tsx +++ b/web/pageComponents/shared/MagazineTagBar.tsx @@ -15,10 +15,10 @@ export type TagLink = { active: boolean } & AnchorHTMLAttributes -const StyledLink = styled(Link).attrs((props: { active: boolean }) => props)` +const StyledLink = styled(Link).attrs((props: { $active: boolean }) => props)` display: inline-block; position: relative; - font-weight: ${(props) => (props.active ? 'bold' : 'normal')}; + font-weight: ${(props) => (props.$active ? 'bold' : 'normal')}; &:hover { font-weight: bold; } @@ -62,7 +62,7 @@ const TagWrapper = styled.div` ::-webkit-scrollbar { display: none; } - + @media (min-width: 1024px) { flex-wrap: wrap; padding: var(--space-large) var(--space-3xLarge); @@ -86,8 +86,8 @@ const MagazineTagBar = forwardRef(function { @@ -102,10 +102,10 @@ const MagazineTagBar = forwardRef(function {tags.map((it: TagLink) => ( { if (onClick) { diff --git a/web/pages/magasin/index.global.tsx b/web/pages/magasin/index.global.tsx index 905119b3b..9b69e1c03 100644 --- a/web/pages/magasin/index.global.tsx +++ b/web/pages/magasin/index.global.tsx @@ -71,14 +71,12 @@ MagazineIndexNorwegian.getLayout = (page: AppProps) => { ) } -export const getServerSideProps: GetServerSideProps = async ({ res, req, preview = false, locale = 'no' }) => { +export const getServerSideProps: GetServerSideProps = async ({ req, preview = false, locale = 'no' }) => { // For the time being, let's just give 404 for satellites // We will also return 404 if the locale is not Norwegian. // This is a hack and and we should improve this at some point // See https://github.com/vercel/next.js/discussions/18485 - res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate') - if (locale !== 'no') { return { notFound: true, diff --git a/web/pages/magazine/index.global.tsx b/web/pages/magazine/index.global.tsx index 305189f83..2c66fd642 100644 --- a/web/pages/magazine/index.global.tsx +++ b/web/pages/magazine/index.global.tsx @@ -66,14 +66,12 @@ MagazineIndex.getLayout = (page: AppProps) => { ) } -export const getServerSideProps: GetServerSideProps = async ({ res, req, preview = false, locale = 'en' }) => { +export const getServerSideProps: GetServerSideProps = async ({ req, preview = false, locale = 'en' }) => { // For the time being, let's just give 404 for satellites // We will also return 404 if the locale is not English. // This is a hack and and we should improve this at some point // See https://github.com/vercel/next.js/discussions/18485 - res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate') - if (locale !== 'en') { return { notFound: true, diff --git a/web/pages/news/index.global.tsx b/web/pages/news/index.global.tsx index 472dd19a1..0a5ebf1a5 100644 --- a/web/pages/news/index.global.tsx +++ b/web/pages/news/index.global.tsx @@ -67,14 +67,12 @@ NewsRoom.getLayout = (page: AppProps) => { ) } -export const getServerSideProps: GetServerSideProps = async ({ res, req, preview = false, locale = 'en' }) => { +export const getServerSideProps: GetServerSideProps = async ({ req, preview = false, locale = 'en' }) => { // For the time being, let's just give 404 for satellites // We will also return 404 if the locale is not English. // This is a hack and and we should improve this at some point // See https://github.com/vercel/next.js/discussions/18485 - res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate') - if (locale !== 'en') { return { notFound: true, diff --git a/web/pages/nyheter/index.global.tsx b/web/pages/nyheter/index.global.tsx index 44ad4a074..4109b13e8 100644 --- a/web/pages/nyheter/index.global.tsx +++ b/web/pages/nyheter/index.global.tsx @@ -65,14 +65,12 @@ NorwegianNewsRoom.getLayout = (page: AppProps) => { ) } -export const getServerSideProps: GetServerSideProps = async ({ res, req, preview = false, locale = 'no' }) => { +export const getServerSideProps: GetServerSideProps = async ({ req, preview = false, locale = 'no' }) => { // For the time being, let's just give 404 for satellites // We will also return 404 if the locale is not Norwegian. // This is a hack, and we should improve this at some point // See https://github.com/vercel/next.js/discussions/18485 - res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate') - if (locale !== 'no') { return { notFound: true,