Skip to content

Commit

Permalink
Merge pull request #5 from geekhadev/geekha/composite-header
Browse files Browse the repository at this point in the history
geekha/composite-header
  • Loading branch information
joseglego authored Mar 26, 2024
2 parents c32c6e1 + c9c3f8f commit b754ae4
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 39 deletions.
43 changes: 4 additions & 39 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
import {
ChevronDown,
Facebook,
Instagram,
Linkedin,
Star,
Twitter,
} from "lucide-react";
import { ChevronDown, Star } from "lucide-react";

import { Card } from "@/components/Card";
import { Logo } from "@/components/Icons/Logo";
import { Header } from "@/components/Header/Header";
import { Mountain } from "@/components/Icons/Mountain";
import { Title } from "@/components/Icons/Title";
import { Link } from "@/components/Link";
import { Particles } from "@/components/Particles";
import { data, footer, links } from "@/lib/data";
import { data, footer } from "@/lib/data";
import { getMetaData, getViewports } from "@/lib/metadata";
import { theme } from "@/lib/theme";
import { cn } from "@/lib/utils";

export const generateMetadata = getMetaData;
Expand Down Expand Up @@ -44,34 +36,7 @@ export default function Home() {
</div>
</div>
<div className="z-[1]">
<header className="container relative z-10 mx-auto flex h-20 w-full items-center justify-between p-4 text-jsconf-yellow">
<a href="/">
<Logo color={theme?.colors?.jsconfYellow} size="36" />
</a>
<div className="flex items-center gap-6">
{links.map((link) => (
<a
key={link.id}
id={link.id}
className="rounded-full p-2 hover:bg-[#EDE06033]"
target="_blank"
rel="noreferrer"
href={link.url}
>
{link.id == "linkedin" ? (
<Linkedin strokeWidth={1} />
) : null}
{link.id == "instagram" ? (
<Instagram strokeWidth={1} />
) : null}
{link.id == "twitter" ? <Twitter strokeWidth={1} /> : null}
{link.id == "facebook" ? (
<Facebook strokeWidth={1} />
) : null}
</a>
))}
</div>
</header>
<Header />
<div className="mx-auto flex h-[calc(100vh_-_80px)] w-[400px] max-w-[90%] flex-auto flex-col justify-center gap-8 text-left text-white md:w-[746px] lg:shrink-0 lg:basis-1/3">
<h1 className="mx-auto w-[180px] lg:w-[255px]">
<Title />
Expand Down
19 changes: 19 additions & 0 deletions src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { HeaderLink } from "@/components/Header/HeaderLink";
import { Logo } from "@/components/Icons/Logo";
import { links } from "@/lib/data";
import { theme } from "@/lib/theme";

export function Header() {
return (
<header className="container relative z-10 mx-auto flex h-20 w-full items-center justify-between p-4 text-jsconf-yellow">
<a href="/">
<Logo color={theme?.colors?.jsconfYellow} size="36" />
</a>
<div className="flex items-center gap-6">
{links.map((link) => (
<HeaderLink key={link.id} link={link} />
))}
</div>
</header>
);
}
23 changes: 23 additions & 0 deletions src/components/Header/HeaderLink.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Facebook, Instagram, Linkedin, Twitter } from "lucide-react";

export function HeaderLink({
link: { id, url },
}: {
link: { id: string; url: string };
}) {
return (
<a
key={id}
id={id}
href={url}
className="rounded-full p-2 hover:bg-[#EDE06033]"
target="_blank"
rel="noreferrer"
>
{id == "linkedin" ? <Linkedin strokeWidth={1} /> : null}
{id == "instagram" ? <Instagram strokeWidth={1} /> : null}
{id == "twitter" ? <Twitter strokeWidth={1} /> : null}
{id == "facebook" ? <Facebook strokeWidth={1} /> : null}
</a>
);
}

0 comments on commit b754ae4

Please sign in to comment.