diff --git a/public/images/tabs/tab-1.png b/public/images/tabs/tab-1.png new file mode 100644 index 00000000..eadb0fe2 Binary files /dev/null and b/public/images/tabs/tab-1.png differ diff --git a/public/images/tabs/tab-2.png b/public/images/tabs/tab-2.png new file mode 100644 index 00000000..1dba6372 Binary files /dev/null and b/public/images/tabs/tab-2.png differ diff --git a/public/images/tabs/tab-3.png b/public/images/tabs/tab-3.png new file mode 100644 index 00000000..f450048c Binary files /dev/null and b/public/images/tabs/tab-3.png differ diff --git a/public/images/tabs/tab-4.png b/public/images/tabs/tab-4.png new file mode 100644 index 00000000..d3ad1bdf Binary files /dev/null and b/public/images/tabs/tab-4.png differ diff --git a/src/components/sections/TestSuites.tsx b/src/components/sections/TestSuites.tsx index 59e2b8b4..c34cb94b 100644 --- a/src/components/sections/TestSuites.tsx +++ b/src/components/sections/TestSuites.tsx @@ -1,11 +1,9 @@ 'use client' -import { useId } from 'react' -import Image, { type ImageProps } from 'next/image' -import { Tab } from '@headlessui/react' +import Image from 'next/image' +import { Tab, Transition } from '@headlessui/react' import clsx from 'clsx' import { LandingPageFragment } from '~/lib/basehub-queries' -import styles from '../../styles/Landingpage.module.css' import { Container } from '~/components/Container' import screenshotDashboard from '~/images/screenshots/dashboard-view.png' @@ -14,14 +12,8 @@ import screenshotRuns from '~/images/screenshots/runs-view.png' import screenshotPRComments from '~/images/screenshots/pr-comments.png' import { getImageSizes } from '~/lib/utils/image' import { Eyebrow, Title } from '../primitives/texts' - -interface Feature { - title: React.ReactNode - subTitle: string | null - description: string | null - image: ImageProps['src'] - icon: React.ComponentType -} +import { Button } from '../Button' +import { useState } from 'react' const images = { dashboard: screenshotDashboard, @@ -29,120 +21,30 @@ const images = { runs: screenshotRuns, pr: screenshotPRComments } -const icons = { - tests: function TestsIcon() { - let id = useId() - return ( - <> - - - - - - - - - - - ) - }, - dashboard: function DashboardIcon() { - let id = useId() - return ( - <> - - - - - ) - }, - runs: function RunsIcon() { - return ( - <> - - - - - ) - }, - pr: function PRIcon() { - return ( - <> - - - - - - ) - } -} -function Feature({ - feature, +function TabHeading({ + children, isActive, className, - ...props -}: React.ComponentPropsWithoutRef<'div'> & { - feature: Feature - isActive: boolean -}) { + ...rest +}: React.ComponentPropsWithoutRef<'div'> & { isActive: boolean }) { return ( -
-
+

-

- -
-
-

- {feature.title} -

-

{feature.subTitle}

-

{feature.description}

+ {children} +

) } @@ -153,32 +55,43 @@ function FeaturesMobile({ features: LandingPageFragment['testSuites']['features']['items'] }) { return ( -
+
{features.map((feature) => ( -
- -
-
+
+ + {feature._title} + -
+

+ {feature.subtitle} +

+

+ {feature.description} +

+
+
+
))}
@@ -190,70 +103,99 @@ function FeaturesDesktop({ }: { features: LandingPageFragment['testSuites']['features']['items'] }) { + const [selectedIndex, setSelectedIndex] = useState(0) return ( - - {({ selectedIndex }) => ( - <> - +
+ {Array.from({ length: 4 }).map((_, index) => ( +
+ ))} + + + {features.map((feature, featureIndex) => ( + + {feature._title} + + ))} + + +
{features.map((feature, featureIndex) => ( - - - {feature._title} - - ) - }} - isActive={featureIndex === selectedIndex} - className="relative" - /> - ))} - - -
- {features.map((feature, featureIndex) => ( - +

+ {feature.subtitle} +

+

+ {feature.description} +

+ -
+
- - ))} -
-
- - - )} - + +
+ +
+ + ))} +
+ + +
) } export function TestSuites({ testSuites }: LandingPageFragment) { return ( -
+
{testSuites.superTitle} diff --git a/src/lib/basehub-queries.ts b/src/lib/basehub-queries.ts index 0e16a3f4..8b4689ac 100644 --- a/src/lib/basehub-queries.ts +++ b/src/lib/basehub-queries.ts @@ -53,7 +53,8 @@ export const landingPageFragment = fragmentOn('LandingPage', { _title: true, subtitle: true, description: true, - image: true + image: true, + link: true } } },