diff --git a/src/components/Button.tsx b/src/components/Button.tsx index a7ada50..fd15094 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -4,6 +4,7 @@ import React from 'react'; interface Props extends ButtonProps { isDark?: boolean; + component?: React.ElementType } interface StyledButtonProps { @@ -11,7 +12,6 @@ interface StyledButtonProps { } const StyledButton = styled(MuiButton)(({ isDark, theme }) => ({ - minWidth: 170, height: 64, color: isDark ? theme.palette.primary.main : theme.palette.common.white, paddingBlock: '25px 23px', diff --git a/src/features/Hero.tsx b/src/features/Hero.tsx new file mode 100644 index 0000000..bb5aba5 --- /dev/null +++ b/src/features/Hero.tsx @@ -0,0 +1,110 @@ +import Box from '@mui/material/Box'; +import { styled } from '@mui/material/styles'; +import Typography from '@mui/material/Typography'; +import Image from 'next/image'; +import Link from 'next/link'; +import React from 'react'; + +import desktopHeroBgSm from '@/assets/homepage/hero-bg-desktop.jpg'; +import desktopHeroBgMd from '@/assets/homepage/hero-bg-desktop@2x.jpg'; +import mobileHeroBgSm from '@/assets/homepage/hero-bg-mobile.jpg'; +import mobileHeroBgMd from '@/assets/homepage/hero-bg-mobile@2x.jpg'; +import tabletHeroBgSm from '@/assets/homepage/hero-bg-tablet.jpg'; +import tabletHeroBgMd from '@/assets/homepage/hero-bg-tablet@2x.jpg'; +import Logo from '@/assets/icons/logo.svg'; +import Button from '@/components/Button'; + +const StyledContainer = styled(Box)(({ theme }) => ({ + margin: theme.spacing(3), + marginTop: 232, + marginBottom: 152, + color: theme.palette.common.white, + fill: 'white', + textAlign: 'center', + + [theme.breakpoints.up('tablet')]: { + marginTop: 'clamp(374px, 40%, 600px)', + maxWidth: 689, + marginInline: 'auto', + }, + [theme.breakpoints.up('desktop')]: { + margin: 'revert', + marginTop: 65, + marginLeft: 165, + textAlign: 'revert', + }, +})); + +const StyledButton = styled(Button)(() => ({ + width: 245, +})); + +const StyledImage = styled(Image)(({ theme }) => ({ + pointerEvents: 'none', + position: 'absolute', + width: '100%', + objectFit: 'cover', + objectPosition: 'top', + zIndex: -1, + + [theme.breakpoints.up('desktop')]: { + height: '100%', + objectPosition: 'revert', + }, +})); + +const Hero: React.FC = () => { + return ( + + + + + + + + + + + + + + + + + Exquisite dining since 1989 + + + + Experience our seasonal menu in beautiful country surroundings. Eat the freshest produce from the comfort of + our farmhouse. + + + Book a table + + + ); +}; + +export default Hero; diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 5a31a8d..90d8651 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,5 +1,7 @@ import Head from 'next/head'; +import Hero from '@/features/Hero'; + export default function Home() { return ( <> @@ -9,9 +11,7 @@ export default function Home() { -
- Next + MUI TypeScript Template -
+ ); }