feat: remove the last update component (#179)

This commit is contained in:
Vojtech Simetka
2021-08-23 16:00:22 +02:00
committed by GitHub
parent 7f2ff39ec9
commit 56df3a2561
4 changed files with 3 additions and 41 deletions
-23
View File
@@ -1,23 +0,0 @@
import { ReactElement, useEffect, useState } from 'react'
interface Props {
date: number | null
}
export default function LastUpdate({ date }: Props): ReactElement {
const [duration, setDuration] = useState<string>('never')
const refresh = () => {
if (!date) setDuration('never')
else setDuration(`${((Date.now() - date) / 1000).toFixed()} seconds ago`)
}
useEffect(() => {
refresh()
const i = setInterval(refresh, 1000)
return () => clearInterval(i)
}, [date])
return <span>Last Update: {duration}</span>
}
-6
View File
@@ -9,8 +9,6 @@ import { Activity, FileText, DollarSign, Share2, Settings, Layers } from 'react-
import SwarmLogoOrange from '../assets/swarm-logo-orange.svg'
import { Health } from '@ethersphere/bee-js'
import LastUpdate from './LastUpdate'
const drawerWidth = 240
const navBarItems = [
@@ -87,7 +85,6 @@ interface Props extends RouteComponentProps {
themeMode: string
health: boolean
nodeHealth: Health | null
lastUpdate: number | null
}
export default function SideBar(props: Props): ReactElement {
@@ -170,9 +167,6 @@ export default function SideBar(props: Props): ReactElement {
<span>Debug API</span>
</div>
</ListItem>
<div style={{ width: '100%', textAlign: 'center' }}>
<LastUpdate date={props.lastUpdate} />
</div>
</div>
</Drawer>
</div>