Reworking empty-states for all pages and tables. Removing custom isEmpty in favor of lodash.

This commit is contained in:
Roland 2023-01-04 09:14:33 -07:00
parent 78aa6bfd1d
commit 0621cd184d
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
11 changed files with 82 additions and 87 deletions

View file

@ -3,7 +3,6 @@ import {clearCompletedDownloads, clearFailedDownloads, deleteDownload, killDownl
import {Link} from "react-router-dom";
import {
DisableDownloadsToggle,
isEmpty,
isoDatetimeToElapsedPopup,
secondsToFrequency,
textEllipsis,
@ -22,9 +21,10 @@ import {
TableHeaderCell,
TableRow
} from "semantic-ui-react";
import {Button, Header, Placeholder, Table} from "../Theme";
import {Button, Header, Placeholder, Segment, Table} from "../Theme";
import {ThemeContext} from "../../contexts/contexts";
import {useDownloads} from "../../hooks/customHooks";
import _ from "lodash";
function ClearCompleteDownloads({callback}) {
const [disabled, setDisabled] = React.useState(false);
@ -345,8 +345,8 @@ export function Downloads() {
);
let onceTable = tablePlaceholder;
if (isEmpty(onceDownloads)) {
onceTable = <p {...t}>No downloads are scheduled.</p>
if (_.isEmpty(onceDownloads)) {
onceTable = <Segment>No downloads are scheduled.</Segment>
} else if (onceDownloads) {
onceTable = (
<>
@ -364,8 +364,8 @@ export function Downloads() {
}
let recurringTable = tablePlaceholder;
if (isEmpty(recurringDownloads)) {
recurringTable = <p {...t}>No recurring downloads are scheduled.</p>
if (_.isEmpty(recurringDownloads)) {
recurringTable = <Segment>No recurring downloads are scheduled.</Segment>
} else if (recurringDownloads) {
recurringTable = <Table>
{nonStoppableHeader}