Skip to content

Commit

Permalink
migrate from mantine to tailwind on the home page
Browse files Browse the repository at this point in the history
  • Loading branch information
IhsenBouallegue committed Oct 31, 2023
1 parent 9ba7159 commit 2817f05
Show file tree
Hide file tree
Showing 22 changed files with 417 additions and 506 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@mantine/notifications": "7.1.7",
"@paralleldrive/cuid2": "2.2.2",
"@planetscale/database": "^1.11.0",
"@radix-ui/react-accordion": "^1.1.2",
"@radix-ui/react-avatar": "^1.0.4",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-dropdown-menu": "^2.0.6",
Expand Down
2 changes: 2 additions & 0 deletions src/app/(home)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import FooterBar from "@/components/home/footer-bar";
import HeaderBar from "@/components/home/header";
import Faq from "@/sections/home/faq";
import { Features } from "@/sections/home/features/features";
import Hero from "@/sections/home/hero";
import Mission from "@/sections/home/mission";
import Pricing from "@/sections/home/pricing";
Expand All @@ -10,6 +11,7 @@ export default function page() {
<>
<HeaderBar />
<Hero />
<Features />
<Mission />
<Pricing />
<Faq />
Expand Down
3 changes: 1 addition & 2 deletions src/components/dashboard/user-nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ export async function UserNav() {
</DropdownMenuLabel>
<DropdownMenuSeparator />
<DropdownMenuGroup>
<DropdownMenuItem>Settings</DropdownMenuItem>
<DropdownMenuItem>New Organization</DropdownMenuItem>
<DropdownMenuItem disabled>Settings (coming soon)</DropdownMenuItem>
</DropdownMenuGroup>
<DropdownMenuSeparator />
<form
Expand Down
27 changes: 0 additions & 27 deletions src/components/home/footer-bar/footer-bar.module.css

This file was deleted.

14 changes: 6 additions & 8 deletions src/components/home/footer-bar/footer-bar.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
import { Group, Image, Paper } from "@mantine/core";
import { Image } from "@mantine/core";
import { FooterLinks } from "./footer-links";

import classes from "./footer-bar.module.css";

export function FooterBar() {
return (
<Paper radius="lg" className={classes.container}>
<div className="mt-[120px] flex border-t-2 flex-col border-slate-200 relative place-items-center px-6 py-8 sm:flex-row">
<Image
src="/logo/hubone_logo_full.svg"
fit="contain"
h={36}
w={150}
className={classes.logo}
className="static sm:absolute"
/>
<Group className={classes.footerLinks}>
<div className="my-0 mx-auto relative sm:static">
<FooterLinks />
</Group>
</Paper>
</div>
</div>
);
}
Empty file.
16 changes: 6 additions & 10 deletions src/components/home/footer-bar/footer-links.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
"use client";

import { Anchor, Group } from "@mantine/core";
import Link from "next/link";

export function FooterLinks() {
return (
<Group>
<div className="flex gap-4">
{footerLinks?.map(({ title, link }) => (
<Anchor<"a">
c="dimmed"
<Link
className="text-muted leading-loose text-sm"
key={`footer_link_${title}`}
href={link}
style={{ lineHeight: 1 }}
size="sm"
>
{title}
</Anchor>
</Link>
))}
</Group>
</div>
);
}

Expand Down
5 changes: 2 additions & 3 deletions src/components/home/header/header-actions.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { cn } from "@/lib/utils";
import { buttonVariants } from "@/ui/button";
import { Group } from "@mantine/core";
import { useSession } from "next-auth/react";
import Link from "next/link";

export function HeaderActions() {
const session = useSession();

return (
<Group>
<>
{session?.data ? (
<Link
href="/dashboard"
Expand All @@ -24,6 +23,6 @@ export function HeaderActions() {
Sign In
</Link>
)}
</Group>
</>
);
}
5 changes: 0 additions & 5 deletions src/components/home/heading/heading.module.css

This file was deleted.

15 changes: 4 additions & 11 deletions src/components/home/heading/heading.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import { Stack, Text, Title } from "@mantine/core";

import classes from "./heading.module.css";

export function Heading({
title,
description,
Expand All @@ -10,12 +6,9 @@ export function Heading({
description: string;
}) {
return (
<Stack align="center" mb="6em" gap="xl">
<Title className={classes.heading} size="4em" ta="center" mt="sm">
{title}
</Title>
<Text>{description}</Text>
{/* <Description>{description}</Description> */}
</Stack>
<div className="place-items-center flex flex-col gap-6 mb-20">
<h2 className="text-xl sm:text-6xl font-bold">{title}</h2>
<p>{description}</p>
</div>
);
}
16 changes: 4 additions & 12 deletions src/components/home/section/section.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
import { Container } from "@mantine/core";

export function Section({
id,
children,
}: {
id: string;
children: React.ReactNode[];
children: React.ReactNode[] | React.ReactNode;
}) {
return (
<Container
<div
id={id}
size="lg"
mt="16em"
style={{
display: "flex",
flexDirection: "column",
alignItems: "center",
}}
className="max-w-7xl mx-auto mt-48 px-4 sm:px-6 lg:px-8 flex flex-col place-items-center"
>
{children}
</Container>
</div>
);
}
55 changes: 15 additions & 40 deletions src/sections/home/faq/faq.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,27 @@

import Heading from "@/components/home/heading";
import Section from "@/components/home/section";
import { Accordion, Container } from "@mantine/core";
import classes from "./faq.module.css";

const placeholder =
"It can’t help but hear a pin drop from over half a mile away, so it lives deep in the mountains where there aren’t many people or Pokémon.It was born from sludge on the ocean floor. In a sterile environment, the germs within its body can’t multiply, and it dies.It has no eyeballs, so it can’t see. It checks its surroundings via the ultrasonic waves it emits from its mouth.";
import {
Accordion,
AccordionContent,
AccordionItem,
AccordionTrigger,
} from "@/ui/accordion";

export function Faq() {
return (
<Section id="faq">
<Heading title="Frequently Asked Questions" description="" />
<Container className={classes.wrapper}>
<Accordion variant="separated">
<Accordion.Item className={classes.item} value="reset-password">
<Accordion.Control>How can I reset my password?</Accordion.Control>
<Accordion.Panel>{placeholder}</Accordion.Panel>
</Accordion.Item>

<Accordion.Item className={classes.item} value="another-account">
<Accordion.Control>
Can I create more that one account?
</Accordion.Control>
<Accordion.Panel>{placeholder}</Accordion.Panel>
</Accordion.Item>

<Accordion.Item className={classes.item} value="newsletter">
<Accordion.Control>
How can I subscribe to monthly newsletter?
</Accordion.Control>
<Accordion.Panel>{placeholder}</Accordion.Panel>
</Accordion.Item>

<Accordion.Item className={classes.item} value="credit-card">
<Accordion.Control>
Do you store credit card information securely?
</Accordion.Control>
<Accordion.Panel>{placeholder}</Accordion.Panel>
</Accordion.Item>

<Accordion.Item className={classes.item} value="payment">
<Accordion.Control>
What payment systems to you work with?
</Accordion.Control>
<Accordion.Panel>{placeholder}</Accordion.Panel>
</Accordion.Item>
<div className="w-9/12 p-8">
<Accordion type="single" className="w-[100%] max-w-4xl" collapsible>
<AccordionItem value="item-1">
<AccordionTrigger>Is it accessible?</AccordionTrigger>
<AccordionContent>
Yes. It adheres to the WAI-ARIA design pattern.
</AccordionContent>
</AccordionItem>
</Accordion>
</Container>
</div>
</Section>
);
}
64 changes: 22 additions & 42 deletions src/sections/home/features/feature-card.tsx
Original file line number Diff line number Diff line change
@@ -1,43 +1,23 @@
// import { Card, Text, useMantineTheme } from "@mantine/core";
// import { Icon as IconType } from "@tabler/icons-react";
import { cn } from "@/lib/utils";

// export function FeatureCard({
// title,
// description,
// Icon,
// }: {
// title: string;
// description: string;
// Icon: IconType;
// }) {
// const theme = useMantineTheme();
// return (
// <Card
// shadow="lg"
// radius="lg"
// style={{ border: `1px solid ${theme.colors.gray[1]}` }}
// p="xl"
// >
// <Icon size={50} stroke={2} color={theme.colors.primary[4]} />
// <Text
// size="lg"
// sx={{
// "&::after": {
// content: '""',
// display: "block",
// backgroundColor: theme.colors.primary[4],
// width: 45,
// height: 2,
// marginTop: theme.spacing.sm,
// },
// }}
// mt="md"
// >
// {title}
// </Text>
// <Text size="sm" c="dimmed" mt="sm">
// {description}
// </Text>
// </Card>
// );
// }
export default function FeatureCard({ invert = false }: { invert?: boolean }) {
return (
<div
className={cn(
"h-96 flex w-full px-20 gap-6 bg-secondary rounded-xl place-items-center",
invert && "flex-row-reverse bg-transparent"
)}
>
<div className="w-3/5 space-y-4 ">
<h3 className="text-xl sm:text-4xl font-bold">Title</h3>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem
nesciunt beatae, perspiciatis, distinctio vel itaque illum ut
excepturi eius a ad repellendus! Laboriosam quod aliquid atque
provident ullam inventore vitae.
</p>
</div>
<div className=" w-2/5">Diagram</div>
</div>
);
}
47 changes: 21 additions & 26 deletions src/sections/home/features/features.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
// import Section from "@/components/home/section";
// import Heading from "@/components/home/heading";
// import { SimpleGrid } from "@mantine/core";
// import { FeatureCard } from "./feature-card";
import Heading from "@/components/home/heading";
import Section from "@/components/home/section";
import FeatureCard from "./feature-card";
// import { featuresData } from "./featuresData";

// export function Features() {
// const features = featuresData.map((feature) => (
// <FeatureCard key={feature.title} {...feature} Icon={feature.icon} />
// ));
export function Features() {
// const features = featuresData.map((feature) => (
// <FeatureCard key={feature.title} {...feature} Icon={feature.icon} />
// ));

// return (
// <Section id="features">
// <Heading
// title="What is Important to Us?"
// description="HubOne focuses on making your life easier. This is why we made sure to
// follow these principles."
// />

// <SimpleGrid
// cols={3}
// spacing={48}
// breakpoints={[{ maxWidth: "md", cols: 1 }]}
// >
// {features}
// </SimpleGrid>
// </Section>
// );
// }
return (
<Section id="features">
<Heading
title="What is HubOne?"
description="HubOne focuses on making your work easier. Here is how."
/>
<div className="space-y-8 py-12">
<FeatureCard />
<FeatureCard invert />
<FeatureCard />
</div>
</Section>
);
}
Loading

1 comment on commit 2817f05

@vercel
Copy link

@vercel vercel bot commented on 2817f05 Oct 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.