File tree 1 file changed +12
-16
lines changed
1 file changed +12
-16
lines changed Original file line number Diff line number Diff line change 1
1
import * as React from "react" ;
2
- import { useState , useEffect } from "react" ;
2
+ import { useEffect , useState } from "react" ;
3
3
4
- const OfflineNotification : React . FC = ( ) => {
4
+ export default function OfflineNotification ( ) {
5
5
const [ isOffline , setIsOffline ] = useState ( false ) ;
6
6
const [ isClosed , setIsClosed ] = useState ( false ) ;
7
7
@@ -29,20 +29,16 @@ const OfflineNotification: React.FC = () => {
29
29
if ( ! isOffline ) return null ;
30
30
31
31
return (
32
- < div className = { `fixed inset-0 z-50 flex items-start justify-center` } >
33
- < div
34
- className = { `flex items-center justify-between rounded-lg bg-red-600 px-6 py-3 text-white shadow-lg` }
32
+ < div className = "fixed left-1/2 top-2 z-50 mx-auto flex -translate-x-1/2 items-center justify-between rounded-lg bg-red-600 shadow-lg" >
33
+ < p className = "pl-3 text-[16px] font-medium text-white" >
34
+ No internet connection!
35
+ </ p >
36
+ < button
37
+ className = "flex p-2 pr-3 text-white hover:text-gray-300"
38
+ onClick = { ( ) => setIsClosed ( true ) }
35
39
>
36
- < p className = "text-sm md:text-base" > No internet connection!</ p >
37
- < button
38
- className = "ml-4 text-lg font-bold text-white hover:text-gray-300 md:text-xl"
39
- onClick = { ( ) => setIsClosed ( true ) }
40
- >
41
- ×
42
- </ button >
43
- </ div >
40
+ < span className = "icon-[material-symbols--close] text-2xl" />
41
+ </ button >
44
42
</ div >
45
43
) ;
46
- } ;
47
-
48
- export default OfflineNotification ;
44
+ }
You can’t perform that action at this time.
0 commit comments