Add badges to files

This commit is contained in:
Piotr Rogowski 2022-10-18 17:48:37 +02:00
parent 3c2836f3ef
commit 7303c0320b
No known key found for this signature in database
GPG Key ID: 4A842D702D9C6F8F
2 changed files with 11 additions and 3 deletions

View File

@ -13,6 +13,7 @@ import {
Space, Space,
Divider, Divider,
Typography, Typography,
Badge,
} from 'antd'; } from 'antd';
import { import {
FileTextOutlined, FileTextOutlined,
@ -43,12 +44,15 @@ import TriggerLogsParser, {
} from '../utils/logs/TriggerLogsParser'; } from '../utils/logs/TriggerLogsParser';
import ToothCanvas from '../components/TriggerLogs/ToothCanvas'; import ToothCanvas from '../components/TriggerLogs/ToothCanvas';
import Loader from '../components/Loader'; import Loader from '../components/Loader';
import { Colors } from '../utils/colors';
const { Content } = Layout; const { Content } = Layout;
const { Step } = Steps; const { Step } = Steps;
const edgeUnknown = 'Unknown'; const edgeUnknown = 'Unknown';
const badgeStyle = { backgroundColor: Colors.TEXT };
const mapStateToProps = (state: AppState) => ({ const mapStateToProps = (state: AppState) => ({
ui: state.ui, ui: state.ui,
status: state.status, status: state.status,
@ -152,7 +156,7 @@ const Diagnose = ({ ui, config, loadedLogs }: { ui: UIState, config: Config, loa
style={{ marginLeft: 20 }} style={{ marginLeft: 20 }}
items={[ items={[
{ {
label: <FileTextOutlined />, label: <><FileTextOutlined /><Badge size="small" style={badgeStyle} count={2} /></>,
key: 'files', key: 'files',
children: ( children: (
<PerfectScrollbar options={{ suppressScrollX: true }}> <PerfectScrollbar options={{ suppressScrollX: true }}>

View File

@ -13,6 +13,7 @@ import {
Steps, Steps,
Space, Space,
Divider, Divider,
Badge,
} from 'antd'; } from 'antd';
import { import {
FileTextOutlined, FileTextOutlined,
@ -50,6 +51,7 @@ import {
UIState, UIState,
} from '../types/state'; } from '../types/state';
import Loader from '../components/Loader'; import Loader from '../components/Loader';
import { Colors } from '../utils/colors';
const { Content } = Layout; const { Content } = Layout;
const { Step } = Steps; const { Step } = Steps;
@ -58,6 +60,8 @@ const margin = 30;
const sidebarWidth = 250; const sidebarWidth = 250;
const minCanvasHeightInner = 600; const minCanvasHeightInner = 600;
const badgeStyle = { backgroundColor: Colors.TEXT };
const mapStateToProps = (state: AppState) => ({ const mapStateToProps = (state: AppState) => ({
ui: state.ui, ui: state.ui,
tune: state.tune, tune: state.tune,
@ -226,7 +230,7 @@ const Logs = ({
style={{ marginLeft: 20 }} style={{ marginLeft: 20 }}
items={[ items={[
{ {
label: <EditOutlined />, label: <><EditOutlined /><Badge size="small" style={badgeStyle} count={fields.length} /></>,
key: 'fields', key: 'fields',
children: ( children: (
<> <>
@ -261,7 +265,7 @@ const Logs = ({
), ),
}, },
{ {
label: <FileTextOutlined />, label: <><FileTextOutlined /><Badge size="small" style={badgeStyle} count="1" /></>,
key: 'files', key: 'files',
children: ( children: (
<PerfectScrollbar options={{ suppressScrollX: true }}> <PerfectScrollbar options={{ suppressScrollX: true }}>