Update logo.tsx

This commit is contained in:
mauro 🤙
2024-08-30 06:22:00 -07:00
committed by GitHub
parent 95c9785d23
commit 2b31899e55

View File

@@ -5,16 +5,9 @@ import Image from "next/image";
import React from "react";
export default function Logo({ withText, ...props }: any) {
const [randomColor, setRandomColor] = React.useState(LOGO_COLORS[Math.floor(Math.random() * LOGO_COLORS.length)]);
React.useEffect(() => {
const interval = setInterval(() => {
setRandomColor(LOGO_COLORS[Math.floor(Math.random() * LOGO_COLORS.length)]);
}, 2000);
return () => clearInterval(interval);
}, []);
return (
<div className="flex items-center m-0" {...props}>
<img src={`https://cdn.jsdelivr.net/gh/zen-browser/www/public/logos/zen-${randomColor}.svg`} width={40} height={40} alt="Zen Logo" className={ny("transition-all duration-300 hover:scale-110", withText && "mr-2")} />
<img src={`https://cdn.jsdelivr.net/gh/zen-browser/www/public/logos/zen-black.svg`} width={40} height={40} alt="Zen Logo" className={ny("transition-all duration-300 hover:scale-110", withText && "mr-2")} />
{withText && <span className="text-2xl font-bold ml-2">zen</span>}
</div>
);