Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasdavis committed Dec 19, 2024
1 parent 3f2ff14 commit deb5334
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 15 deletions.
40 changes: 27 additions & 13 deletions apps/registry/app/components/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,24 @@ export default function Menu({ session }) {
{ href: '/explore', label: 'Explore' },
{ href: '/jobs', label: 'Jobs' },
{ href: '/job-similarity', label: 'Similarity' },
{ href: 'https://github.com/jsonresume/jsonresume.org', label: 'Github', external: true },
{
href: 'https://github.com/jsonresume/jsonresume.org',
label: 'Github',
external: true,
},
{ href: 'https://discord.gg/GTZtn8pTXC', label: 'Discord', external: true },
];

const authItems = [
...(username ? [
{ href: `/${username}/dashboard`, label: 'Profile' },
{ href: '/editor', label: 'Editor' },
] : []),
session ? { onClick: signOut, label: 'Logout' } : { href: '/', label: 'Sign in' },
...(username
? [
{ href: `/${username}/dashboard`, label: 'Profile' },
{ href: '/editor', label: 'Editor' },
]
: []),
session
? { onClick: signOut, label: 'Logout' }
: { href: '/', label: 'Sign in' },
];

return (
Expand All @@ -56,9 +64,13 @@ export default function Menu({ session }) {
</div>
}
right={
<div className={`${isOpen ? 'block' : 'hidden'} lg:flex lg:items-center lg:flex-1`}>
<div
className={`${
isOpen ? 'block' : 'hidden'
} lg:flex lg:items-center lg:flex-1`}
>
<nav className="flex flex-col lg:flex-row lg:items-center lg:justify-end gap-4 p-4 lg:p-5">
{menuItems.map((item) => (
{menuItems.map((item) =>
item.external ? (
<a
key={item.href}
Expand All @@ -72,16 +84,17 @@ export default function Menu({ session }) {
key={item.href}
href={item.href}
className={`text-lg lg:text-xl font-bold ${
isActive(item.href) || (item.href === '/jobs' && pathname.startsWith('/jobs/'))
isActive(item.href) ||
(item.href === '/jobs' && pathname.startsWith('/jobs/'))
? 'text-secondary-900 underline'
: 'text-black'
} hover:text-secondary-900 transition-colors duration-200 py-2 lg:py-0`}
>
{item.label}
</Link>
)
))}
{authItems.map((item) => (
)}
{authItems.map((item) =>
item.onClick ? (
<button
key={item.label}
Expand All @@ -95,7 +108,8 @@ export default function Menu({ session }) {
key={item.href}
href={item.href}
className={`text-lg lg:text-xl font-bold hover:text-secondary-900 transition-colors duration-200 py-2 lg:py-0 ${
(item.href === `/${username}/dashboard` && isProfileActive) ||
(item.href === `/${username}/dashboard` &&
isProfileActive) ||
isActive(item.href)
? 'text-secondary-900 underline'
: 'text-black'
Expand All @@ -104,7 +118,7 @@ export default function Menu({ session }) {
{item.label}
</Link>
)
))}
)}
</nav>
</div>
}
Expand Down
4 changes: 2 additions & 2 deletions apps/registry/app/job-similarity/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ const GraphContainer = ({ dataSource, algorithm }) => {
const checkMobile = () => {
setIsMobile(window.innerWidth < 768);
};

checkMobile();
window.addEventListener('resize', checkMobile);
return () => window.removeEventListener('resize', checkMobile);
Expand All @@ -620,7 +620,7 @@ const GraphContainer = ({ dataSource, algorithm }) => {
const handleNodeClick = useCallback(
(node) => {
if (!node) return;

if (isMobile) {
// On mobile, just show the tooltip
setHoverNode(node);
Expand Down

0 comments on commit deb5334

Please sign in to comment.