Skip to content

Commit

Permalink
[release 0.0.4] Merges staging on main (#338)
Browse files Browse the repository at this point in the history
* 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

---------
  • Loading branch information
rhuam authored May 30, 2024
2 parents 51a582d + a1e8945 commit f2afb66
Show file tree
Hide file tree
Showing 16 changed files with 572 additions and 162 deletions.
2 changes: 2 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import { BrowserRouter } from 'react-router-dom';
import { Routes } from './routes/Routes';
import { SessionProvider } from './contexts';
import { Toaster } from './components/ui/toaster';
import { BackToTop } from '@/components/BackToTop';

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


const BackToTop =() => {

const [isVisible, setVisibility] = useState(false)

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

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

}

document.getElementById("root")?.addEventListener('scroll', (e) => {
if (e.target === null) {return}
let CurrentScrollHeight = (e.target as HTMLElement).scrollTop
let 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 };
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
2 changes: 1 addition & 1 deletion src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const Header = React.forwardRef<HTMLDivElement, IHeader>((props, ref) => {
{title}
</Link>
</div>
<div className="flex items-center">
<div className="flex items-center h-5">
<div className="cursor-pointer ">{endAdornment}</div>
</div>
</div>
Expand Down
Loading

0 comments on commit f2afb66

Please sign in to comment.