Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub star #166

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion components/ui/mobile-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ const MobileMenu: React.FC<MobileMenuProps> = ({ starsCount }) => {
const trigger = useRef<HTMLButtonElement>(null);
const mobileNav = useRef<HTMLDivElement>(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 => {
Expand Down Expand Up @@ -129,7 +135,7 @@ const MobileMenu: React.FC<MobileMenuProps> = ({ starsCount }) => {
<span className="text-base flex gap-1">
<StarIcon className="size-4 text-yellow-300 transition-all duration-300 group-hover:filter group-hover:drop-shadow-[0_0_2px_#FFD700]" />
</span>
{/* <span className="text-base flex gap-1"> <CountingNumbers className="" /></span> */}
<span className="text-base flex gap-1"> {formatStars(starsCount)}</span>
</Link>
</div>
{/*<Link href="/privacy-policy" className="font-medium text-gray-600 hover:text-gray-900 px-5 py-3 flex items-center transition duration-150 ease-in-out">Github</Link>*/}
Expand Down