Skip to content

Commit e30d966

Browse files
chore: restyle offline notification
1 parent bd7d368 commit e30d966

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

Diff for: src/components/layout/Offline.tsx

+12-16
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from "react";
2-
import { useState, useEffect } from "react";
2+
import { useEffect, useState } from "react";
33

4-
const OfflineNotification: React.FC = () => {
4+
export default function OfflineNotification() {
55
const [isOffline, setIsOffline] = useState(false);
66
const [isClosed, setIsClosed] = useState(false);
77

@@ -29,20 +29,16 @@ const OfflineNotification: React.FC = () => {
2929
if (!isOffline) return null;
3030

3131
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)}
3539
>
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-
&times;
42-
</button>
43-
</div>
40+
<span className="icon-[material-symbols--close] text-2xl" />
41+
</button>
4442
</div>
4543
);
46-
};
47-
48-
export default OfflineNotification;
44+
}

0 commit comments

Comments
 (0)