diff --git a/package-lock.json b/package-lock.json index 6bb3303..1e21ca8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "@tanstack/react-query": "^5.81.5", "@tanstack/react-query-devtools": "^5.81.5", "axios": "^1.10.0", + "clsx": "^2.1.1", "dmenu-plus-frontned": "file:", "framer-motion": "^12.20.1", "next": "15.3.4", @@ -2396,6 +2397,15 @@ "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==", "license": "MIT" }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/color": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", diff --git a/package.json b/package.json index 838a224..e286b44 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "@tanstack/react-query": "^5.81.5", "@tanstack/react-query-devtools": "^5.81.5", "axios": "^1.10.0", + "clsx": "^2.1.1", "dmenu-plus-frontned": "file:", "framer-motion": "^12.20.1", "next": "15.3.4", diff --git a/src/app/globals.css b/src/app/globals.css index 76ff273..f129685 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -12,6 +12,7 @@ --color-valid: #439C46; --color-foreground: #333333; --color-disabled: #E7E7E7; + --color-disabled2: #7F7F7F; --color-disabled-text: #8C90A3; --color-menu-header: #C3C7DD; --color-icon-deactive: #A8ABBF; diff --git a/src/components/icons/BagIcon.tsx b/src/components/icons/BagIcon.tsx index 13bbc6a..2e235a5 100644 --- a/src/components/icons/BagIcon.tsx +++ b/src/components/icons/BagIcon.tsx @@ -13,7 +13,7 @@ const BagIcon = (props: Props) => ( > ( /> ( >
@@ -32,10 +36,10 @@ function BottomNavBar({ }: Props) {
- } value="سبد خرید" /> - } value="پیجر" /> - } value="منو" /> - } value="اعلان ها" /> + } value="سبد خرید" /> + } value="پیجر" /> + } value="منو" /> + } value="اعلان ها" /> } value="پسند ها" />
diff --git a/src/components/navigation/BottomNavLink.tsx b/src/components/navigation/BottomNavLink.tsx index b7a08d5..5f97c33 100644 --- a/src/components/navigation/BottomNavLink.tsx +++ b/src/components/navigation/BottomNavLink.tsx @@ -1,17 +1,29 @@ import Link from 'next/link' import React from 'react' import type { LinkProps } from 'next/link' +import { usePathname } from 'next/navigation' +import clsx from 'clsx' type Props = { icon: React.ReactElement value: string } & LinkProps & React.AnchorHTMLAttributes -function BottomNavLink({ icon, value, ...restProps }: Props) { +function BottomNavLink({ icon, value, href, ...restProps }: Props) { + const pathname = usePathname(); + const isActive = pathname === href; + return ( - + {icon} - + {value} diff --git a/src/components/navigation/BottomNavLinkBig.tsx b/src/components/navigation/BottomNavLinkBig.tsx index 80bed7d..de59304 100644 --- a/src/components/navigation/BottomNavLinkBig.tsx +++ b/src/components/navigation/BottomNavLinkBig.tsx @@ -1,19 +1,33 @@ import Link from 'next/link' import React from 'react' import type { LinkProps } from 'next/link' +import { usePathname } from 'next/navigation' +import clsx from 'clsx' type Props = { icon: React.ReactElement value: string } & LinkProps & React.AnchorHTMLAttributes -function BottomNavHighlightLink({ icon, value, ...restProps }: Props) { +function BottomNavHighlightLink({ icon, value, href, ...restProps }: Props) { + const pathname = usePathname(); + const isActive = pathname === href; + return ( - -
+ +
{icon}
- + {value}