Remove console.log

Signed-off-by: Chloe <pinkcloudvnn@gmail.com>
This commit is contained in:
Chloe 2022-05-15 19:56:27 +07:00
parent 0e160cc695
commit 0f199bba0e
3 changed files with 33 additions and 6 deletions

View File

@ -67,7 +67,6 @@ export default function getSiteInfoOperation({
const navigationItems =
primaryShopResponse.data.primaryShop.defaultNavigationTree.items ?? []
console.log(normalizeNavigation(navigationItems))
return {
categories,
brands,

View File

@ -108,7 +108,6 @@ const Layout: React.FC<Props> = ({
children,
pageProps: { categories = [], navigation = [], ...pageProps },
}) => {
console.log({ navigation })
const { acceptedCookies, onAcceptCookies } = useAcceptCookies()
const { locale = 'en-US' } = useRouter()
const navBarlinks = categories.slice(0, 2).map((c) => ({

View File

@ -13,6 +13,7 @@ interface SubItemProps {
const SubItem = ({ subItem, level = 0 }: SubItemProps) => {
return (
<>
{subItem.isUrlRelative ? (
<Link href={subItem.url} key={subItem.url}>
<a
className={`block rounded ml-${
@ -22,6 +23,19 @@ const SubItem = ({ subItem, level = 0 }: SubItemProps) => {
{subItem.label}
</a>
</Link>
) : (
<a
href={subItem.url}
className={`block rounded ml-${
level * 2
} py-[10px] px-4 text-sm text-secondary`}
target={subItem.shouldOpenInNewWindow ? '_blank' : ''}
rel="noreferrer"
>
{subItem.label}
</a>
)}
{subItem.items && subItem.items.length > 0
? subItem.items.map((el) => (
<SubItem subItem={el} key={el.url} level={level + 1} />
@ -40,6 +54,7 @@ const CustomNavbar = ({ links = [] }: CustomNavbarProps) => {
<>
{links.map((item) => (
<div className="group inline-block relative" key={item.url}>
{item.isUrlRelative ? (
<Link href={item.url}>
<a
className={cn(
@ -50,6 +65,20 @@ const CustomNavbar = ({ links = [] }: CustomNavbarProps) => {
{item.label}
</a>
</Link>
) : (
<a
href={item.url}
target={item.shouldOpenInNewWindow ? '_blank' : ''}
className={cn(
s.link,
Number(item.items?.length) > 0 && s.customLink
)}
rel="noreferrer"
>
{item.label}
</a>
)}
{item.items && item.items.length > 0 ? (
<div className="relative top-full left-0 hidden min-w-[250px] rounded-sm bg-white p-4 transition-[top] duration-300 group-hover:opacity-100 lg:invisible lg:absolute lg:top-[110%] lg:block lg:opacity-0 lg:shadow-lg lg:group-hover:visible lg:group-hover:top-full">
{item.items.map((subItem) => (