mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
revert offline text
This commit is contained in:
@@ -1,30 +1,23 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { useSubplebbit } from "@plebbit/plebbit-react-hooks";
|
import { useSubplebbit } from "@plebbit/plebbit-react-hooks";
|
||||||
|
|
||||||
const OfflineIndicator = ({ address, className, tooltipPlace, isText }) => {
|
const OfflineIndicator = ({ address, className, tooltipPlace }) => {
|
||||||
const subplebbit = useSubplebbit({ subplebbitAddress: address });
|
const subplebbit = useSubplebbit({ subplebbitAddress: address });
|
||||||
const isOnline = subplebbit.updatedAt > Date.now() / 1000 - 60 * 20;
|
const isOnline = false;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{!isOnline && (
|
{!isOnline && (
|
||||||
<>
|
<>
|
||||||
{isText ? (
|
{" "}
|
||||||
<span
|
<img
|
||||||
className={className}
|
className={className}
|
||||||
>
|
alt="offline"
|
||||||
(OFFLINE)
|
src="assets/offline.png"
|
||||||
</span>
|
data-tooltip-id="tooltip"
|
||||||
) : (
|
data-tooltip-content="Offline"
|
||||||
<img
|
data-tooltip-place={tooltipPlace}
|
||||||
className={className}
|
/>
|
||||||
alt="offline"
|
|
||||||
src="assets/offline.png"
|
|
||||||
data-tooltip-id="tooltip"
|
|
||||||
data-tooltip-content="Offline"
|
|
||||||
data-tooltip-place={tooltipPlace}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -284,8 +284,10 @@ export const BoardsContent = styled.div`
|
|||||||
font-size: 1.2em;
|
font-size: 1.2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.offline-text {
|
.disconnected {
|
||||||
|
width: 13px;
|
||||||
|
margin-bottom: -1px;
|
||||||
|
position: absolute;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -294,10 +296,10 @@ export const BoardsContent = styled.div`
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.offline-text {
|
.disconnected {
|
||||||
font-size: 9px;
|
width: 13px;
|
||||||
color: red;
|
margin-top: 0px;
|
||||||
font-weight: 700;
|
position: absolute;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ const Home = () => {
|
|||||||
<OfflineIndicator
|
<OfflineIndicator
|
||||||
key={`offline-${index}`}
|
key={`offline-${index}`}
|
||||||
address={subscription}
|
address={subscription}
|
||||||
className="offline-text"
|
className="disconnected"
|
||||||
isText={true} />
|
isText={true} />
|
||||||
<br key={`br-${index}`} />
|
<br key={`br-${index}`} />
|
||||||
</Fragment>
|
</Fragment>
|
||||||
|
|||||||
Reference in New Issue
Block a user