Skip to content

Commit

Permalink
Merge pull request #31 from inkonchain/feat/new-home
Browse files Browse the repository at this point in the history
feat: revamp PageHeader, create new Home page
  • Loading branch information
fran-ink authored Feb 12, 2025
2 parents fe16251 + 9ddf494 commit 035898f
Show file tree
Hide file tree
Showing 27 changed files with 478 additions and 369 deletions.
1 change: 0 additions & 1 deletion messages/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@
"title": "Join us at the House of Ink in Denver",
"cardTitle": "Ink is coming to ETHDenver!",
"description": "Join us at the House of Ink, a 5-day immersive hacker house experience during ETH Denver, where innovation meets collaboration! Explore the power of Ink, dive into smart contract development, and gain hands-on expertise through interactive workshops and tooling overviews.",
"pillLabel": "Event",
"location": "Denver, CO",
"date": "Feb 22, 2025",
"cta": "RSVP Now!"
Expand Down
42 changes: 23 additions & 19 deletions src/app/[locale]/_components/EventContent/EventContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ export interface SpecificEventCardProps {
link: HrefProp;
date: string;
location: string;
pillLabel: string;
image: string;
imageAlt: string;
className?: string;
Expand All @@ -106,7 +105,6 @@ export const SpecificEventCard = ({
link,
date,
location,
pillLabel,
image,
imageAlt,
layout = "vertical",
Expand All @@ -118,8 +116,7 @@ export const SpecificEventCard = ({
className={className}
image={
<CardContent.Image
mainLabels={<Tag variant="event">{pillLabel}</Tag>}
secondaryLabels={
mainLabels={
<>
<Tag variant="event">
<CalendarIcon size="icon-md" enforce="inherit" />
Expand All @@ -134,7 +131,7 @@ export const SpecificEventCard = ({
>
<ParallaxedHoverImage
className={classNames(
"object-cover scale-[1.3] aspect-video min-w-80 max-w-xl",
"max-w-xl sm:max-w-full",
layout === "horizontal" ? "h-full" : "w-full"
)}
src={image}
Expand All @@ -145,26 +142,33 @@ export const SpecificEventCard = ({
</CardContent.Image>
}
imageLocation={layout === "horizontal" ? "left" : "top"}
variant={color === "purple" ? "light-purple" : "secondary"}
>
<CardContent.CallToAction
variant="default"
title={title}
description={description}
button={
<ButtonLink
href={link}
aria-label="Apply for House of Ink"
target="_blank"
rel="noopener noreferrer"
size="lg"
variant={color === "purple" ? "primary" : "spotlight"}
compact
icon={
<MailIcon className="shrink-0" size="icon-lg" enforce="inherit" />
}
>
{cta}
</ButtonLink>
<div>
<ButtonLink
href={link}
aria-label="Apply for House of Ink"
target="_blank"
rel="noopener noreferrer"
size="lg"
variant={color === "purple" ? "primary" : "spotlight"}
compact
icon={
<MailIcon
className="shrink-0"
size="icon-lg"
enforce="inherit"
/>
}
>
{cta}
</ButtonLink>
</div>
}
/>
</Card>
Expand Down
10 changes: 9 additions & 1 deletion src/app/[locale]/community/_components/CommunityBrandKit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,22 @@ import { useTranslations } from "next-intl";
import { ColoredText } from "@/components/ColoredText";
import { FlyWhenIntoView } from "@/components/FlyWhenIntoView";
import { ParallaxedHoverImage } from "@/components/ParallaxedHoverImage";
import { useFeatureFlag } from "@/hooks/useFeatureFlag";
import { EXTERNAL_LINKS, Link } from "@/routing";
import { classNames } from "@/util/classes";

export const CommunityBrandKit = () => {
const newNav = useFeatureFlag("newNav");
const t = useTranslations("Community");

return (
<FlyWhenIntoView>
<div className="flex flex-col-reverse lg:flex-row items-center justify-between lg:gap-6 mx-4 bg-featuredCardPurple relative rounded-spotlight-mobile overflow-hidden">
<div
className={classNames(
"flex flex-col-reverse lg:flex-row items-center justify-between lg:gap-6 bg-featuredCardPurple relative rounded-spotlight-mobile overflow-hidden",
newNav ? "" : "mx-4"
)}
>
<div className="flex flex-col gap-4 px-14 py-16">
<ColoredText
variant="purple"
Expand Down
1 change: 0 additions & 1 deletion src/app/[locale]/community/_components/CommunityEvents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export const CommunityEvents = () => {
link: EXTERNAL_LINKS.inkdenver,
date: t("ethdenver.date"),
location: t("ethdenver.location"),
pillLabel: t("ethdenver.pillLabel"),
image: "/ethdenver.webp",
imageAlt: "ETHDenver",
layout: "vertical",
Expand Down
3 changes: 2 additions & 1 deletion src/app/[locale]/community/_components/LetsGetSocial.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useTranslations } from "next-intl";

import { BigScalableTitle } from "@/components/BigScallableTitle";
import { FlyWhenIntoView } from "@/components/FlyWhenIntoView";
import { newLayoutSectionClasses } from "@/components/styles/container";
import { useFeatureFlag } from "@/hooks/useFeatureFlag";
import { EXTERNAL_LINKS, Link } from "@/routing";
import { classNames } from "@/util/classes";
Expand All @@ -14,7 +15,7 @@ export const LetsGetSocial = () => {

return (
<FlyWhenIntoView
className={classNames("flex flex-col gap-10 py-16 px-4", {
className={classNames(newLayoutSectionClasses(), {
"items-start": newNav,
"items-center": !newNav,
})}
Expand Down
31 changes: 31 additions & 0 deletions src/app/[locale]/new/_components/Home/HomeApps.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"use client";
import { Button } from "@inkonchain/ink-kit";

import { ColoredText } from "@/components/ColoredText";
import { newLayoutSectionClasses } from "@/components/styles/container";
import { Link } from "@/routing";

import { AppsGrid } from "../../apps/_components/AppsGrid";
import { inkApps } from "../../apps/_components/InkApp";

export const HomeApps = () => {
const apps = inkApps.slice(0, 8);
return (
<div className={newLayoutSectionClasses()}>
<div className="flex justify-between">
<ColoredText className="ink:text-h4" variant="purple">
Discover apps on Ink
</ColoredText>
<Button asChild>
<Link href="/new/apps">View all apps</Link>
</Button>
</div>
<AppsGrid
apps={apps}
featuredApps={[]}
noAppsFound={null}
network="Mainnet"
/>
</div>
);
};
25 changes: 25 additions & 0 deletions src/app/[locale]/new/_components/Home/HomeEvent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"use client";
import { useTranslations } from "next-intl";

import {
SpecificEventCard,
SpecificEventCardProps,
} from "@/app/[locale]/_components/EventContent/EventContent";
import { EXTERNAL_LINKS } from "@/routing";

export const HomeEvent = () => {
const t = useTranslations("events");

const ethDenverEventProps: SpecificEventCardProps = {
title: t("ethdenver.cardTitle"),
description: t("ethdenver.description"),
cta: t("ethdenver.cta"),
link: EXTERNAL_LINKS.inkdenver,
date: t("ethdenver.date"),
location: t("ethdenver.location"),
image: "/ethdenver.webp",
imageAlt: "ETHDenver",
layout: "horizontal",
};
return <SpecificEventCard {...ethDenverEventProps} color="purple" />;
};
36 changes: 36 additions & 0 deletions src/app/[locale]/new/_components/Home/HomeTagLine.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"use client";
import { Button, Card, CardContent, InkIcon } from "@inkonchain/ink-kit";

import { ColoredText } from "@/components/ColoredText";
import { Link } from "@/routing";

export const HomeTagLine = () => {
return (
<Card>
<CardContent.Tagline
title={
<ColoredText variant="purple">
The future isn&apos;t written,
<br />
it&apos;s waiting to be inked.
</ColoredText>
}
buttons={
<>
<Button asChild size="lg" iconLeft={<InkIcon.Bridge />}>
<Link href="/new/bridge">Bridge now</Link>
</Button>
<Button
asChild
variant="secondary"
size="lg"
iconLeft={<InkIcon.Social.X />}
>
<Link href="https://x.com/inkonchain">Follow us</Link>
</Button>
</>
}
></CardContent.Tagline>
</Card>
);
};
23 changes: 23 additions & 0 deletions src/app/[locale]/new/_components/Home/HomeTitle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Button } from "@inkonchain/ink-kit";

import { ColoredText } from "@/components/ColoredText";
import { Link } from "@/routing";

import { PageHeader } from "../PageHeader";

export const HomeTitle = () => {
return (
<PageHeader
title="Ink the future"
description={
<ColoredText variant="purple">Simplified DeFi for builders</ColoredText>
}
cta={
<Button variant="primary" size="lg">
<Link href="/new/apps">Explore Ink</Link>
</Button>
}
size="home"
/>
);
};
1 change: 0 additions & 1 deletion src/app/[locale]/new/_components/InkLogo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export const InkLogo: React.FC = () => {
const query = useRouterQuery();
return (
<Link
className="rounded-full ink:bg-background-light size-12 flex items-center justify-center"
href={{
pathname: routing.pathnames["/new"],
query,
Expand Down
4 changes: 3 additions & 1 deletion src/app/[locale]/new/_components/MainPageBackground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ import { MainBackground } from "@/components/MainBackground/MainBackground";
export const MainPageBackground: React.FC = () => {
const path = usePathname();

return null;

if (path === "/new") {
return <MainBackground type="video" />;
return <MainBackground type="static" />;
}

return null;
Expand Down
55 changes: 55 additions & 0 deletions src/app/[locale]/new/_components/PageHeader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import React from "react";

import { ColoredText } from "@/components/ColoredText";
import { classNames } from "@/util/classes";

interface PageHeaderProps {
title: React.ReactNode;
description: React.ReactNode;
cta?: React.ReactNode;
size?: "default" | "home";
}

export const PageHeader = ({
title,
description,
cta,
size = "default",
}: PageHeaderProps) => {
return (
<div
className={classNames("flex flex-col flex-1", {
"lg:gap-12 gap-6": size === "default",
"lg:gap-16 gap-8": size === "home",
})}
>
<div
className={classNames("flex flex-col items-start gap-4", {
"max-w-screen-lg": size === "default",
"max-w-screen-2xl": size === "home",
})}
>
<ColoredText
className={classNames({
"text-4xl sm:text-6xl": size === "default",
"text-5xl sm:text-6xl md:text-[110px] lg:text-[120px] sm:leading-[95%] xl:text-[130px]":
size === "home",
})}
variant="purple"
dampen="md"
>
<h2>{title}</h2>
</ColoredText>
<div
className={classNames("max-w-screen-lg", {
"ink:text-body-1-regular ink:text-text-muted": size === "default",
"ink:text-h5 ink:xl:text-h3": size === "home",
})}
>
{description}
</div>
</div>
{cta && <div className="flex flex-col items-start w-full">{cta}</div>}
</div>
);
};
Loading

0 comments on commit 035898f

Please sign in to comment.