Skip to content

Commit

Permalink
fix: modal with large height is not fully displayed (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
hudy9x authored May 2, 2024
1 parent cedff71 commit 0dfd996
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 17 deletions.
11 changes: 8 additions & 3 deletions packages/shared-ui/src/components/Dialog/DialogContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,16 @@ export default function DialogContent({

return <div
className={`dialog-wrapper ${open ? "" : 'pointer-events-none -z-10'}`}
style={!open ? { overflowY: 'hidden' } : {}}
onClick={clickOutSide}>
<div className={`dialog-backdrop ${visible}`}></div>
<div onClick={stopPropagation} className={`dialog-content ${classes.join(' ')}`}>
<DialogClose />
{children}
<div className={`${open ? 'overflow-y-auto' : ''} h-full z-10 relative py-[100px]`}>
<div className="flex items-center justify-center">
<div onClick={stopPropagation} className={`dialog-content ${classes.join(' ')}`}>
<DialogClose />
{children}
</div>
</div>
</div>
</div>
}
11 changes: 8 additions & 3 deletions packages/shared-ui/src/components/Dialog/style.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.dialog-wrapper {
@apply fixed z-50 top-0 left-0 w-full h-full overflow-y-auto;
@apply flex items-center justify-center;
@apply fixed z-50 top-0 left-0 w-full h-full;
/* @apply overflow-y-auto; */
/* @apply flex items-center justify-center; */
}

.dialog-backdrop {
Expand All @@ -27,9 +28,13 @@
max-height: initial;
}

.dialog-content.show{
@apply pointer-events-auto;
}

.dialog-backdrop.show,
.dialog-content.show{
@apply pointer-events-auto scale-100;
@apply scale-100;
@apply opacity-100 ;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ function TaskUpdateModal({
onSubmit: (v: ITaskDefaultValues, cb: () => void) => void
}) {

console.log(task.desc)

return <Dialog.Root open={visible} onOpenChange={() => {
setVisible()
}}>
Expand Down
4 changes: 0 additions & 4 deletions packages/ui-app/app/_components/FileKits/useFileUpload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ export default function useFileUpload() {
type: file.type
})

console.log('res', res)

const { name, presignedUrl, url } = res.data.data
const keyName = name as string
await storagePutFile(presignedUrl, file)
Expand Down Expand Up @@ -181,8 +179,6 @@ export default function useFileUpload() {
}
})

console.log('files items', fileItems)

taskId &&
fileIds.length &&
updateTaskData({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export default function ProjectViewModalForm({
}

const onAdd = () => {
console.log(filter, customView)
setLoading(true)
addProjectView({
icon,
Expand All @@ -52,8 +51,6 @@ export default function ProjectViewModalForm({
})
}

console.log('type', type)

return (
<div className="min-h-[500px]">
<ProjectViewFilterByBoard type={type} desc={desc} onAdd={onAdd} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ export default function FilterForm({ type }: { type?: ProjectViewType }) {
const hidden = customView ? '' : 'hidden'
const { date, point, priority, groupBy, statusIds } = filter

console.log('type', type)

return (
<>
<div className="flex items-center gap-2 mb-3">
Expand Down

0 comments on commit 0dfd996

Please sign in to comment.