Skip to content

Commit a1e8945

Browse files
larissapissurnokevinDsousaLmedeiros-leimanTucanoWebxlucaix
authored
[release 0.0.4] Merges develop on staging (#311)
* fix: 🐛 Ajuste do tamanho do botao reload Fixado tamanho do botão para corrigir erro no Header * Criado botao * Adicionado funcoes para o botao. COMENTADO OVERFLOW-X:HIDDEN no global.css * removendo necessidade de remover overflow-x:hidden no global.css * resolvendo funcoes * Finalizando. durante meus testes esqueci de inverter o estado inicial do botão. * aplicado o design recomendado pela barbiebrega * Removido erro de tipagem. * #287 - [FIX] Itens Cadastrados sem Categoria estão indo para Medicamentos (#296) * #287 * Delete src/components/Icon directory * Update SupplyRowInfo.tsx * RollBack SupplyRowInfo.tsx * Update SupplyRow.tsx * Update EditShelterSupply.tsx * Update CreateSupply.tsx - De forma a evitar termos genéricos demais, é solicitado ao usuário que registre um recurso com no mínimo 3 caracteres. Validação via Yup. * Update CreateSupply.tsx - Bloqueia cadastro de items com números e caracteres especiais. Validação via Yup. * Update CreateSupply.tsx * Update CreateSupply.tsx - Limite de 30 itens retornados enquanto o usuário está digitando o termo desejado. * Update CreateSupply.tsx - Bloqueia caracteres especiais; - Requer no mínimo 3 letras (bloqueia apenas números). * Update - Melhoria na listagem de suplementos (#249) * feat: add multi option for priority queryParam * fix(filtro-shelters): add missing typing definition * fix: name of array of priority to priorities, priority field changed from string to array and removed unused import --------- Co-authored-by: kevindsousa <[email protected]> Co-authored-by: leonardo <[email protected]> Co-authored-by: Leonardo <[email protected]> Co-authored-by: Eric Ricielle <[email protected]> Co-authored-by: Lucas <[email protected]> Co-authored-by: Rhuam Sena <[email protected]> Co-authored-by: Diego Dario <[email protected]> Co-authored-by: Rodrigo Oler <[email protected]> Co-authored-by: Diego Dario <[email protected]> Co-authored-by: José Fagundes <[email protected]>
1 parent 51a582d commit a1e8945

File tree

16 files changed

+572
-162
lines changed

16 files changed

+572
-162
lines changed

src/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ import { BrowserRouter } from 'react-router-dom';
44
import { Routes } from './routes/Routes';
55
import { SessionProvider } from './contexts';
66
import { Toaster } from './components/ui/toaster';
7+
import { BackToTop } from '@/components/BackToTop';
78

89
const App = () => {
910
return (
1011
<Fragment>
1112
<Toaster />
1213
<BrowserRouter>
1314
<SessionProvider>
15+
<BackToTop/>
1416
<Routes />
1517
</SessionProvider>
1618
</BrowserRouter>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { useState } from "react"
2+
import { ArrowUp } from "lucide-react"
3+
4+
5+
const BackToTop =() => {
6+
7+
const [isVisible, setVisibility] = useState(false)
8+
9+
const scrollToTop = () => {
10+
let root = document.getElementById('root')
11+
if (!root) {return}
12+
13+
root.scrollTo({top:0, behavior:"smooth"})
14+
15+
}
16+
17+
document.getElementById("root")?.addEventListener('scroll', (e) => {
18+
if (e.target === null) {return}
19+
let CurrentScrollHeight = (e.target as HTMLElement).scrollTop
20+
let WindowHeight = window.innerHeight
21+
22+
if ( CurrentScrollHeight > WindowHeight / 2) {
23+
setVisibility(true)
24+
} else {
25+
setVisibility(false)
26+
}
27+
})
28+
29+
30+
return (isVisible && (
31+
<button
32+
className=" fixed ease-in-out hidden sm:flex justify-center items-center duration-300
33+
bg-red-600/75 focus:bg-red-700 hover:bg-red-700 z-[100] shadow-slate-600/75
34+
right-6 bottom-6 rounded-full shadow-md
35+
w-12 h-12 "
36+
onClick={scrollToTop}
37+
><ArrowUp color="white" /></button>
38+
));
39+
}
40+
41+
export { BackToTop };

src/components/BackToTop/index.ts

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

src/components/Chip/Chip.tsx

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,32 @@ import { cva } from 'class-variance-authority';
55
const Chip = React.forwardRef<HTMLDivElement, IChipProps>((props, ref) => {
66
const { label, className, variant = 'info', ...rest } = props;
77

8-
const variants = cva('px-4 py-1.5 font-medium text-sm md:text-md rounded-2xl', {
9-
variants: {
10-
variant: {
11-
warn: 'bg-light-yellow',
12-
success: 'bg-light-green',
13-
danger: 'bg-light-red',
14-
alert: 'bg-light-orange',
15-
info: 'bg-light-blue',
8+
const variants = cva(
9+
'px-4 py-1.5 font-medium text-sm md:text-md rounded-2xl',
10+
{
11+
variants: {
12+
variant: {
13+
warn: 'bg-light-yellow',
14+
success: 'bg-light-green',
15+
danger: 'bg-light-red',
16+
alert: 'bg-light-orange',
17+
info: 'bg-light-blue',
18+
moreInfo: 'bg-gray-200 text-black-600',
19+
},
1620
},
17-
},
18-
defaultVariants: {
19-
variant: 'info',
20-
},
21-
});
21+
defaultVariants: {
22+
variant: 'info',
23+
},
24+
}
25+
);
2226

2327
return (
24-
<span tabIndex={0} ref={ref} {...rest} className={variants({ className, variant })}>
28+
<span
29+
tabIndex={0}
30+
ref={ref}
31+
{...rest}
32+
className={variants({ className, variant })}
33+
>
2534
{label}
2635
</span>
2736
);

src/components/Chip/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export type ChipVariant = 'info' | 'success' | 'warn' | 'danger';
1+
export type ChipVariant = 'info' | 'success' | 'warn' | 'danger' | 'moreInfo';
22

33
export interface IChipProps extends React.ComponentPropsWithoutRef<'div'> {
44
label: string;

src/components/Header/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const Header = React.forwardRef<HTMLDivElement, IHeader>((props, ref) => {
2828
{title}
2929
</Link>
3030
</div>
31-
<div className="flex items-center">
31+
<div className="flex items-center h-5">
3232
<div className="cursor-pointer ">{endAdornment}</div>
3333
</div>
3434
</div>

0 commit comments

Comments
 (0)