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

merges develop on staging #345

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 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
4b869f5
feat: Correção do título com/sem filtros #247 (#270)
rodrigooler Jun 3, 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
8 changes: 6 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +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';

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

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

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

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

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
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>
)
);
};

export { BackToTop };
3 changes: 3 additions & 0 deletions src/components/BackToTop/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { BackToTop } from "./BackToTop";

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

import { SessionServices } from '@/service';
Expand All @@ -16,6 +17,9 @@ import { BurguerMenuItem } from './components';
import { Separator } from '../ui/separator';
import { SessionContext } from '@/contexts';
import { usePartners } from '@/hooks';
import { DialogClose } from '@radix-ui/react-dialog';
import { Button } from '../ui/button';
import { 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 Down
37 changes: 23 additions & 14 deletions src/components/Chip/Chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,32 @@ import { cva } from 'class-variance-authority';
const Chip = React.forwardRef<HTMLDivElement, IChipProps>((props, ref) => {
const { label, className, variant = 'info', ...rest } = props;

const variants = cva('px-4 py-1.5 font-medium text-sm md:text-md rounded-2xl', {
variants: {
variant: {
warn: 'bg-light-yellow',
success: 'bg-light-green',
danger: 'bg-light-red',
alert: 'bg-light-orange',
info: 'bg-light-blue',
const variants = cva(
'px-4 py-1.5 font-medium text-sm md:text-md rounded-2xl',
{
variants: {
variant: {
warn: 'bg-light-yellow',
success: 'bg-light-green',
danger: 'bg-light-red',
alert: 'bg-light-orange',
info: 'bg-light-blue',
moreInfo: 'bg-gray-200 text-black-600',
},
},
},
defaultVariants: {
variant: 'info',
},
});
defaultVariants: {
variant: 'info',
},
}
);

return (
<span tabIndex={0} ref={ref} {...rest} className={variants({ className, variant })}>
<span
tabIndex={0}
ref={ref}
{...rest}
className={variants({ className, variant })}
>
{label}
</span>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Chip/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export type ChipVariant = 'info' | 'success' | 'warn' | 'danger';
export type ChipVariant = 'info' | 'success' | 'warn' | 'danger' | 'moreInfo';

export interface IChipProps extends React.ComponentPropsWithoutRef<'div'> {
label: string;
Expand Down
45 changes: 45 additions & 0 deletions src/components/DonationCart/DonationCart.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
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">
{donationOrderId ? (
<DonationSuccess donationOrderId={donationOrderId} />
) : (
<DonationCartForm
onCancel={onClose}
shelterId={shelterId}
onSuccess={(orderId) => setDonationOrderId(orderId)}
/>
)}
</SheetContent>
</Sheet>
);
};

export { DonationCart };
Loading
Loading