File tree Expand file tree Collapse file tree 4 files changed +12
-15
lines changed Expand file tree Collapse file tree 4 files changed +12
-15
lines changed Original file line number Diff line number Diff line change @@ -33,10 +33,7 @@ const LineInput: FC<InputProps> = (props) => {
33
33
34
34
return (
35
35
< div className = { `${ props . className } w-full flex flex-col gap-1 text-sm` } >
36
- < BlurOverlay
37
- isActive = { isPopupOpen }
38
- closePopup = { ( ) => setIsPopupOpen ( false ) }
39
- />
36
+ < BlurOverlay isActive = { isPopupOpen } />
40
37
41
38
< LinePopup
42
39
addBadge = { addBadge }
@@ -127,7 +124,9 @@ const LineInput: FC<InputProps> = (props) => {
127
124
( e . target as HTMLImageElement ) . style . display = "none" ;
128
125
} }
129
126
className = "w-4 h-4"
130
- src = { `https://cdn.simpleicons.org/${ badge . iconName } /${
127
+ src = { `https://cdn.simpleicons.org/${ encodeURI (
128
+ badge . iconName
129
+ ) } /${
131
130
badge . color === "auto" ? "" : badge . color . replace ( "#" , "" )
132
131
} `}
133
132
alt = ""
Original file line number Diff line number Diff line change 1
- import { FC , useEffect } from "react" ;
1
+ import { FC } from "react" ;
2
2
3
3
interface OverlayProps {
4
4
isActive : boolean ;
5
- closePopup ?: ( ) => void ;
6
5
}
7
6
8
7
const BlurOverlay : FC < OverlayProps > = ( props ) => {
9
- useEffect ( ( ) => {
10
- document . body . style . overflow = props . isActive ? "hidden" : "auto" ;
11
- } , [ props . isActive ] ) ;
12
-
13
8
return (
14
9
< div
15
10
className = { `w-screen h-screen fixed top-0 left-0 transition-all duration-300
16
- z-20 ${ props . isActive ? "backdrop-blur-sm" : "pointer-events-none" } ` }
17
- onClick = { props . closePopup }
11
+ z-20 ${
12
+ props . isActive
13
+ ? "backdrop-blur-sm bg-black/[.5]"
14
+ : "pointer-events-none"
15
+ } `}
18
16
/>
19
17
) ;
20
18
} ;
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ const LinePopup: FC<LinePopupProps> = (props) => {
39
39
} ;
40
40
41
41
const activeClasses = "opacity-100 pointer-events-auto scale-100" ;
42
- const inactiveClasses = "opacity-0 pointer-events-none scale-0 " ;
42
+ const inactiveClasses = "opacity-0 pointer-events-none scale-50 " ;
43
43
44
44
return (
45
45
< div
Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ export const generateLink = ({
183
183
let line = `&line${ l . lineNumber } =` ;
184
184
for ( const b of l . badges ) {
185
185
const color = b . color . replace ( "#" , "" ) ;
186
- line += `${ b . iconName } ,${ b . label } ,${ color } ;` ;
186
+ line += `${ encodeURI ( b . iconName ) } ,${ encodeURI ( b . label ) } ,${ color } ;` ;
187
187
}
188
188
189
189
res += line ;
You can’t perform that action at this time.
0 commit comments