From 20d6ebf24cb31c7e67c97c90c22224cadb3c9699 Mon Sep 17 00:00:00 2001 From: lytrankieio123 Date: Tue, 14 Sep 2021 10:43:38 +0700 Subject: [PATCH] :art: styles: fix header active item in mobile and color when tap to link header :%s --- .../HeaderSubMenuMobile.module.scss | 12 +++++++----- .../HeaderSubMenuMobile/HeaderSubMenuMobile.tsx | 9 +++++++-- src/components/icons/IconNoti.tsx | 11 +++++++++++ src/components/icons/index.ts | 1 + src/utils/constanst.utils.ts | 1 + 5 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 src/components/icons/IconNoti.tsx diff --git a/src/components/common/Header/components/HeaderSubMenuMobile/HeaderSubMenuMobile.module.scss b/src/components/common/Header/components/HeaderSubMenuMobile/HeaderSubMenuMobile.module.scss index 230d9e59e..5acab44b4 100644 --- a/src/components/common/Header/components/HeaderSubMenuMobile/HeaderSubMenuMobile.module.scss +++ b/src/components/common/Header/components/HeaderSubMenuMobile/HeaderSubMenuMobile.module.scss @@ -4,30 +4,32 @@ @apply fixed w-full bg-white; bottom: 0; left: 0; - padding: 2rem 1rem; + padding: 0 1rem 1rem; border-top: 1px solid var(--border-line); box-shadow: -5px 6px 10px rgba(0, 0, 0, 0.2); z-index: 9999; .menu { - @apply grid grid-cols-4; + @apply grid grid-cols-5; li { a { @apply transition-all duration-200 no-underline; - &:hover { - color: var(--primary); - } + -webkit-tap-highlight-color: unset; } .menuItem { @apply flex flex-col justify-center items-center sm-label; + padding-top: 1rem; + border-top: 2px solid transparent; .icon { position: relative; margin-bottom: 0.5rem; + height: 3rem; svg path { fill: currentColor; } } &.active { @apply text-primary; + border-top: 2px solid var(--primary); } &.dot { .icon { diff --git a/src/components/common/Header/components/HeaderSubMenuMobile/HeaderSubMenuMobile.tsx b/src/components/common/Header/components/HeaderSubMenuMobile/HeaderSubMenuMobile.tsx index d2cf1bf3e..ee15ac2cf 100644 --- a/src/components/common/Header/components/HeaderSubMenuMobile/HeaderSubMenuMobile.tsx +++ b/src/components/common/Header/components/HeaderSubMenuMobile/HeaderSubMenuMobile.tsx @@ -2,7 +2,7 @@ import classNames from 'classnames' import Link from 'next/link' import { useRouter } from 'next/router' import { memo } from 'react' -import { IconHeart, IconHome, IconShopping, IconUser } from 'src/components/icons' +import { IconHeart, IconHome, IconNoti, IconShopping, IconUser } from 'src/components/icons' import { ACCOUNT_TAB, QUERY_KEY, ROUTE } from 'src/utils/constanst.utils' import s from './HeaderSubMenuMobile.module.scss' @@ -11,7 +11,6 @@ const OPTION_MENU = [ link: ROUTE.HOME, name: 'Home', icon: , - isMarked: true, }, { link: ROUTE.PRODUCTS, @@ -25,6 +24,12 @@ const OPTION_MENU = [ icon: , isMarked: false, }, + { + link: `${ROUTE.ACCOUNT}?${QUERY_KEY.TAB}=${ACCOUNT_TAB.NOTIFICATION}`, + name: 'Notifications', + icon: , + isMarked: true, + }, { link: ROUTE.ACCOUNT, name: 'Account', diff --git a/src/components/icons/IconNoti.tsx b/src/components/icons/IconNoti.tsx new file mode 100644 index 000000000..ab166fecc --- /dev/null +++ b/src/components/icons/IconNoti.tsx @@ -0,0 +1,11 @@ +import React from 'react' + +const IconNoti = () => { + return ( + + + + ) +} + +export default IconNoti diff --git a/src/components/icons/index.ts b/src/components/icons/index.ts index 7dd36b14f..0a6aab07a 100644 --- a/src/components/icons/index.ts +++ b/src/components/icons/index.ts @@ -33,3 +33,4 @@ export { default as IconMinus } from './IconMinus' export { default as IconCirclePlus } from './IconCirclePlus' export { default as IconDoneCheckout } from './IconDoneCheckout' export { default as IconFilter } from './IconFilter' +export { default as IconNoti } from './IconNoti' \ No newline at end of file diff --git a/src/utils/constanst.utils.ts b/src/utils/constanst.utils.ts index bdb2665db..ad3a5bf81 100644 --- a/src/utils/constanst.utils.ts +++ b/src/utils/constanst.utils.ts @@ -30,6 +30,7 @@ export const ACCOUNT_TAB = { CUSTOMER_INFO: '', ORDER: 'orders', FAVOURITE: 'wishlist', + NOTIFICATION: 'notification', } export const QUERY_KEY = {