Skip to content

Commit

Permalink
🔥 Cleanup not needed code and fix console warning #1944
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandolucchesi committed Oct 26, 2023
1 parent f1088cf commit 224314e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 17 deletions.
10 changes: 5 additions & 5 deletions web/pageComponents/shared/MagazineTagBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ export type TagLink = {
active: boolean
} & AnchorHTMLAttributes<HTMLAnchorElement>

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;
}
Expand Down Expand Up @@ -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);
Expand All @@ -86,8 +86,8 @@ const MagazineTagBar = forwardRef<HTMLDivElement, MagazineTagBarProps>(function
<Wrapper ref={ref}>
<TagWrapper>
<StyledLink
$active={allTagLink.active}
href={href}
active={allTagLink.active}
underline={false}
data-title={allTagLink.label}
onClick={(event) => {
Expand All @@ -102,10 +102,10 @@ const MagazineTagBar = forwardRef<HTMLDivElement, MagazineTagBarProps>(function
</StyledLink>
{tags.map((it: TagLink) => (
<StyledLink
$active={it.active}
underline={false}
href={`${href}${`?tag=${it.label}`}`}
key={`key_${it.label}`}
active={it.active}
data-title={it.label}
onClick={(event) => {
if (onClick) {
Expand Down
4 changes: 1 addition & 3 deletions web/pages/magasin/index.global.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 1 addition & 3 deletions web/pages/magazine/index.global.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 1 addition & 3 deletions web/pages/news/index.global.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 1 addition & 3 deletions web/pages/nyheter/index.global.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 224314e

Please sign in to comment.