mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-04 13:49:57 -05:00
Using grey color by default for some Semantic elements when no color is provided.
This commit is contained in:
parent
335ad7ceb0
commit
d82b7c12fb
6 changed files with 143 additions and 138 deletions
|
|
@ -1,11 +1,11 @@
|
|||
import React, {useContext, useEffect, useState} from "react";
|
||||
import {Card, Container, Image, Input, Pagination, Popup, Responsive, TableCell, TableRow} from 'semantic-ui-react';
|
||||
import {Card, Container, Image, Input, Pagination, Responsive, TableCell, TableRow} from 'semantic-ui-react';
|
||||
import {Link, NavLink} from "react-router-dom";
|
||||
import Message from "semantic-ui-react/dist/commonjs/collections/Message";
|
||||
import {useDownloaders, useHotspot, useThrottle} from "../hooks/customHooks";
|
||||
import {getSettings} from "../api";
|
||||
import {darkTheme, SettingsContext, ThemeContext} from "../contexts/contexts";
|
||||
import {Button, CardIcon, Form, Header, Icon, Menu, Statistic} from "./Theme";
|
||||
import {Button, CardIcon, Form, Header, Icon, Menu, Popup, Statistic} from "./Theme";
|
||||
|
||||
export const API_URI = `http://${window.location.host}/api`;
|
||||
export const VIDEOS_API = `${API_URI}/videos`;
|
||||
|
|
@ -835,17 +835,15 @@ export function FileIcon({file, disabled = true, size = 'huge', ...props}) {
|
|||
}
|
||||
|
||||
export function LoadStatistic({label, value, cores, ...props}) {
|
||||
let color;
|
||||
const quarter = cores / 4;
|
||||
if (cores && value >= (quarter * 3)) {
|
||||
color = 'red';
|
||||
props['color'] = 'red';
|
||||
} else if (cores && value >= (quarter * 2)) {
|
||||
color = 'orange';
|
||||
props['color'] = 'orange';
|
||||
}
|
||||
return <Statistic
|
||||
label={label}
|
||||
value={value ? parseFloat(value).toFixed(1) : '?'}
|
||||
color={color}
|
||||
{...props}/>;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue