Skip to content
Open
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
23 changes: 14 additions & 9 deletions src/components/Layout/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ import Link from 'next/link';
import Logo from '@/components/UI/NavBar/Logo';
import { FooterCategories } from '@/types/FooterCategories';
import ArrowUpComponent from '@/components/UI/Footer/ArrowUpComponent';
import { usePathname } from 'next/navigation';

// #endregion
const Footer: React.FC = () => {
const scrollToTop = () => {
window.scrollTo({ top: 0, behavior: 'smooth' });
};
const pathname = usePathname();

return (
<footer
Expand All @@ -27,19 +29,22 @@ const Footer: React.FC = () => {
>
{FooterCategories.map((category) => {
const isGithub = category.label === 'Github';
const isActive = pathname === `/${category.label.toLowerCase()}`;

return (
<Link
key={category.label}
href={category.href}
className="
relative text-[12px] font-bold leading-[11px] tracking-[0.04em]
text-light-theme-text-menu dark:text-light-theme-text-menu hover:text-light-theme-text
sm:transition-colors sm:duration-200
sm:after:absolute sm:after:left-0 sm:after:right-0 sm:after:h-[2px]
sm:after:bg-light-theme-text sm:after:top-[-44px]
sm:after:scale-x-0 sm:hover:after:scale-x-100 sm:after:origin-top sm:after:transition-transform sm:after:duration-200
dark:hover:text-white sm:dark:after:bg-dark-theme-text
"
className={`
relative text-[12px] font-bold leading-[11px] tracking-[0.04em]
text-light-theme-text-menu dark:text-light-theme-text-menu hover:text-light-theme-text
sm:transition-colors sm:duration-200
sm:after:absolute sm:after:left-0 sm:after:right-0 sm:after:h-[3px]
sm:after:bg-light-theme-text sm:after:top-[-44px]
sm:after:scale-x-0 sm:hover:after:scale-x-100 sm:after:origin-top sm:after:transition-transform sm:after:duration-200
dark:hover:text-white sm:dark:after:bg-dark-theme-text
${isActive && 'sm:after:absolute sm:dark:text-white sm:text-product-add-btn-selected sm:after:left-0 sm:after:right-0 sm:after:h-[3px] sm:after:bg-light-theme-text-hover sm:after:top-[-44px] sm:after:scale-x-100'}
`}
{...(isGithub ? { target: '_blank' } : {})}
>
{category.label.toUpperCase()}
Expand Down