Skip to content

Commit

Permalink
🔀 merge: main
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnPetros committed Oct 21, 2024
2 parents 237c0fd + 038a899 commit 64a2d58
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ https://github.com/user-attachments/assets/2a9432b4-2785-4214-95e5-3daf1474814f

### Sprint - 2️⃣

Work in progress... 🚧
https://github.com/user-attachments/assets/5fc5ecfe-b5ca-4994-9c50-6341796bb7cc

### Sprint - 3️⃣

Expand Down
31 changes: 21 additions & 10 deletions apps/web/src/ui/components/commons/drawer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
'use client'

import { type ForwardedRef, forwardRef, useImperativeHandle, type ReactNode } from 'react'
import {
type ForwardedRef,
forwardRef,
useImperativeHandle,
type ReactNode,
useEffect,
useState,
} from 'react'
import { Slot } from '@radix-ui/react-slot'
import RmDrawer from 'react-modern-drawer'
import 'react-modern-drawer/dist/index.css'
Expand Down Expand Up @@ -34,24 +39,30 @@ export const DrawerComponent = (
) => {
const { isOpen, open, close } = useDrawer(onOpen, onClose)
const { md } = useBreakpoint()
const [drawerKey, setDrawerKey] = useState(0)

useEffect(() => {
if (isOpen) {
setDrawerKey((prevKey) => prevKey + 1)
}
}, [isOpen, md, width])

useImperativeHandle(
ref,
() => {
return {
close,
open,
}
},
() => ({
close,
open,
}),
[close, open],
)

return (
<>
<RmDrawer
key={drawerKey}
open={isOpen}
onClose={close}
size={md ? width ?? 700 : 370}
size={md ? width ?? 700 : 350}
direction={direction}
zIndex={zIndex}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const ProductRow = ({
<div className='flex flex-col'>
<div className='flex items-center gap-2'>
<p className='font-semibold text-sm text-zinc-900 truncate'>{name}</p>
<Link href={`/inventory/stock/${id}`} aria-label={`View ${name}`}>
<Link href={`/inventory/stocks/${id}`} aria-label={`View ${name}`}>
<Icon name='link' className='text-zinc-600' size={16} />
</Link>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export const RegisterProductForm = ({ onSubmit, onCancel }: RegisterProductFormP
<Button onClick={onCancel} isDisabled={isSubmiting}>
Cancelar
</Button>
<Button type='submit' color='primary' isLoading={true}>
<Button type='submit' color='primary' isLoading={isSubmiting}>
Confirmar
</Button>
</div>
Expand Down

0 comments on commit 64a2d58

Please sign in to comment.