Skip to content

Commit

Permalink
Add new screenshots to hero
Browse files Browse the repository at this point in the history
  • Loading branch information
djfarrelly committed Dec 12, 2024
1 parent bdc1092 commit ef1b23a
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 9 deletions.
12 changes: 3 additions & 9 deletions app/new-homepage/HeroScreenshot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import clsx from "clsx";

import Container from "./Container";
import { Button } from "src/shared/Button";
import Link from "src/components/Link";
import ScreenshotTabs from "./ScreenshotTabs";

export default function HeroScreenshot() {
return (
Expand Down Expand Up @@ -133,14 +133,8 @@ export default function HeroScreenshot() {
))}
</div>
</div>
<div className="flex items-center mt-8 mx-4">
<Image
alt="Screenshot of Inngest's dashboard"
className="rounded-t-md"
src="/assets/homepage/hero/2024-08-function-dashboard.png"
width={3060 * 0.5}
height={1680 * 0.5}
/>
<div className="flex flex-col items-center mt-8 mx-4">
<ScreenshotTabs />
</div>
</Container>
</div>
Expand Down
54 changes: 54 additions & 0 deletions app/new-homepage/ScreenshotTabs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
"use client";
import { useState } from "react";
import Image from "next/image";

export default function ScreenshotTabs() {
const [selected, setSelected] = useState(0);
const screenshots = [
{
// title: "History & traces",
// title: "Build",
title: "Tracing",
src: "/assets/homepage/hero/2024-12-12-runs.png",
alt: "Inngest function runs and traces",
},
{
title: "Observability",
src: "/assets/homepage/hero/2024-12-12-metrics.png",
alt: "Inngest metrics dashboard",
},
{
// title: "Function metrics",
title: "Management",
src: "/assets/homepage/hero/2024-12-12-function-list.png",
alt: "Inngest function dashboard",
},
];
const screenshot = screenshots[selected];

return (
<div className="flex flex-col gap-2 items-center">
<div className="p-1 flex flex-row gap-1 rounded-lg text-sm font-semibold bg-carbon-50/10 backdrop-blur">
{screenshots.map((s, idx) => (
<button
className={
"py-1 px-4 rounded-md transition-all hover:bg-carbon-50/10 data-[state=active]:bg-carbon-50 data-[state=active]:text-carbon-800"
}
data-state={idx === selected ? "active" : "inactive"}
aria-selected={idx === selected}
onClick={() => setSelected(idx)}
>
{s.title}
</button>
))}
</div>
<Image
alt={`Screenshot of ${screenshot.alt}`}
className="rounded-t-md mx-auto"
src={screenshot.src}
width={3026 * 0.35}
height={1850 * 0.35}
/>
</div>
);
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/homepage/hero/2024-12-12-runs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ef1b23a

Please sign in to comment.