revert offline text

This commit is contained in:
Tom
2023-05-29 18:30:09 +02:00
parent c27a778e73
commit c0155b026a
3 changed files with 20 additions and 25 deletions
+11 -18
View File
@@ -1,30 +1,23 @@
import React from "react";
import { useSubplebbit } from "@plebbit/plebbit-react-hooks";
const OfflineIndicator = ({ address, className, tooltipPlace, isText }) => {
const OfflineIndicator = ({ address, className, tooltipPlace }) => {
const subplebbit = useSubplebbit({ subplebbitAddress: address });
const isOnline = subplebbit.updatedAt > Date.now() / 1000 - 60 * 20;
const isOnline = false;
return (
<>
{!isOnline && (
<>
{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}
/>
)}
{" "}
<img
className={className}
alt="offline"
src="assets/offline.png"
data-tooltip-id="tooltip"
data-tooltip-content="Offline"
data-tooltip-place={tooltipPlace}
/>
</>
)}
</>
+8 -6
View File
@@ -284,8 +284,10 @@ export const BoardsContent = styled.div`
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;
}
.offline-text {
font-size: 9px;
color: red;
font-weight: 700;
.disconnected {
width: 13px;
margin-top: 0px;
position: absolute;
}
}
+1 -1
View File
@@ -124,7 +124,7 @@ const Home = () => {
<OfflineIndicator
key={`offline-${index}`}
address={subscription}
className="offline-text"
className="disconnected"
isText={true} />
<br key={`br-${index}`} />
</Fragment>