quivr/frontend/app/(home)/components/HomeSection/HomeSection.tsx
Matthieu Jacq 7d40a27ad2
feat: Contact form component (#1453)
# Description

Only the form, no validation, no post to the server.

## Screenshots (if appropriate):

### 🖥️ Desktop

<img width="1512" alt="image"
src="https://github.com/StanGirard/quivr/assets/67386567/537fb03e-72fb-4204-bdbf-ab716543b280">

After submitting:
<img width="1512" alt="image"
src="https://github.com/StanGirard/quivr/assets/67386567/72c78e16-4dc0-4ae1-8915-406d70b96ae9">


### 📱 Mobile

<img width="452" alt="image"
src="https://github.com/StanGirard/quivr/assets/67386567/b6077f9b-7cad-4e63-8168-49b32d757620">
2023-10-23 11:29:51 +02:00

51 lines
1.3 KiB
TypeScript

import { cn } from "@/lib/utils";
import styles from "./HomeSection.module.css";
type HomeSectionProps = {
bg: string;
slantCurrent?: "up" | "down" | "none";
slantBefore?: "up" | "down" | "none";
slantAfter?: "up" | "down" | "none";
gradient?: string;
hiddenOnMobile?: boolean;
children: React.ReactNode;
className?: string;
};
export const HomeSection = ({
bg,
slantCurrent = "none",
slantBefore = "none",
slantAfter = "none",
gradient,
hiddenOnMobile = false,
className,
children,
}: HomeSectionProps): JSX.Element => {
const slantBeforeFix = styles[`slant-before-is-${slantBefore}`] ?? "";
const slantAfterFix = styles[`slant-after-is-${slantAfter}`] ?? "";
const flex = hiddenOnMobile
? "hidden md:flex md:justify-center"
: "flex justify-center";
const slant = styles[`section-slanted-${slantCurrent}wards`] ?? "";
return (
<div
className={cn(
`${bg} w-screen ${flex} ${slantBeforeFix} ${slantAfterFix} ${slant} overflow-hidden`,
className
)}
>
<section className="flex flex-col items-center w-full max-w-6xl z-[2] py-8">
{children}
</section>
{gradient !== undefined ? (
<div
className={`absolute w-screen bottom-[calc(100vw*tan(6deg))] left-0 h-[30%] ${gradient}`}
/>
) : null}
</div>
);
};