File tree Expand file tree Collapse file tree 3 files changed +13
-14
lines changed Expand file tree Collapse file tree 3 files changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -31,30 +31,27 @@ const SnippetList = () => {
31
31
32
32
return (
33
33
< >
34
- < motion . ul
35
- role = "list"
36
- className = "snippets"
37
- >
34
+ < motion . ul role = "list" className = "snippets" >
38
35
< AnimatePresence mode = "popLayout" >
39
36
{ fetchedSnippets . map ( ( snippet , idx ) => (
40
37
< motion . li
41
38
key = { idx }
42
39
initial = { { opacity : 0 , y : 20 } }
43
- animate = { {
44
- opacity : 1 ,
40
+ animate = { {
41
+ opacity : 1 ,
45
42
y : 0 ,
46
43
transition : {
47
44
delay : idx * 0.05 ,
48
- duration : 0.2
49
- }
45
+ duration : 0.2 ,
46
+ } ,
50
47
} }
51
- exit = { {
52
- opacity : 0 ,
48
+ exit = { {
49
+ opacity : 0 ,
53
50
y : - 20 ,
54
51
transition : {
55
52
delay : ( fetchedSnippets . length - 1 - idx ) * 0.01 ,
56
- duration : 0.09
57
- }
53
+ duration : 0.09 ,
54
+ } ,
58
55
} }
59
56
>
60
57
< motion . button
Original file line number Diff line number Diff line change @@ -20,9 +20,11 @@ const SnippetModal: React.FC<Props> = ({
20
20
handleCloseModal,
21
21
} ) => {
22
22
const modalRoot = document . getElementById ( "modal-root" ) ;
23
- if ( ! modalRoot ) return null ;
23
+
24
24
useEscapeKey ( handleCloseModal ) ;
25
25
26
+ if ( ! modalRoot ) return null ;
27
+
26
28
return ReactDOM . createPortal (
27
29
< motion . div
28
30
key = "modal-overlay"
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export interface SnippetType {
15
15
code : string [ ] ;
16
16
tags : string [ ] ;
17
17
author : string ;
18
- } ;
18
+ }
19
19
20
20
export type AppState = {
21
21
language : LanguageType ;
You can’t perform that action at this time.
0 commit comments