Skip to content

RF-0: chore: small refactor on menu list #332

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 47 additions & 35 deletions src/components/BurgerMenu/BurgerMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,42 @@ import { Separator } from '../ui/separator';
import { SessionContext } from '@/contexts';
import { usePartners } from '@/hooks';

const MENU_ITEMS = [
{
label: 'Sobre nós',
link: '/sobre-nos',
icon: <Info className="w-5 h-5" />,
},
{
label: 'Cadastrar abrigo',
link: 'https://forms.gle/2S7L2gR529Dc8P3T9',
icon: <CirclePlus className="w-5 h-5" />,
openExternal: true,
},
{
label: 'Canal de Denúncias',
link: 'https://contatoseguro.com.br/sos_rs',
icon: <ShieldAlert className="w-5 h-5" />,
openExternal: true,
},
{
label: 'Como Ajudar',
link: 'https://www.instagram.com/reel/C613CfGuh4b',
icon: <CircleHelp className="w-5 h-5" />,
openExternal: true,
},
{
label: 'Política de Privacidade',
link: '/politica-de-privacidade',
icon: <Info className="w-5 h-5" />,
},
{
label: 'Apoiadores',
link: '/apoiadores',
icon: <HeartHandshake className="w-5 h-5" />,
},
];

const BurgerMenu = () => {
const { session } = useContext(SessionContext);
const { data: partners } = usePartners();
Expand Down Expand Up @@ -47,46 +83,22 @@ const BurgerMenu = () => {
<Separator />
</Fragment>
)}
<BurguerMenuItem
label="Sobre nós"
link="/sobre-nos"
icon={<Info className="w-5 h-5" />}
/>
<BurguerMenuItem
label="Cadastrar abrigo"
link="https://forms.gle/2S7L2gR529Dc8P3T9"
icon={<CirclePlus className="w-5 h-5" />}
openExternal={true}
/>
<BurguerMenuItem
label="Canal de Denúncias"
link="https://contatoseguro.com.br/sos_rs"
icon={<ShieldAlert className="w-5 h-5" />}
openExternal={true}
/>
<BurguerMenuItem
label="Como Ajudar"
link="https://www.instagram.com/reel/C613CfGuh4b"
icon={<CircleHelp className="w-5 h-5" />}
openExternal={true}
/>
<BurguerMenuItem
label="Política de Privacidade"
link="/politica-de-privacidade"
icon={<Info className="w-5 h-5" />}
/>
<BurguerMenuItem
label="Apoiadores"
link="/apoiadores"
icon={<HeartHandshake className="w-5 h-5" />}
/>
{MENU_ITEMS.map((item) => (
<BurguerMenuItem
key={item.label}
label={item.label}
link={item.link}
icon={item.icon}
openExternal={item.openExternal}
/>
))}
<Separator />
{partners.length > 0 && (
<Fragment>
<span>Parcerias</span>
{partners.map((partner, idx) => (
{partners.map((partner) => (
<BurguerMenuItem
key={idx}
key={partner.id}
label={partner.name}
link={partner.link}
icon={<LinkIcon className="w-4 h-4" />}
Expand Down