Skip to content

File tree

7 files changed

+167
-104
lines changed

7 files changed

+167
-104
lines changed

pages/index.tsx

+35
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import styled from "@emotion/styled";
22
import type { NextPage } from "next";
3+
import dynamic from "next/dynamic";
34
import { lazy, Suspense } from "react";
45

56
import Banner from "../src/Components/BannerComponent";
67
import FlagMessage, { Message } from "../src/Components/FlagMessage";
8+
import { StyledWrapperSuspense } from "../src/Components/NavBar/components";
79
import Seo from "../src/Components/Seo";
810
import StickContainer from "../src/Components/StickContainer";
911
import EventSchema from "../src/Components/schema/event";
@@ -42,6 +44,20 @@ const FriendSection = lazy(
4244
async () => await import("../src/Components/sections/FriendSection")
4345
);
4446

47+
const VideoSection = dynamic(
48+
async () => await import("../src/Components/sections/VideoSection"),
49+
{
50+
ssr: false,
51+
}
52+
);
53+
54+
const NavBar = dynamic(
55+
async () => await import("../src/Components/NavBar/NavBar"),
56+
{
57+
ssr: false,
58+
}
59+
);
60+
4561
type Page = ParseQuery<HomeQueryQuery["page"]>;
4662

4763
export interface PageProps {
@@ -70,11 +86,30 @@ const StyledBlackWrapp = styled.section`
7086
background-color: ${({ theme }) => theme.elements.global.backgroundColor};
7187
`;
7288

89+
const NavBarWrapper = styled.div`
90+
height: 100px;
91+
background-color: ${({ theme }) => theme.elements.navBar.bgColor};
92+
`;
93+
7394
const Home: NextPage<PageProps> = (props: PageProps) => {
7495
return (
7596
<Container>
7697
<Seo {...props.seo} />
7798
<EventSchema />
99+
<NavBarWrapper>
100+
<Suspense fallback={<StyledWrapperSuspense />}>
101+
<NavBar />
102+
</Suspense>
103+
</NavBarWrapper>
104+
<Suspense fallback={null}>
105+
<div id="player">
106+
<VideoSection
107+
url=""
108+
title="JSConf Chile"
109+
videoId={props.flags?.videoId ?? ""}
110+
/>
111+
</div>
112+
</Suspense>
78113
<Suspense fallback={null}>
79114
<Hero heroData={props.heroData} />
80115
</Suspense>

pages/laprevia.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,11 @@ const Home: NextPage<PageProps> = (props: PageProps) => {
182182
</Suspense>
183183
<Suspense fallback={null}>
184184
<div id="player">
185-
<VideoSection videoId={props.flags?.videoId ?? ""} />
185+
<VideoSection
186+
url="laprevia"
187+
title="La Previa"
188+
videoId={props.flags?.videoId ?? ""}
189+
/>
186190
</div>
187191
</Suspense>
188192
<Suspense fallback={null}>

src/Components/NavBar/InternalNavBar.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ const StyledNav = styled(motion.nav)`
3838
width: 100%;
3939
display: flex;
4040
overflow: hidden;
41+
background: ${({ theme }) => theme.elements.navBar.bgColor};
4142
color: ${({ theme }) => theme.elements.navBar.textColor};
4243
`;
4344

src/Components/sections/Hero.tsx

-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
/* eslint-disable @next/next/no-img-element */
22
import styled from "@emotion/styled";
3-
import dynamic from "next/dynamic";
43
import { lazy, Suspense } from "react";
54

65
import { PageProps } from "../../../pages";
76
import { SecondaryStyledLink, TertiaryStyledLink } from "../Links";
8-
import { StyledWrapperSuspense } from "../NavBar/components";
97

108
const Particles = lazy(async () => await import("../Particles"));
119

12-
const NavBar = dynamic(async () => await import("../NavBar/NavBar"), {
13-
ssr: false,
14-
});
15-
1610
const StyledWrapper = styled.section(({ theme }) => ({
1711
width: "100%",
1812
position: "relative",
@@ -203,9 +197,6 @@ export const Hero = ({ heroData }: { heroData: PageProps["heroData"] }) => {
203197
alt={heroData.background.title}
204198
/>
205199
</Suspense>
206-
<Suspense fallback={<StyledWrapperSuspense />}>
207-
<NavBar />
208-
</Suspense>
209200
<Suspense>
210201
<Particles />
211202
</Suspense>

0 commit comments

Comments
 (0)