Skip to content

Commit ae9069b

Browse files
committed
Use Gatsby Link
Signed-off-by: Kowalski Dragon (kowalski7cc) <kowalski7cc@users.noreply.github.com>
1 parent d9a0694 commit ae9069b

File tree

3 files changed

+27
-7
lines changed

3 files changed

+27
-7
lines changed

src/components/header.jsx

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Container from "react-bootstrap/Container";
44
import Nav from "react-bootstrap/Nav";
55
import Navbar from "react-bootstrap/Navbar";
66
import Logo from "../assets/foot.svg";
7+
import { Link } from "gatsby";
78

89
const Header = () => {
910
const data = useStaticQuery(graphql`
@@ -48,7 +49,11 @@ const Header = () => {
4849
}}
4950
>
5051
<Container>
51-
<Navbar.Brand className='brand d-flex align-items-center' href='/'>
52+
<Navbar.Brand
53+
as={Link}
54+
className='brand d-flex align-items-center'
55+
href='/'
56+
>
5257
<img
5358
src={Logo}
5459
style={{ fontSize: "1.5em" }}
@@ -65,16 +70,26 @@ const Header = () => {
6570
className='justify-content-end'
6671
>
6772
<Nav>
68-
<Nav.Link href='/#explore'>Evento</Nav.Link>
73+
<Nav.Link as={Link} href='/#explore'>
74+
Evento
75+
</Nav.Link>
6976
{switches.cfp && (
70-
<Nav.Link href='/#schedule'>Call for papers</Nav.Link>
77+
<Nav.Link as={Link} href='/#schedule'>
78+
Call for papers
79+
</Nav.Link>
7180
)}
72-
<Nav.Link href={`/schedule/${params}#calendar`}>
81+
<Nav.Link as={Link} href={`/schedule/${params}#calendar`}>
7382
{switches.schedule ? "Programma" : "Programma precedente"}
7483
</Nav.Link>
75-
<Nav.Link href='/codeofconduct'>Code of Conduct</Nav.Link>
76-
<Nav.Link href='/#sponsors'>Patrocini</Nav.Link>
77-
<Nav.Link href='/#contattaci'>Contatti</Nav.Link>
84+
<Nav.Link as={Link} href='/codeofconduct'>
85+
Code of Conduct
86+
</Nav.Link>
87+
<Nav.Link as={Link} href='/#sponsors'>
88+
Patrocini
89+
</Nav.Link>
90+
<Nav.Link as={Link} href='/#contattaci'>
91+
Contatti
92+
</Nav.Link>
7893
</Nav>
7994
</Navbar.Collapse>
8095
</Container>

src/components/hero.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
66
import { icon } from "@fortawesome/fontawesome-svg-core/import.macro";
77
import Alert from "react-bootstrap/Alert";
88
import { StaticImage } from "gatsby-plugin-image";
9+
import { Link } from "gatsby";
910

1011
const Hero = ({ small }) => {
1112
const data = useStaticQuery(graphql`
@@ -153,13 +154,15 @@ const Hero = ({ small }) => {
153154
<div className='mt-5 gx-5 d-flex flex-wrap justify-content-start clearfix'>
154155
<Button
155156
href='/#explore'
157+
as={Link}
156158
size='lg'
157159
className='m-1'
158160
variant='warning'
159161
>
160162
Scopri di più
161163
</Button>
162164
<Button
165+
as={Link}
163166
href={`/schedule/${params}#calendar`}
164167
size='lg'
165168
className='m-1'

src/pages/index.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import watch from "../assets/watch.svg";
99
import { GatsbyImage, getImage } from "gatsby-plugin-image";
1010
import Seo from "../components/seo";
1111
import Hero from "../components/hero";
12+
import { Link } from "gatsby";
1213

1314
const IndexPage = ({ data }) => {
1415
const isPast = new Date(data.site.siteMetadata.event.date) <= new Date();
@@ -219,6 +220,7 @@ const IndexPage = ({ data }) => {
219220
})}
220221
</ul>
221222
<Button
223+
as={Link}
222224
href='/schedule'
223225
className='btn-lg'
224226
variant='warning'

0 commit comments

Comments
 (0)