From feed411d450a2451d599e38c4c3b3757a2be13ad Mon Sep 17 00:00:00 2001 From: GregdTd Date: Fri, 26 Jan 2024 18:11:02 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Improve=20here=20and=20there?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- biome.json | 3 +- src/components/Arrow.tsx | 25 +++++++--- src/components/NavigationBar.tsx | 79 +++++++++++++++++++------------- src/pages/Welcome.tsx | 50 ++++++++++++-------- src/styles/Layout.tsx | 34 ++++++++++---- 5 files changed, 124 insertions(+), 67 deletions(-) diff --git a/biome.json b/biome.json index 7509b0a..ac0086f 100644 --- a/biome.json +++ b/biome.json @@ -11,7 +11,8 @@ "rules": { "recommended": true, "a11y": { - "useValidAriaValues": "off" + "useValidAriaValues": "off", + "useKeyWithClickEvents": "off" }, "style": { "noImplicitBoolean": "error" diff --git a/src/components/Arrow.tsx b/src/components/Arrow.tsx index 5bc408c..1923399 100644 --- a/src/components/Arrow.tsx +++ b/src/components/Arrow.tsx @@ -3,12 +3,25 @@ import styled, { keyframes } from 'styled-components' import { Colors } from '../styles/Colors' import { mobile } from '../styles/media-queries' -export const Arrow = () => ( - scroller.scrollTo('program', { smooth: true, duration: 500 })}> - - - - +export const Arrow = ({ className }: { className?: string }) => ( + + scroller.scrollTo('program', { smooth: true, duration: 500 }) + } + > + + + + ) const bounce = keyframes` diff --git a/src/components/NavigationBar.tsx b/src/components/NavigationBar.tsx index 0a565ba..96eabbe 100644 --- a/src/components/NavigationBar.tsx +++ b/src/components/NavigationBar.tsx @@ -11,39 +11,55 @@ import { Menu } from './Menu' const TITLE = 'Vendredi 14 juin' export const NavigationBar = () => { - const [open, setOpen] = useState(false) - const [current, setCurrent] = useState('') - const showDrawer = () => { - setOpen(!open) - } - const isTabletOrMobile = useMedia(`screen and (max-width: 1024px)`) + const [open, setOpen] = useState(false) + const [current, setCurrent] = useState('') + const showDrawer = () => { + setOpen(!open) + } + const isTabletOrMobile = useMedia('screen and (max-width: 1024px)') - const onTitleClick = () => { - setCurrent('') - animateScroll.scrollToTop({ duration: 500, smooth: true }) - } + const onTitleClick = () => { + setCurrent('') + animateScroll.scrollToTop({ duration: 500, smooth: true }) + } - return ( -
- -
- ) + return ( +
+ +
+ ) } const TITLE_WIDTH = 230 @@ -70,6 +86,7 @@ const Title = styled.div` ` const NavBarMenu = styled.div` + font-weight: bold; width: calc(100% - ${TITLE_WIDTH}px); float: left; ` diff --git a/src/pages/Welcome.tsx b/src/pages/Welcome.tsx index 1e41a68..9497a3e 100644 --- a/src/pages/Welcome.tsx +++ b/src/pages/Welcome.tsx @@ -2,30 +2,35 @@ import styled from 'styled-components' import BaseJulieGregPhoto from '../assets/jugreg.svg?react' -import { Arrow } from '../components/Arrow' +import { Arrow as BaseArrow } from '../components/Arrow' import { SectionWrapper as BaseSectionWrapper } from '../styles/Layout' import { mobile } from '../styles/media-queries' import { Pages } from '../utils/types' export const Welcome: React.FC = () => { - return ( - - - Bienvenue sur le site du mariage de<Surname>Julie et Grégoire</Surname> - - - - Nous sommes très heureux et impatients de tous vous retrouver en juin pour célébrer l’amour et faire la fête. - - En attendant, nous vous avons concocté ce site sur lequel vous retrouverez toutes les infos nécessaires à la préparation de votre séjour breton: programme, - logements, propositions d’activités, plans d’accès et liste de mariage. - - - - - - - ) + return ( + + + Bienvenue sur le site du mariage de<Surname>Julie et Grégoire</Surname> + + + + + Nous sommes très heureux et impatients de tous vous retrouver en + juin pour célébrer l’amour et faire la fête. + + + En attendant, nous vous avons concocté ce site sur lequel vous + retrouverez toutes les infos nécessaires à la préparation de votre + séjour breton: programme, logements, propositions d’activités, plans + d’accès et liste de mariage. + + + + + + + ) } const SectionWrapper = styled(BaseSectionWrapper)` @@ -49,7 +54,7 @@ const JulieGregPhoto = styled(BaseJulieGregPhoto)` height: auto; @media ${mobile} { - width: 100%; + width: 50vw; padding-top: 16px; } ` @@ -88,3 +93,8 @@ const Text = styled.div` hyphens: auto; padding-top: 24px; ` + +const Arrow = styled(BaseArrow)` + position: absolute; + bottom: 0; +` diff --git a/src/styles/Layout.tsx b/src/styles/Layout.tsx index 4df7206..5fb650c 100644 --- a/src/styles/Layout.tsx +++ b/src/styles/Layout.tsx @@ -2,18 +2,33 @@ import styled from 'styled-components' import { Pages, PagesTitles } from '../utils/types' import { Colors } from './Colors' -export const SectionWrapper: React.FC<{ id: Pages; children?: React.ReactNode; className?: string }> = ({ id, children, className }) => { - return ( - -
- {PagesTitles[id] && {PagesTitles[id]}} - {children} -
-
- ) +// export const SectionWrapper: React.FC<{ id: Pages; children?: React.ReactNode; className?: string }> = ({ id, children, className }) => { +// return ( +// +//
+// {PagesTitles[id] && {PagesTitles[id]}} +// {children} +//
+//
+// )} + +export const SectionWrapper: React.FC<{ + id: Pages + children?: React.ReactNode + className?: string +}> = ({ id, children, className }) => { + return ( + +
+ {PagesTitles[id] && {PagesTitles[id]}} + {children} +
+
+ ) } const Wrapper = styled.div` + height: 100vh; padding: 0px 16px; background-color: ${Colors.white}; ` @@ -21,6 +36,7 @@ const Wrapper = styled.div` const Section = styled.section` background-color: ${Colors.green}; width: 100%; + height: 100%; text-align: center; padding-top: 80px; `