Skip to content

Commit 8e79902

Browse files
committed
changes
1 parent 440cb5d commit 8e79902

5 files changed

Lines changed: 17 additions & 10 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ export function HeadComponent({
99
title,
1010
description = `Join us for the AsyncAPI Conference, bringing the latest in AsyncAPI technology to locations worldwide!`,
1111
image = '/img/ogimage/home.jpg',
12+
}: {
13+
title: string;
14+
description?: string;
15+
image?: string;
1216
}) {
1317
const url = process.env.NEXT_PUBLIC_DEPLOY_URL || 'http://localhost:3000';
1418
const appContext = useContext(AppContext);

pages/_app.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import Navbar from '../components/Navbar/navbar';
33
import Footer from '../components/Footer/footer';
44
import { AppProps } from 'next/app';
55
import { useEffect, useState } from 'react';
6-
7-
function MyApp({ Component, pageProps }: AppProps) {
6+
import AppContext from '../context/AppContext';
7+
function MyApp({ Component, pageProps,router}: AppProps) {
88
const [isClient, setIsClient] = useState<boolean>(false);
99
useEffect(() => {
1010
setIsClient(true);
@@ -13,12 +13,13 @@ function MyApp({ Component, pageProps }: AppProps) {
1313
return <></>;
1414
}
1515
return (
16+
<AppContext.Provider value={{ path: router.asPath }}>
1617
<div>
1718
<Navbar />
18-
1919
<Component {...pageProps} />
2020
<Footer />
2121
</div>
22+
</AppContext.Provider>
2223
);
2324
}
2425

pages/index.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/* eslint-disable @next/next/no-img-element */
22
import { useState } from 'react';
3-
import Head from 'next/head';
43
import { useMediaQuery } from 'react-responsive';
54
import Header from '../components/Header/header';
65
import Sponsors from '../components/Sponsors/sponsors';
@@ -16,7 +15,7 @@ import Link from 'next/link';
1615
import Button from '../components/Buttons/button';
1716
import Dropdown from '../components/Dropdown/dropdown';
1817
import { City } from '../types/types';
19-
18+
import { HeadComponent as Head} from "../components/Head";
2019
export default function Home() {
2120
const isTablet = useMediaQuery({ maxWidth: '1118px' });
2221
const [speakersList, setSpeakersList] = useState(speakers);
@@ -38,11 +37,7 @@ export default function Home() {
3837
};
3938
return (
4039
<div>
41-
<Head>
42-
<title>AsyncAPI Conference</title>
43-
<meta name="description" content="Generated by create next app" />
44-
<link rel="icon" href="/favicon.ico" />
45-
</Head>
40+
<Head title="AsyncAPI Conference" />
4641
<img
4742
src="/img/illustra.png"
4843
className="color-effect"

pages/venue/[id].tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import Agenda from '../../components/Agenda/agenda';
2020
import Guidelines from '../../components/Speaker/guideline';
2121
import CFPdata from '../../config/cfp-data.json';
2222
import { GetStaticPropsContext } from 'next';
23+
import { HeadComponent as Head } from '../../components/Head';
2324

2425
interface IVenue {
2526
city: ExtendedCity;
@@ -60,8 +61,14 @@ function Venue({ city }: IVenue) {
6061
const eventStatus = getEventStatus(city.date);
6162
const textColor: string =
6263
eventStatus === ConferenceStatus.ENDED ? 'text-gray-400' : 'text-white';
64+
const venueTitle = `${city.name} | AsyncAPI Conference`;
6365
return (
6466
<div data-test={`venue-${city.name}`}>
67+
<Head
68+
title={venueTitle}
69+
description={city.description}
70+
image={city.img}
71+
/>
6572
<div
6673
style={{
6774
backgroundImage: city.name == 'Online' ? '' : `url(${city.img})`,

0 commit comments

Comments
 (0)