Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
f5461264
Commit
f5461264
authored
Apr 12, 2024
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: fix dialog background color
parent
e2ae3206
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
24 deletions
+3
-24
BaseDialog.tsx
web/src/components/Dialog/BaseDialog.tsx
+2
-12
consts.ts
web/src/helpers/consts.ts
+0
-3
base-dialog.less
web/src/less/base-dialog.less
+1
-9
No files found.
web/src/components/Dialog/BaseDialog.tsx
View file @
f5461264
...
@@ -3,7 +3,6 @@ import classNames from "classnames";
...
@@ -3,7 +3,6 @@ import classNames from "classnames";
import
{
useEffect
,
useRef
}
from
"react"
;
import
{
useEffect
,
useRef
}
from
"react"
;
import
{
createRoot
}
from
"react-dom/client"
;
import
{
createRoot
}
from
"react-dom/client"
;
import
{
Provider
}
from
"react-redux"
;
import
{
Provider
}
from
"react-redux"
;
import
{
ANIMATION_DURATION
}
from
"@/helpers/consts"
;
import
CommonContextProvider
from
"@/layouts/CommonContextProvider"
;
import
CommonContextProvider
from
"@/layouts/CommonContextProvider"
;
import
store
from
"@/store"
;
import
store
from
"@/store"
;
import
{
useDialogStore
}
from
"@/store/module"
;
import
{
useDialogStore
}
from
"@/store/module"
;
...
@@ -75,24 +74,15 @@ export function generateDialog<T extends DialogProps>(
...
@@ -75,24 +74,15 @@ export function generateDialog<T extends DialogProps>(
document
.
body
.
append
(
tempDiv
);
document
.
body
.
append
(
tempDiv
);
document
.
body
.
style
.
overflow
=
"hidden"
;
document
.
body
.
style
.
overflow
=
"hidden"
;
setTimeout
(()
=>
{
tempDiv
.
firstElementChild
?.
classList
.
add
(
"showup"
);
},
0
);
const
cbs
:
DialogCallback
=
{
const
cbs
:
DialogCallback
=
{
destroy
:
()
=>
{
destroy
:
()
=>
{
tempDiv
.
firstElementChild
?.
classList
.
remove
(
"showup"
);
tempDiv
.
firstElementChild
?.
classList
.
add
(
"showoff"
);
document
.
body
.
style
.
removeProperty
(
"overflow"
);
document
.
body
.
style
.
removeProperty
(
"overflow"
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
dialog
.
unmount
();
dialog
.
unmount
();
tempDiv
.
remove
();
tempDiv
.
remove
();
},
ANIMATION_DURATION
);
});
},
hide
:
()
=>
{
tempDiv
.
firstElementChild
?.
classList
.
remove
(
"showup"
);
tempDiv
.
firstElementChild
?.
classList
.
add
(
"showoff"
);
},
},
hide
:
()
=>
{},
};
};
const
dialogProps
=
{
const
dialogProps
=
{
...
...
web/src/helpers/consts.ts
View file @
f5461264
// UNKNOWN_ID is the symbol for unknown id.
// UNKNOWN_ID is the symbol for unknown id.
export
const
UNKNOWN_ID
=
-
1
;
export
const
UNKNOWN_ID
=
-
1
;
// ANIMATION_DURATION is the duration of animation in milliseconds.
export
const
ANIMATION_DURATION
=
200
;
// DAILY_TIMESTAMP is the timestamp for a day.
// DAILY_TIMESTAMP is the timestamp for a day.
export
const
DAILY_TIMESTAMP
=
3600
*
24
*
1000
;
export
const
DAILY_TIMESTAMP
=
3600
*
24
*
1000
;
...
...
web/src/less/base-dialog.less
View file @
f5461264
.dialog-wrapper {
.dialog-wrapper {
@apply fixed top-0 left-0 flex flex-col justify-start items-center w-full h-full pt-16 pb-8 px-4 z-1000 overflow-x-hidden overflow-y-scroll bg-transparent transition-all hide-scrollbar;
@apply fixed top-0 left-0 flex flex-col justify-start items-center w-full h-full pt-16 pb-8 px-4 z-1000 overflow-x-hidden overflow-y-scroll bg-transparent transition-all hide-scrollbar bg-black bg-opacity-60;
&.showup {
background-color: rgba(0, 0, 0, 0.6);
}
&.showoff {
@apply hidden;
}
> .dialog-container {
> .dialog-container {
@apply max-w-full shadow flex flex-col justify-start items-start bg-white dark:bg-zinc-800 dark:text-gray-300 p-4 rounded-lg;
@apply max-w-full shadow flex flex-col justify-start items-start bg-white dark:bg-zinc-800 dark:text-gray-300 p-4 rounded-lg;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment