Skip to content

Commit

Permalink
fix: open internal links in same tab (#358)
Browse files Browse the repository at this point in the history
* fix: internal links don't open in a new tab

* fix Pressroom cards layout
  • Loading branch information
DiogoSoaress authored May 31, 2024
1 parent ae356c2 commit 1811170
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 19 deletions.
30 changes: 12 additions & 18 deletions src/components/Pressroom/ContentsNavigation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { PRESS_LINK } from '@/config/constants'
type NavItemType = {
label: string
href: string
target?: HTMLAnchorElement['target']
rel?: HTMLAnchorElement['rel']
}

export const enum PressroomIds {
Expand All @@ -20,30 +22,22 @@ const sections: NavItemType[] = [
{ label: 'Safe in the news', href: `#${PressroomIds.SAFE_IN_THE_NEWS}` },
{ label: 'Press releases', href: `#${PressroomIds.PRESS_RELEASES}` },
{ label: 'Blog', href: AppRoutes.blog.index },
{ label: 'Media kit', href: PRESS_LINK },
{ label: 'Media kit', href: PRESS_LINK, target: '_blank', rel: 'noopener noreferrer' },
]

const ContentsNavigation = () => (
<Box mt="140px">
<Typography variant="h3">What are you looking for?</Typography>
<Grid container columnSpacing="32px" rowGap="36px" mt="36px">
{sections.map((item) => {
const isAnchor = item.href.startsWith('#')

return (
<Grid item xs={12} md={4} key={item.href}>
<NextLink
href={item.href}
target={!isAnchor ? '_blank' : undefined}
rel={!isAnchor ? 'noopener noreferrer' : undefined}
>
<ButtonBase className={css.navButton}>
<Typography>{item.label}</Typography>
</ButtonBase>
</NextLink>
</Grid>
)
})}
{sections.map((item) => (
<Grid item xs={12} md={4} key={item.href}>
<NextLink {...item}>
<ButtonBase className={css.navButton}>
<Typography>{item.label}</Typography>
</ButtonBase>
</NextLink>
</Grid>
))}
</Grid>
</Box>
)
Expand Down
1 change: 0 additions & 1 deletion src/components/common/LinkCard/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
-webkit-line-clamp: 4;
-webkit-box-orient: vertical;
flex-shrink: 0;
margin-top: auto;
}

.card:hover .arrow path {
Expand Down

0 comments on commit 1811170

Please sign in to comment.