Skip to content

Commit

Permalink
fix: update marketing demo template app for trials so that the contac…
Browse files Browse the repository at this point in the history
…t and about links are disabled
  • Loading branch information
ryunsong-contentful committed Feb 3, 2025
1 parent d55ffb7 commit 48b0241
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import React, { useState } from 'react';
import React from 'react';
import { usePathname } from 'next/navigation';
import Link from 'next/link';
import { Menu } from 'antd';
Expand All @@ -13,26 +13,25 @@ const items = [
},
{
key: '/about',
label: <Link href="/about">About</Link>,
label: 'About',
},
{
key: '/contact',
label: <Link href="/contact">Contact</Link>,
label: 'Contact',
},
];

const FooterNav: React.FC = () => {
const pathname = usePathname();
const [current, setCurrent] = useState(pathname);

return (
<div className={styles.nav}>
<Menu
onClick={(e) => setCurrent(e.key)}
selectedKeys={[current]}
selectedKeys={[pathname]}
mode="horizontal"
className={styles.menu}
items={items}
selectable={false}
/>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import React, { useState } from 'react';
import React from 'react';
import { usePathname } from 'next/navigation';
import Link from 'next/link';
import { Button, Grid, Menu } from 'antd';
Expand All @@ -14,32 +14,31 @@ const items = [
},
{
key: '/about',
label: <Link href="/about">About</Link>,
label: 'About',
},
];

const mobileItems = [
...items,
{
key: '/contact',
label: <Link href="/contact">Contact</Link>,
label: 'Contact',
},
];

const Nav: React.FC = () => {
const pathname = usePathname();
const [current, setCurrent] = useState(pathname);
const screens = Grid.useBreakpoint();

if (screens.xs) {
return (
<div className={styles.nav}>
<Menu
onClick={(e) => setCurrent(e.key)}
selectedKeys={[current]}
selectedKeys={[pathname]}
mode="horizontal"
className={styles.mobileMenu}
items={mobileItems}
selectable={false}
overflowedIndicator={
<Button>
<MenuOutlined />
Expand All @@ -52,16 +51,8 @@ const Nav: React.FC = () => {

return (
<div className={styles.nav}>
<Menu
onClick={(e) => setCurrent(e.key)}
selectedKeys={[current]}
mode="horizontal"
className={styles.menu}
items={items}
/>
<Link href="/contact">
<Button variant="outlined">Contact Us</Button>
</Link>
<Menu selectedKeys={[pathname]} mode="horizontal" className={styles.menu} items={items} />
<Button variant="outlined">Contact Us</Button>
</div>
);
};
Expand Down

0 comments on commit 48b0241

Please sign in to comment.