Skip to content

Commit 0d94c03

Browse files
committed
Remove entry animations and hydration logic from the Modal component
1 parent e742388 commit 0d94c03

2 files changed

Lines changed: 1 addition & 27 deletions

File tree

‎packages/ui/src/components/editor/panel/modals/Modal/Modal.module.scss‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
display: flex;
88
align-items: center;
99
justify-content: center;
10-
opacity: 0;
1110
padding-bottom: 30px;
1211

1312
&::before {
@@ -20,18 +19,6 @@
2019
background-color: var(--vscode-sideBar-background);
2120
opacity: 0.7;
2221
}
23-
24-
&--visible {
25-
opacity: 1;
26-
transition: all var(--transition-duration-250)
27-
var(--transition-timing-function);
28-
29-
.container {
30-
transform: scale(1);
31-
transition: transform var(--transition-duration-250)
32-
var(--transition-timing-function);
33-
}
34-
}
3522
}
3623

3724
.container {
@@ -42,6 +29,5 @@
4229
border: 1px solid var(--vscode-sideBarSectionHeader-border);
4330
width: 100%;
4431
margin: var(--padding-24px);
45-
transform: scale(0.9);
4632
max-width: 320px;
4733
}

‎packages/ui/src/components/editor/panel/modals/Modal/Modal.tsx‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,12 @@
1-
import { useEffect, useState } from 'react'
21
import styles from './Modal.module.scss'
3-
import cn from 'classnames'
42

53
type Props = {
64
children: React.ReactNode
75
}
86

97
export const Modal: React.FC<Props> = (props) => {
10-
const [is_hydrated, set_is_hydrated] = useState(false) // For entry animation
11-
12-
useEffect(() => {
13-
set_is_hydrated(true)
14-
}, [])
15-
168
return (
17-
<div
18-
className={cn(styles.overlay, {
19-
[styles['overlay--visible']]: is_hydrated
20-
})}
21-
>
9+
<div className={styles.overlay}>
2210
<div className={styles.container}>{props.children}</div>
2311
</div>
2412
)

0 commit comments

Comments
 (0)