From 4346a0742f4e4edca35ae2b96fa5c635394d3f7f Mon Sep 17 00:00:00 2001 From: Rishabh Shah Date: Tue, 18 Jul 2023 11:30:44 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=99=20Added=20left=20chevron=20on=20la?= =?UTF-8?q?nding=20page=20(#1089)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fixed banner badge on landing :sparkles * added left button to landing carousel :rewind --- next/src/components/BannerBadge.tsx | 2 +- next/src/components/landing/Hero.tsx | 66 ++++++++++++++++++---------- 2 files changed, 45 insertions(+), 23 deletions(-) diff --git a/next/src/components/BannerBadge.tsx b/next/src/components/BannerBadge.tsx index 0d8a7b5340..c98d3875d9 100644 --- a/next/src/components/BannerBadge.tsx +++ b/next/src/components/BannerBadge.tsx @@ -7,7 +7,7 @@ import clsx from "clsx"; type BadgeProps = PropsWithChildren>; const BannerBadge = ({ children, className, ...props }: BadgeProps) => ( -
+
= ({ className }) => { const [sliderIndex, setSliderIndex] = useState(0); const totalCards = roles.length; - const handleSliderButton = (increment: number) => { - const newIndex = (sliderIndex + increment + totalCards) % totalCards; - setSliderIndex(newIndex); + const handleSliderButtonLeft = (decrement: number) => { + if (sliderIndex != 0) { + const newIndex = (sliderIndex - decrement + totalCards) % totalCards; + setSliderIndex(newIndex); + } + }; + + const handleSliderButtonRight = (increment: number) => { + if (sliderIndex != roles.length - 2) { + const newIndex = (sliderIndex + increment + totalCards) % totalCards; + setSliderIndex(newIndex); + } }; return ( @@ -70,30 +79,42 @@ const Hero: React.FC<{ className?: string }> = ({ className }) => { Experience a new way of working.

-
- + +
+ + {roles.map((role, index) => ( + { + router.push("/").catch(console.error); + }} + /> + ))} + +