mirror of
https://github.com/vercel/commerce.git
synced 2025-05-17 15:06:59 +00:00
Remove console.log
Signed-off-by: Chloe <pinkcloudvnn@gmail.com>
This commit is contained in:
parent
0e160cc695
commit
0f199bba0e
@ -67,7 +67,6 @@ export default function getSiteInfoOperation({
|
|||||||
const navigationItems =
|
const navigationItems =
|
||||||
primaryShopResponse.data.primaryShop.defaultNavigationTree.items ?? []
|
primaryShopResponse.data.primaryShop.defaultNavigationTree.items ?? []
|
||||||
|
|
||||||
console.log(normalizeNavigation(navigationItems))
|
|
||||||
return {
|
return {
|
||||||
categories,
|
categories,
|
||||||
brands,
|
brands,
|
||||||
|
@ -108,7 +108,6 @@ const Layout: React.FC<Props> = ({
|
|||||||
children,
|
children,
|
||||||
pageProps: { categories = [], navigation = [], ...pageProps },
|
pageProps: { categories = [], navigation = [], ...pageProps },
|
||||||
}) => {
|
}) => {
|
||||||
console.log({ navigation })
|
|
||||||
const { acceptedCookies, onAcceptCookies } = useAcceptCookies()
|
const { acceptedCookies, onAcceptCookies } = useAcceptCookies()
|
||||||
const { locale = 'en-US' } = useRouter()
|
const { locale = 'en-US' } = useRouter()
|
||||||
const navBarlinks = categories.slice(0, 2).map((c) => ({
|
const navBarlinks = categories.slice(0, 2).map((c) => ({
|
||||||
|
@ -13,15 +13,29 @@ interface SubItemProps {
|
|||||||
const SubItem = ({ subItem, level = 0 }: SubItemProps) => {
|
const SubItem = ({ subItem, level = 0 }: SubItemProps) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Link href={subItem.url} key={subItem.url}>
|
{subItem.isUrlRelative ? (
|
||||||
|
<Link href={subItem.url} key={subItem.url}>
|
||||||
|
<a
|
||||||
|
className={`block rounded ml-${
|
||||||
|
level * 2
|
||||||
|
} py-[10px] px-4 text-sm text-secondary`}
|
||||||
|
>
|
||||||
|
{subItem.label}
|
||||||
|
</a>
|
||||||
|
</Link>
|
||||||
|
) : (
|
||||||
<a
|
<a
|
||||||
|
href={subItem.url}
|
||||||
className={`block rounded ml-${
|
className={`block rounded ml-${
|
||||||
level * 2
|
level * 2
|
||||||
} py-[10px] px-4 text-sm text-secondary`}
|
} py-[10px] px-4 text-sm text-secondary`}
|
||||||
|
target={subItem.shouldOpenInNewWindow ? '_blank' : ''}
|
||||||
|
rel="noreferrer"
|
||||||
>
|
>
|
||||||
{subItem.label}
|
{subItem.label}
|
||||||
</a>
|
</a>
|
||||||
</Link>
|
)}
|
||||||
|
|
||||||
{subItem.items && subItem.items.length > 0
|
{subItem.items && subItem.items.length > 0
|
||||||
? subItem.items.map((el) => (
|
? subItem.items.map((el) => (
|
||||||
<SubItem subItem={el} key={el.url} level={level + 1} />
|
<SubItem subItem={el} key={el.url} level={level + 1} />
|
||||||
@ -40,16 +54,31 @@ const CustomNavbar = ({ links = [] }: CustomNavbarProps) => {
|
|||||||
<>
|
<>
|
||||||
{links.map((item) => (
|
{links.map((item) => (
|
||||||
<div className="group inline-block relative" key={item.url}>
|
<div className="group inline-block relative" key={item.url}>
|
||||||
<Link href={item.url}>
|
{item.isUrlRelative ? (
|
||||||
|
<Link href={item.url}>
|
||||||
|
<a
|
||||||
|
className={cn(
|
||||||
|
s.link,
|
||||||
|
Number(item.items?.length) > 0 && s.customLink
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{item.label}
|
||||||
|
</a>
|
||||||
|
</Link>
|
||||||
|
) : (
|
||||||
<a
|
<a
|
||||||
|
href={item.url}
|
||||||
|
target={item.shouldOpenInNewWindow ? '_blank' : ''}
|
||||||
className={cn(
|
className={cn(
|
||||||
s.link,
|
s.link,
|
||||||
Number(item.items?.length) > 0 && s.customLink
|
Number(item.items?.length) > 0 && s.customLink
|
||||||
)}
|
)}
|
||||||
|
rel="noreferrer"
|
||||||
>
|
>
|
||||||
{item.label}
|
{item.label}
|
||||||
</a>
|
</a>
|
||||||
</Link>
|
)}
|
||||||
|
|
||||||
{item.items && item.items.length > 0 ? (
|
{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">
|
<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) => (
|
{item.items.map((subItem) => (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user