Skip to content

Commit

Permalink
refactor: remove icons on discover navs
Browse files Browse the repository at this point in the history
  • Loading branch information
johnshift committed Jul 30, 2024
1 parent b8d89c6 commit 96330a2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 56 deletions.
20 changes: 0 additions & 20 deletions src/shared/components/icons/grant-icon.tsx

This file was deleted.

20 changes: 0 additions & 20 deletions src/shared/components/icons/handbag-icon.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions src/shared/components/nav/bartab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import { cn } from '@/shared/utils/cn';
import { useCloseNav } from './use-close-nav';

interface BartabProps {
icon: React.ReactNode;
icon?: React.ReactNode;
text: string;
href: string;
isMobile?: boolean;
}

export const Bartab = (props: BartabProps) => {
const { icon, text, href, isMobile = false } = props;
const { icon = null, text, href, isMobile = false } = props;

const pathname = usePathname();
const isActive = pathname === href || pathname.startsWith(`${href}/`);
Expand Down
16 changes: 2 additions & 14 deletions src/shared/components/nav/sections.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { A11Y, HREFS, TEST_IDS } from '@/shared/core/constants';
import { Brand } from '@/shared/components/brand';
import { GrantIcon } from '@/shared/components/icons/grant-icon';
import { HandbagIcon } from '@/shared/components/icons/handbag-icon';
import { HomeIcon } from '@/shared/components/icons/home-icon';
import { UsersThreeIcon } from '@/shared/components/icons/users-three-icon';

import { Bartab } from './bartab';
import { CloseButton } from './close-button';
Expand All @@ -13,17 +10,14 @@ const SECTIONS = [
label: 'Discover',
bartabs: [
{
icon: <HandbagIcon />,
text: A11Y.LINK.NAV.ORGS,
href: HREFS.ORGS_PAGE,
},
{
icon: <UsersThreeIcon />,
text: A11Y.LINK.NAV.PROJECTS,
href: HREFS.PROJECTS_PAGE,
},
{
icon: <GrantIcon />,
text: A11Y.LINK.NAV.GRANTS,
href: HREFS.GRANTS_PAGE,
},
Expand Down Expand Up @@ -59,14 +53,8 @@ export const NavSections = ({ isMobile }: Props) => {
{label}
</h2>
<div className="flex flex-col gap-4 px-2 md:gap-3 md:px-0">
{bartabs.map(({ text, icon, href }) => (
<Bartab
key={text}
icon={icon}
text={text}
href={href}
isMobile={isMobile}
/>
{bartabs.map(({ text, href }) => (
<Bartab key={text} text={text} href={href} isMobile={isMobile} />
))}
</div>
</div>
Expand Down

0 comments on commit 96330a2

Please sign in to comment.