Skip to content

Commit

Permalink
fix: tabbar
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgfr committed Jan 1, 2022
1 parent 81567ab commit e889ed8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ function MyApp({ Component, pageProps }: AppProps) {
links={[
{ href: "/biographie", label: "Biographie" },
{ href: "/contact", label: "Contact" },
{
href: "https://michelgolfier.wordpress.com/",
label: "Blog",
isExternal: true,
},
]}
title="Michel Golfier"
/>
Expand Down
8 changes: 5 additions & 3 deletions src/components/header.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HamburgerIcon } from "@chakra-ui/icons";
import { HamburgerIcon, ExternalLinkIcon } from "@chakra-ui/icons";
import {
Box,
Text,
Expand All @@ -18,6 +18,7 @@ import NextLink from "next/link";
type Links = {
href: string;
label: string;
isExternal?: boolean;
};

type Props = {
Expand Down Expand Up @@ -85,10 +86,11 @@ export function Header({ title, links }: Props): JSX.Element {
left="50%"
top="50%"
>
{links.map(({ href, label }) => (
{links.map(({ href, label, isExternal }) => (
<NextLink key={href} href={href} passHref>
<Link fontSize="xl" marginX={2}>
<Link fontSize="xl" marginX={2} isExternal={isExternal}>
{label}
{isExternal && <ExternalLinkIcon marginLeft="8px" />}
</Link>
</NextLink>
))}
Expand Down

1 comment on commit e889ed8

@vercel
Copy link

@vercel vercel bot commented on e889ed8 Jan 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.