Skip to content

Commit 0d9053f

Browse files
fagundesjghelenapaixaoluccas-spechtMatheusDubindanmqs
authored
Release/0.0.3 (#187)
* [fix] Config readme * wip: loading * Delete yarn.lock * refact: created shelter list view component in home page * Fix: mobile UI has broken for mobile devices (#22) *Fix: mobile UI has broken for mobile devices * fix: remove chip as fixed as no wrap property * chore: add shelter card clickable * chore: remove Fragment component * build: add set sm as max mobile dimension sm: 425px * style: add responsive layout * refactor: filter page * fix: priority * fix: filter parameters * fix: fixed volunteer supply that had been fulfilled displaying on shelter page * fix: improve readability * feat: hidden filter button if filter is empty * feat: cache in axios request * fix: cache search params * feat: cache clean on searchs * wip: donation tags * fix: clean search params * Update README.md [fix] Retirando a seção Funcionalidades e Backlog * fix: donation tags / componentized the urgent supplies section * fix: removed empty shelter tags empty row * feat: full edit shelter and improved interface of pet friendly in shelter page * refact: add live link and tech stack to readme * Fix/develop bugs (#90) * fix: cache bug (invalite cache on create/update operation) * feat: added update many shelter supplies and admin rule * Add license (#81) Closes #65. * fix: app port (#80) * docs: added shadcn/ui reference * fix for volunteer shelter title (#95) * treat contact link as a proper link * simplified href * docs: add discord link on readme * Normalizes search string in supply filter so it ignores accents (#125) * normalized search string to ignore accents * revert removed button * add a copy to clipboard button to PIX and contact info (#124) * add a copy to clipboard button to PIX and contact info * use && operator instead of ternary * Substitui onClick e useNavigate por <Link> para melhorar acessibilidade (#128) * replaced navigate in favour of html link and added card hover * fixed lint warnings * fix: change shelter title style (#106) Prevents badge misalignment on very large titles * Add new feature and creating LoadingSkeleton (#115) * Add new feature and creating LoadingSkeleton * fix/add: add favicon and canonical metatag (#136) * fix/add: add favicon and canonical metatag * fix: fixed the path * refactor: changed order of shelters to updated at instead priority sum (#137) * Remove zod dependency (#143) * replaced zod validation with yup * removed zod dependency from package.json * sort dependencies * fixed validation schema variable name * removed .shape() and added .strict() * deleted unused file * Added burger menu to home page (#149) * Implemented Burger menu * commented unused components * feat: Update BurgerMenu to display user's name when logged in * removed comments * implemented login and logout button * Feat/partners (#155) * fix: menu bar with api partners * fix: menu bar with api partners * fix: remove unused session in burguer menu / removed import all icons from lucide and use link icon instead custom icons * [BUG] Botão de Limpar Filtro sumindo após remover input de busca (#147) * fix: clean filter button disappearing after removing search input manually * fix: removing log * Modificação nas telas de abrigos para adicionar cidades (#110) * feat: filter shlters by cities * feat: city on shelter forms, info and list * feat: shelter city quantities on filter * fix: wrong conditional * fix: bug that removing city filter on home doesnt affect the filter * feat: new address fields on shelter forms * feat: useDebouncedValue, useViaCep * feat: adapt useFetch for conditional paths and different response * feat: address fields required and zipCode triggering viaCep * feat: address fields required on update shelter * feat: address fields on shelter details when theres no address field * fix: suggestions(shorthand, optional chaining, separated zipCode, formatted city on list) * feat: sticky footer on filter dialog * fix: reset errors on zipcode search; copy filter change * fix: timeoutId not assigned value; InfoRow copy can copy undefined * Campo de quantidade adicionado quando adicionar suprimento a um abrigo (#46) * feat(shelter-supply): input to add quantity supply * feat(shelter-supply): show quantity supply at Shelter page and EditShelter page * resolve conflict --------- Co-authored-by: Lipe <[email protected]> * feat: google analytics * feat: edit shelter supply item quantity (#170) * fix: send address field formatted (#171) * feat: add a template to log bugs/defects (#168) * feat: add a template to log bugs/defects * Feat/privacy terms about us (#169) * feat: privacy policy page * feat: done about us page * fix: removed redundant value check in info row component * fix: ordering the list of items on the shelter edit page (#166) * feat: Melhoria no esquema de cores dos chip's e ajuste de acessibilidade (#162) * feat: new text colors with adjusted light var colors * feat: change chip element tag to span and improve a11y * feat: added update date information to shelter page (#159) * Adding update date to shelter page * (Aditional) Informing when no update date for shelter in main page * feat: ajuste de textos de voluntários e doações (#129) * hotfix: shelter list item broken div tag * Feat/back navigation to home (#177) * feat: added back navigation to home when click in header label * Hotfix/merge bugs (#183) * fix: shelter list item duplicate code after merge * fix: order in filter select menu, filter supplies by category and useSupplies interface * fix: update shelter validation schema and created useAuthRoles hook to reduce complexity of code * fix: conflicts with master branch --------- Co-authored-by: helenapaixao <[email protected]> Co-authored-by: Luccas Specht <[email protected]> Co-authored-by: MatheusDubin <[email protected]> Co-authored-by: danmqs <[email protected]> Co-authored-by: Giovanni Bassi <[email protected]> Co-authored-by: Felipe Monteiro <[email protected]> Co-authored-by: André Ferraz <[email protected]> Co-authored-by: Sombrio <[email protected]> Co-authored-by: Filipe Pacheco de Fraga <[email protected]> Co-authored-by: Daniel Marques <[email protected]> Co-authored-by: Matheus Dubin Da Silveira <[email protected]> Co-authored-by: Miguel Dalberto <[email protected]> Co-authored-by: Pablo A. Maximo <[email protected]> Co-authored-by: Marcos Nascimento <[email protected]> Co-authored-by: Gilmar José <[email protected]> Co-authored-by: Kelvin <[email protected]> Co-authored-by: Jhonatan David <[email protected]> Co-authored-by: Alexander Scheibler <[email protected]> Co-authored-by: Giovani Andrino Carnaval <[email protected]> Co-authored-by: Thiago Oliveira <[email protected]> Co-authored-by: Henrique Uhlmann Gobbi <[email protected]> Co-authored-by: Janderson Soares <[email protected]>
1 parent fbcb711 commit 0d9053f

File tree

86 files changed

+2205
-216
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+2205
-216
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: Bug report
3+
about: Um modelo exemplo para você relatar algum defeito que tenha encontrado no site.
4+
title: "[BUG] Título do problema"
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
# Descrição
10+
Aqui você escreve sobre o que é o defeito.
11+
12+
# Problema encontrado
13+
Aqui você dá detalhes sobre o problema, incluíndo os passos para reproduzir, se necessário.
14+
15+
# Prioridade
16+
Registre apenas a prioridade ou seriedade do defeito. Um guia:
17+
- Crítico: site fora do ar, erros fatas que impedem utilização por completo, página em branco
18+
- Grave: site online, mas com defeito sério que impedem o uso de forma considerável
19+
- Média: defeito não tão sério, mas que dificulta o uso da aplicação de modo geral
20+
- Baixa: coisas poucas, sistema pode ser usado. Problemas de grafia são incluídos aqui
21+
22+
# Solução proposta
23+
Como deveria ser o comportamento sem o defeito?
24+
25+
# Ambiente
26+
Aqui você escreve o tipo de dispositivo (Modelo do celular ou sistema operacional do computador) e o navegador que utilizou para o teste.
27+
28+
# Evidência
29+
Adicione o que for possível, como captura de tela ou vídeo evidenciando o problema.

package-lock.json

Lines changed: 1 addition & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,30 +28,29 @@
2828
"formik": "^2.4.6",
2929
"lucide-react": "^0.378.0",
3030
"qs": "^6.12.1",
31-
"react": "^18.2.0",
3231
"react-dom": "^18.2.0",
3332
"react-hook-form": "^7.51.4",
3433
"react-input-mask": "^2.0.4",
3534
"react-router-dom": "^6.23.0",
3635
"react-select": "^5.8.0",
36+
"react": "^18.2.0",
3737
"tailwind-merge": "^2.3.0",
3838
"tailwindcss-animate": "^1.0.7",
39-
"yup": "^1.4.0",
40-
"zod": "^3.23.6"
39+
"yup": "^1.4.0"
4140
},
4241
"devDependencies": {
4342
"@types/node": "^20.12.8",
4443
"@types/qs": "^6.9.15",
45-
"@types/react": "^18.2.66",
4644
"@types/react-dom": "^18.2.22",
4745
"@types/react-input-mask": "^3.0.5",
46+
"@types/react": "^18.2.66",
4847
"@typescript-eslint/eslint-plugin": "^7.2.0",
4948
"@typescript-eslint/parser": "^7.2.0",
5049
"@vitejs/plugin-react": "^4.2.1",
5150
"autoprefixer": "^10.4.19",
52-
"eslint": "^8.57.0",
5351
"eslint-plugin-react-hooks": "^4.6.0",
5452
"eslint-plugin-react-refresh": "^0.4.6",
53+
"eslint": "^8.57.0",
5554
"postcss": "^8.4.38",
5655
"tailwindcss": "^3.4.3",
5756
"typescript": "^5.2.2",

src/components/Authenticated/Authenticated.tsx

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
1-
import { Fragment, useContext } from 'react';
1+
import { Fragment } from 'react';
22

3-
import { SessionContext } from '@/contexts';
43
import { IAuthenticatedProps } from './types';
5-
import { AccessLevel } from '@/service/sessions/types';
6-
7-
const MappedRoles: Record<AccessLevel, AccessLevel[]> = {
8-
Admin: ['Admin'],
9-
DistributionCenter: ['Admin', 'DistributionCenter'],
10-
Staff: ['Admin', 'Staff'],
11-
User: ['Admin', 'Staff', 'DistributionCenter', 'User'],
12-
};
4+
import { useAuthRoles } from '@/hooks';
135

146
const Authenticated = ({ children, role = 'User' }: IAuthenticatedProps) => {
15-
const { session } = useContext(SessionContext);
7+
const isAuthenticated = useAuthRoles(role);
168

17-
if (!session || !MappedRoles[role].includes(session.accessLevel))
18-
return <Fragment />;
9+
if (!isAuthenticated) return <Fragment />;
1910

2011
return <div className="contents">{children}</div>;
2112
};
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
import { Fragment, useCallback, useContext } from 'react';
2+
import {
3+
CircleHelp,
4+
CirclePlus,
5+
DoorOpen,
6+
Info,
7+
LinkIcon,
8+
Menu,
9+
} from 'lucide-react';
10+
11+
import { SessionServices } from '@/service';
12+
import { Sheet, SheetContent, SheetTrigger } from '@/components/ui/sheet';
13+
import { BurguerMenuItem } from './components';
14+
import { Separator } from '../ui/separator';
15+
import { SessionContext } from '@/contexts';
16+
import { usePartners } from '@/hooks';
17+
18+
const BurgerMenu = () => {
19+
const { session } = useContext(SessionContext);
20+
const { data: partners } = usePartners();
21+
22+
const logout = useCallback(() => {
23+
SessionServices.logout()
24+
.then(() => {
25+
localStorage.removeItem('token');
26+
window.location.href = '/';
27+
})
28+
.catch((err) => {
29+
console.log(`Erro ao realizar logout: ${err}`);
30+
});
31+
}, []);
32+
33+
return (
34+
<Sheet>
35+
<SheetTrigger>
36+
<Menu color="white" className="ml-2 mr-2" />
37+
</SheetTrigger>
38+
<SheetContent side="left" className="pt-[96px] flex flex-col">
39+
<div className="flex flex-col gap-4">
40+
{session && (
41+
<Fragment>
42+
<div className="inline-flex items-center text-semibold">
43+
Olá, {session.name}
44+
</div>
45+
<Separator />
46+
</Fragment>
47+
)}
48+
<BurguerMenuItem
49+
label="Sobre nós"
50+
link="/sobre-nos"
51+
icon={<Info className="w-4 h-4" />}
52+
/>
53+
<BurguerMenuItem
54+
label="Cadastrar abrigo"
55+
link="https://forms.gle/2S7L2gR529Dc8P3T9"
56+
icon={<CirclePlus className="w-4 h-4" />}
57+
/>
58+
<BurguerMenuItem
59+
label="Como Ajudar"
60+
link="https://www.instagram.com/reel/C613CfGuh4b"
61+
icon={<CircleHelp className="w-4 h-4" />}
62+
/>
63+
<BurguerMenuItem
64+
label="Política de Privacidade"
65+
link="/politica-de-privacidade"
66+
icon={<Info className="w-4 h-4" />}
67+
/>
68+
<Separator />
69+
{partners.length > 0 && (
70+
<Fragment>
71+
<span>Parcerias</span>
72+
{partners.map((partner, idx) => (
73+
<BurguerMenuItem
74+
key={idx}
75+
label={partner.name}
76+
link={partner.link}
77+
icon={<LinkIcon className="w-4 h-4" />}
78+
/>
79+
))}
80+
</Fragment>
81+
)}
82+
</div>
83+
{session && (
84+
<div className="mt-auto">
85+
<span
86+
className="inline-flex items-center hover:font-semibold cursor-pointer"
87+
onClick={logout}
88+
>
89+
<DoorOpen className="mr-2" /> Sair
90+
</span>
91+
</div>
92+
)}
93+
</SheetContent>
94+
</Sheet>
95+
);
96+
};
97+
98+
export { BurgerMenu };
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import React from 'react';
2+
3+
import { IBurguerMenuItemProps } from './types';
4+
import { cn } from '@/lib/utils';
5+
6+
const BurguerMenuItem = React.forwardRef<
7+
HTMLAnchorElement,
8+
IBurguerMenuItemProps
9+
>((props, ref) => {
10+
const { icon, label, onClick, link, className = '', ...rest } = props;
11+
12+
return (
13+
<a
14+
ref={ref}
15+
href={link}
16+
target="_blank"
17+
className={cn(
18+
'hover:font-semibold flex gap-2 items-center text-zinc-600 [&_svg]:stroke-zinc-500',
19+
className
20+
)}
21+
onClick={onClick}
22+
{...rest}
23+
>
24+
{icon}
25+
{label}
26+
</a>
27+
);
28+
});
29+
30+
export { BurguerMenuItem };
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { BurguerMenuItem } from './BurguerMenuItem';
2+
3+
export { BurguerMenuItem };
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export interface IBurguerMenuItemProps
2+
extends React.ComponentPropsWithoutRef<'a'> {
3+
label: string;
4+
icon?: React.ReactNode;
5+
link?: string;
6+
onClick?: () => void;
7+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { BurguerMenuItem } from './BurguerMenuItem';
2+
3+
export { BurguerMenuItem };

src/components/BurgerMenu/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { BurgerMenu } from "./BurgerMenu";
2+
3+
export { BurgerMenu };

0 commit comments

Comments
 (0)