mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
update offline indicator design and styling
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import React from "react";
|
||||
import { useSubplebbit } from "@plebbit/plebbit-react-hooks";
|
||||
|
||||
|
||||
const OfflineIndicator = ({ address, className, tooltipPlace }) => {
|
||||
const OfflineIndicator = ({ address, className, tooltipPlace, isText }) => {
|
||||
const subplebbit = useSubplebbit({ subplebbitAddress: address });
|
||||
const isOnline = subplebbit.updatedAt > Date.now() / 1000 - 60 * 20;
|
||||
|
||||
@@ -10,15 +9,22 @@ const OfflineIndicator = ({ address, className, tooltipPlace }) => {
|
||||
<>
|
||||
{!isOnline && (
|
||||
<>
|
||||
{" "}
|
||||
<img
|
||||
className={className}
|
||||
alt="offline"
|
||||
src="assets/offline.png"
|
||||
data-tooltip-id="tooltip"
|
||||
data-tooltip-content="Offline"
|
||||
data-tooltip-place={tooltipPlace}
|
||||
/>
|
||||
{isText ? (
|
||||
<span
|
||||
className={className}
|
||||
>
|
||||
(OFFLINE)
|
||||
</span>
|
||||
) : (
|
||||
<img
|
||||
className={className}
|
||||
alt="offline"
|
||||
src="assets/offline.png"
|
||||
data-tooltip-id="tooltip"
|
||||
data-tooltip-content="Offline"
|
||||
data-tooltip-place={tooltipPlace}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user