Skip to content
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

Merged staging into main #350

Merged
merged 52 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
be7507e
fix: :bug: Ajuste do tamanho do botao reload
kevinDsousa May 17, 2024
0b176a6
feat: Correção do título com/sem filtros #247
Tiago-Silva May 19, 2024
11d59fd
Criado botao
Lmedeiros-leiman May 20, 2024
458788d
Adicionado funcoes para o botao. COMENTADO OVERFLOW-X:HIDDEN no globa…
Lmedeiros-leiman May 20, 2024
d81fb7e
removendo necessidade de remover overflow-x:hidden no global.css
Lmedeiros-leiman May 20, 2024
509703c
resolvendo funcoes
Lmedeiros-leiman May 20, 2024
ba31363
Finalizando.
Lmedeiros-leiman May 20, 2024
ba6a7c0
aplicado o design recomendado pela barbiebrega
Lmedeiros-leiman May 21, 2024
9a30b5c
feat: Correção do título com/sem filtros #247
Tiago-Silva May 22, 2024
8bc5f61
Merge remote-tracking branch 'upstream/develop' into develop
Tiago-Silva May 23, 2024
2f807b7
Merge branch 'SOS-RS:develop' into feature/Botao-voltar-ao-topo
Lmedeiros-leiman May 23, 2024
39cf7d1
Merge branch 'SOS-RS:develop' into feature/Botao-voltar-ao-topo
Lmedeiros-leiman May 24, 2024
814f86f
Removido erro de tipagem.
Lmedeiros-leiman May 24, 2024
f4dc0e1
Feature/botao voltar ao topo (#280)
larissapissurno May 25, 2024
afde606
#287 - [FIX] Itens Cadastrados sem Categoria estão indo para Medicame…
TucanoWeb May 25, 2024
ba55a4b
Update - Melhoria na listagem de suplementos (#249)
xlucaix May 26, 2024
3349149
fix: :bug: Ajuste do tamanho do botao reload Issue 221 (#239)
rhuam May 28, 2024
aeb8822
feat: add multi option for priority queryParam
May 27, 2024
f05a08f
feat: add multi option for priority queryParam (#330)
rodrigooler May 29, 2024
952100e
fix(filtro-shelters): add missing typing definition
diegodario88 May 29, 2024
697e56b
fix(filtro-shelters): add missing typing definition (#335)
rodrigooler May 29, 2024
db217f8
fix: name of array of priority to priorities, priority field changed …
fagundesjg May 29, 2024
37d7876
fix: priorities (#336)
fagundesjg May 29, 2024
8f523d0
Feat: Carrinho de Doações (#340)
fagundesjg May 30, 2024
6af7dd7
fix/ replaced all native emoji occurences with lucide icons (#304)
dadedeandrade Jun 2, 2024
37cc2ec
fix: botão "atualizar" de atualizar abrigo aparece cortado para fora …
felipemrvieira Jun 2, 2024
b58d437
fix: [BUG] Filtros não persistem ao retornar de um abrigo específico.
Johnviti Jun 2, 2024
95034e2
Creates route and page component
Jun 3, 2024
1b72ee2
Create Hook for donations
Jun 3, 2024
073e206
Adds page to index
Jun 3, 2024
03402f5
Adds update method to donationOrder service
Jun 3, 2024
c15fd2d
Adds handleCancel and handleConfirm to donations
Jun 3, 2024
b5e6643
Styles all components, creates dialog box for confirmation and
Jun 3, 2024
bf9da1c
Reformats display date according to design
Jun 3, 2024
baa116f
Corrects namings of variables and titles according to Figma design
Jun 3, 2024
409416a
Eliminates unused code
Jun 3, 2024
bc51f3a
Remove unused interfaces
Jun 3, 2024
4838b8e
Closes #327
Jun 3, 2024
3e946a7
Updates cart so that button 'Verificar histórico de doações' redirect…
Jun 3, 2024
afe4689
Removes comments and changes date function to use lib date-fns
Jun 3, 2024
4b869f5
feat: Correção do título com/sem filtros #247 (#270)
rodrigooler Jun 3, 2024
f7498f0
Closes #327: Cria tela "List Donations" (#343)
rhuam Jun 4, 2024
551cfa2
feat: add PetsRs link to shelter card (#302)
coelhotatiane Jun 5, 2024
a84b04f
refactor: donation history page
fagundesjg Jun 5, 2024
eba3fd2
refactor: donation history page (#346)
rhuam Jun 5, 2024
73265cd
fix: space between donation history items
fagundesjg Jun 5, 2024
4cbfea4
feat: added handle print on donation item
fagundesjg Jun 6, 2024
f3963ae
feat: added handle print on donation item (#347)
rhuam Jun 6, 2024
a166371
refactor: donation order print and added handle print on success dona…
fagundesjg Jun 7, 2024
c8292f1
refactor: donation order print (#348)
rhuam Jun 7, 2024
03229f8
merge with staging
fagundesjg Jun 10, 2024
ca9b0e3
Merged `develop` into `staging` (#349)
rhuam Jun 10, 2024
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
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
VITE_API_URL=http://localhost:4000
VITE_HMAC_SECRET_KEY=
VITE_HMAC_SECRET_KEY=
VITE_REQUEST_CACHE=false
43 changes: 43 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@radix-ui/react-select": "^2.0.0",
"@radix-ui/react-separator": "^1.0.3",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-tabs": "^1.0.4",
"@radix-ui/react-toast": "^1.1.5",
"@radix-ui/react-tooltip": "^1.0.7",
"axios": "^1.6.8",
Expand All @@ -35,6 +36,7 @@
"react-input-mask": "^2.0.4",
"react-router-dom": "^6.23.0",
"react-select": "^5.8.0",
"react-to-print": "^2.15.1",
"tailwind-merge": "^2.3.0",
"tailwindcss-animate": "^1.0.7",
"yup": "^1.4.0"
Expand Down
Binary file added public/logo-sos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 6 additions & 4 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@ import { Fragment } from 'react';
import { BrowserRouter } from 'react-router-dom';

import { Routes } from './routes/Routes';
import { SessionProvider } from './contexts';
import { DonationCartProvider, SessionProvider } from './contexts';
import { Toaster } from './components/ui/toaster';
import { BackToTop } from '@/components/BackToTop';
import { BackToTop } from '@/components';

const App = () => {
return (
<Fragment>
<Toaster />
<BrowserRouter>
<SessionProvider>
<BackToTop/>
<Routes />
<DonationCartProvider>
<BackToTop />
<Routes />
</DonationCartProvider>
</SessionProvider>
</BrowserRouter>
</Fragment>
Expand Down
62 changes: 33 additions & 29 deletions src/components/BackToTop/BackToTop.tsx
Original file line number Diff line number Diff line change
@@ -1,41 +1,45 @@
import { useState } from "react"
import { ArrowUp } from "lucide-react"
import { useState } from 'react';
import { ArrowUp } from 'lucide-react';

const BackToTop = () => {
const [isVisible, setVisibility] = useState(false);

const BackToTop =() => {

const [isVisible, setVisibility] = useState(false)

const scrollToTop = () => {
let root = document.getElementById('root')
if (!root) {return}

root.scrollTo({top:0, behavior:"smooth"})

const scrollToTop = () => {
const root = document.getElementById('root');
if (!root) {
return;
}

document.getElementById("root")?.addEventListener('scroll', (e) => {
if (e.target === null) {return}
let CurrentScrollHeight = (e.target as HTMLElement).scrollTop
let WindowHeight = window.innerHeight
root.scrollTo({ top: 0, behavior: 'smooth' });
};

if ( CurrentScrollHeight > WindowHeight / 2) {
setVisibility(true)
} else {
setVisibility(false)
}
})
document.getElementById('root')?.addEventListener('scroll', (e) => {
if (e.target === null) {
return;
}
const CurrentScrollHeight = (e.target as HTMLElement).scrollTop;
const WindowHeight = window.innerHeight;

if (CurrentScrollHeight > WindowHeight / 2) {
setVisibility(true);
} else {
setVisibility(false);
}
});

return (isVisible && (
<button
className=" fixed ease-in-out hidden sm:flex justify-center items-center duration-300
return (
isVisible && (
<button
className=" fixed ease-in-out hidden sm:flex justify-center items-center duration-300
bg-red-600/75 focus:bg-red-700 hover:bg-red-700 z-[100] shadow-slate-600/75
right-6 bottom-6 rounded-full shadow-md
w-12 h-12 "
onClick={scrollToTop}
><ArrowUp color="white" /></button>
));
}
onClick={scrollToTop}
>
<ArrowUp color="white" />
</button>
)
);
};

export { BackToTop };
19 changes: 18 additions & 1 deletion src/components/BurgerMenu/BurgerMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@ import {
LinkIcon,
Menu,
ShieldAlert,
X,
} from 'lucide-react';
import clsx from 'clsx';

import { SessionServices } from '@/service';
import { Sheet, SheetContent, SheetTrigger } from '@/components/ui/sheet';
import { BurguerMenuItem } from './components';
import { Separator } from '../ui/separator';
import { SessionContext } from '@/contexts';
import { usePartners } from '@/hooks';
import { Button } from '../ui/button';
import { DialogClose, DialogFooter } from '../ui/dialog';

const BurgerMenu = () => {
const { session } = useContext(SessionContext);
Expand All @@ -37,7 +41,14 @@ const BurgerMenu = () => {
<SheetTrigger>
<Menu color="white" className="ml-2 mr-2" />
</SheetTrigger>
<SheetContent side="left" className="pt-[96px] flex flex-col">
<SheetContent side="left" className="pt-[96px] flex flex-col z-[90]">
<DialogFooter className="absolute top-16 right-4">
<DialogClose asChild>
<Button type="button" variant="ghost">
<X className="stroke-muted-foreground" />
</Button>
</DialogClose>
</DialogFooter>
<div className="flex flex-col gap-4">
{session && (
<Fragment>
Expand All @@ -52,6 +63,12 @@ const BurgerMenu = () => {
link="/sobre-nos"
icon={<Info className="w-5 h-5" />}
/>
<BurguerMenuItem
label="Minhas Doações"
link="/doacoes"
icon={<HeartHandshake className="w-5 h-5" />}
className={clsx({ hidden: !session })}
/>
<BurguerMenuItem
label="Cadastrar abrigo"
link="https://forms.gle/2S7L2gR529Dc8P3T9"
Expand Down
31 changes: 29 additions & 2 deletions src/components/CardAboutShelter/CardAboutShelter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,40 @@ import {
Smartphone,
Building,
MapPinned,
Link,
} from 'lucide-react';

import { Card } from '../ui/card';
import { ICardAboutShelter } from './types';
import { InfoRow } from './components';
import { checkAndFormatAddress } from './utils';
import { checkAndFormatAddress, getShelterNameBeforeSeparator } from './utils';
import { ShelterCategory } from '@/hooks/useShelter/types';
import { Fragment } from 'react/jsx-runtime';
import { PetsRsShelterServices } from '@/service/petsRsShelter/petsRsShelter.service';
import { useEffect, useState } from 'react';

const CardAboutShelter = (props: ICardAboutShelter) => {
const { shelter } = props;
const [ petsRsShelterUrl, setPetsRsShelterUrl ] = useState('');

const check = (v?: string | number | boolean | null) => {
return v !== undefined && v !== null;
};
const formatAddress = checkAndFormatAddress(shelter, false);

const getPetsRsShelterUrl = async (name: string) => {
const cleanShelterName = getShelterNameBeforeSeparator(name);
const data = await PetsRsShelterServices.getByName(cleanShelterName);
const petsRsShelterUrl = data?.id ? `https://petsrs.com.br/abrigo/${data.id}` : 'https://petsrs.com.br/abrigos';
return petsRsShelterUrl;
};

useEffect(() => {
if(shelter.petFriendly) {
getPetsRsShelterUrl(shelter.name).then((url) => setPetsRsShelterUrl(url) );
}
},[shelter.petFriendly, shelter.name]);

const formatAddress = checkAndFormatAddress(shelter, false);
return (
<Card className="flex flex-col gap-2 p-4 bg-[#E8F0F8] text-sm">
<div className="text-[#646870] font-medium">Sobre o abrigo</div>
Expand Down Expand Up @@ -89,6 +106,16 @@ const CardAboutShelter = (props: ICardAboutShelter) => {
value={check(shelter.pix) ? `${shelter.pix}` : 'Não informado'}
clipboardButton={check(shelter.pix)}
/>
{(petsRsShelterUrl != '') ? (
<InfoRow
icon={<Link />}
label={
<a target="_blank" href={petsRsShelterUrl} className="font-semibold text-blue-600">
Confira o abrigo em petsrs.com.br
</a>
}
/>
) : ''}
</div>
</Card>
);
Expand Down
6 changes: 5 additions & 1 deletion src/components/CardAboutShelter/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@ const checkAndFormatAddress = (
);
};

export { checkAndFormatAddress };
function getShelterNameBeforeSeparator(input: string): string {
return input.replace(/[(\-[{].*$/, '');
}

export { checkAndFormatAddress, getShelterNameBeforeSeparator };
48 changes: 48 additions & 0 deletions src/components/DonationCart/DonationCart.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { useEffect, useState } from 'react';

import { IDonationCart } from './types';
import { Sheet, SheetContent } from '../ui/sheet';
import { DonationCartForm, DonationSuccess } from './components';

const DonationCart = (props: IDonationCart) => {
const { onClose, opened, shelterId } = props;
const [donationOrderId, setDonationOrderId] = useState<string | null>(null);

useEffect(() => {
const el = document.querySelector('header');
if (el) {
if (opened) {
el?.classList.remove('z-[100]');
el?.classList.add('z-0');
} else {
el?.classList.remove('z-0');
el?.classList.add('z-[100]');
}
}
}, [opened]);

useEffect(() => {
if (!opened) setDonationOrderId(null);
}, [opened]);

return (
<Sheet open={opened} onOpenChange={onClose}>
<SheetContent
side="right"
className="z-[120] flex flex-col pb-0 px-0 overflow-y-auto"
>
{donationOrderId ? (
<DonationSuccess donationOrderId={donationOrderId} />
) : (
<DonationCartForm
onCancel={onClose}
shelterId={shelterId}
onSuccess={(orderId) => setDonationOrderId(orderId)}
/>
)}
</SheetContent>
</Sheet>
);
};

export { DonationCart };
Loading
Loading