From 1561cf6e68059bbd94b508b62b19a805ef68f205 Mon Sep 17 00:00:00 2001 From: Sumitsh28 Date: Sat, 4 Jan 2025 23:56:50 +0530 Subject: [PATCH] Fixed Github star count in mobile view Signed-off-by: Sumitsh28 --- components/ui/mobile-menu.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/components/ui/mobile-menu.tsx b/components/ui/mobile-menu.tsx index af3e1db..40175c7 100644 --- a/components/ui/mobile-menu.tsx +++ b/components/ui/mobile-menu.tsx @@ -23,6 +23,12 @@ const MobileMenu: React.FC = ({ starsCount }) => { const trigger = useRef(null); const mobileNav = useRef(null); + const formatStars = (num: number) => + Intl.NumberFormat('en-US', { + notation: "compact", + maximumFractionDigits: 1, + }).format(num); + // close the mobile menu on click outside useEffect(() => { const clickHandler = ({ target }: { target: EventTarget | null }): void => { @@ -129,7 +135,7 @@ const MobileMenu: React.FC = ({ starsCount }) => { - {/* */} + {formatStars(starsCount)} {/*Github*/}