feat: add node connecting status (#603)
This commit is contained in:
@@ -2,6 +2,7 @@ import { createStyles, makeStyles, Theme, Typography } from '@material-ui/core'
|
||||
import { ReactElement } from 'react'
|
||||
import Check from 'remixicon-react/CheckLineIcon'
|
||||
import AlertCircle from 'remixicon-react/ErrorWarningFillIcon'
|
||||
import Connecting from 'remixicon-react/LinksLineIcon'
|
||||
import RefreshLine from 'remixicon-react/RefreshLineIcon'
|
||||
import { SwarmButton, SwarmButtonProps } from './SwarmButton'
|
||||
|
||||
@@ -10,7 +11,7 @@ interface Props {
|
||||
title: string
|
||||
subtitle: string
|
||||
buttonProps: SwarmButtonProps
|
||||
status: 'ok' | 'error' | 'loading'
|
||||
status: 'ok' | 'error' | 'loading' | 'connecting'
|
||||
}
|
||||
|
||||
const useStyles = (backgroundColor: string) =>
|
||||
@@ -65,6 +66,8 @@ export default function Card({ buttonProps, icon, title, subtitle, status }: Pro
|
||||
statusIcon = <AlertCircle size="13" color="#f44336" />
|
||||
} else if (status === 'loading') {
|
||||
statusIcon = <RefreshLine size="13" color="orange" />
|
||||
} else if (status === 'connecting') {
|
||||
statusIcon = <Connecting size="13" color="#0074D9" />
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { ReactElement, useContext } from 'react'
|
||||
import { useLocation, matchPath } from 'react-router-dom'
|
||||
import { matchPath, useLocation } from 'react-router-dom'
|
||||
import ArrowRight from 'remixicon-react/ArrowRightLineIcon'
|
||||
|
||||
import { createStyles, Theme, makeStyles } from '@material-ui/core/styles'
|
||||
import { ListItemText, ListItemIcon, ListItem, Typography } from '@material-ui/core'
|
||||
import { ListItem, ListItemIcon, ListItemText, Typography } from '@material-ui/core'
|
||||
import { createStyles, makeStyles, Theme } from '@material-ui/core/styles'
|
||||
import { Context } from '../providers/Bee'
|
||||
import StatusIcon from './StatusIcon'
|
||||
|
||||
@@ -44,6 +44,7 @@ const useStyles = makeStyles((theme: Theme) =>
|
||||
},
|
||||
smallerText: {
|
||||
fontSize: '0.9rem',
|
||||
whiteSpace: 'nowrap',
|
||||
},
|
||||
}),
|
||||
)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { ReactElement } from 'react'
|
||||
import { CircularProgress } from '@material-ui/core'
|
||||
import type { ReactElement } from 'react'
|
||||
import { CheckState } from '../providers/Bee'
|
||||
|
||||
interface Props {
|
||||
@@ -28,6 +28,9 @@ export default function StatusIcon({ checkState, size, className, isLoading }: P
|
||||
case CheckState.STARTING:
|
||||
backgroundColor = 'orange'
|
||||
break
|
||||
case CheckState.CONNECTING:
|
||||
backgroundColor = '#0074D9'
|
||||
break
|
||||
default:
|
||||
// Default is error
|
||||
backgroundColor = '#ff3a52'
|
||||
|
||||
Reference in New Issue
Block a user