From 00ab6401a067b28f2120cd433fe3278f8f8f6bff Mon Sep 17 00:00:00 2001 From: Roland Date: Sat, 4 Nov 2023 15:57:13 -0600 Subject: [PATCH] Adding minimum width to ellipsis text for mobile screens. Adding button to clear active tags filter. --- app/src/App.css | 2 +- app/src/Tags.js | 19 +++++++++++++++++++ app/src/components/Channels.js | 4 ++-- app/src/components/Common.js | 15 ++++++++++----- app/src/components/Videos.js | 6 +++--- app/src/components/admin/Downloads.js | 4 ++-- 6 files changed, 37 insertions(+), 13 deletions(-) diff --git a/app/src/App.css b/app/src/App.css index 373c0895..83ecefd5 100644 --- a/app/src/App.css +++ b/app/src/App.css @@ -214,7 +214,7 @@ textarea.otp { overflow: hidden; text-overflow: ellipsis; max-width: 0; /* Ensures the content doesn't exceed the cell's width */ - min-width: 0; /* Can be set to ensure a minimum width for your cells, if needed */ + min-width: 25em; /* About iPhone SE width */ } .card-title-ellipsis { diff --git a/app/src/Tags.js b/app/src/Tags.js index 5215540d..c0423b04 100644 --- a/app/src/Tags.js +++ b/app/src/Tags.js @@ -341,6 +341,24 @@ export function AddTagsButton({ } } + const clearLocalTags = () => { + if (!localTags || (localTags && localTags.length === 0)) { + console.debug('No tags to clear'); + return + } + + setLoading(true); + try { + for (let i = 0; i < localTags.length; i++) { + onRemove(localTags[i]); + } + setLocalTags([]); + onToggle([]); + } finally { + setLoading(false); + } + } + const selectedTagsGroup = ; const unusedTags = _.difference(tagNames, localTags); const unusedTagsGroup = ; @@ -369,6 +387,7 @@ export function AddTagsButton({ + diff --git a/app/src/components/Channels.js b/app/src/components/Channels.js index b8e3aa36..4a8514e3 100644 --- a/app/src/components/Channels.js +++ b/app/src/components/Channels.js @@ -439,11 +439,11 @@ function ChannelPage({create, header}) { } -export function EditChannel(props) { +export function ChannelEditPage(props) { return ; } -export function NewChannel(props) { +export function ChannelNewPage(props) { useTitle('New Channel'); return } diff --git a/app/src/components/Common.js b/app/src/components/Common.js index 99006e5c..7c5146da 100644 --- a/app/src/components/Common.js +++ b/app/src/components/Common.js @@ -263,7 +263,7 @@ const secondsToHours = 3600; const secondsToMinutes = 60; export function secondsToFullDuration(seconds) { - let s = ''; + let duration = ''; let years, days, hours, minutes; [years, seconds] = divmod(seconds, secondsToYears); @@ -271,17 +271,22 @@ export function secondsToFullDuration(seconds) { [hours, seconds] = divmod(seconds, secondsToHours); [minutes] = divmod(seconds, secondsToMinutes); if (years > 0) { - s = `${years}Y`; + duration = `${years}Y`; } if (days > 0) { - s = `${s} ${days}D`; + duration = `${duration} ${days}D`; } if (hours > 0 || minutes > 0) { hours = String(hours).padStart(2, '0'); minutes = String(minutes).padStart(2, '0'); - s = `${s} ${hours}:${minutes}`; + duration = `${duration} ${hours}:${minutes}`; } - return s; + if (years === 0 && days === 0 && hours === 0 && minutes === 0) { + // Less than a minute. + seconds = String(seconds).padStart(2, '0'); + duration = `00:00:${seconds}`; + } + return duration.trim(); } export function secondsToTimestamp(seconds) { diff --git a/app/src/components/Videos.js b/app/src/components/Videos.js index 7ce8d134..4bf6300b 100644 --- a/app/src/components/Videos.js +++ b/app/src/components/Videos.js @@ -38,7 +38,7 @@ import { StatisticValue, TableCell } from "semantic-ui-react"; -import {ChannelsPage, EditChannel, NewChannel} from "./Channels"; +import {ChannelsPage, ChannelEditPage, ChannelNewPage} from "./Channels"; import { useChannel, useQuery, @@ -287,8 +287,8 @@ export function VideosRoute(props) { }/> }/> }/> - }/> - }/> + }/> + }/> }/> diff --git a/app/src/components/admin/Downloads.js b/app/src/components/admin/Downloads.js index 9c1900d3..2b1fbb38 100644 --- a/app/src/components/admin/Downloads.js +++ b/app/src/components/admin/Downloads.js @@ -7,7 +7,6 @@ import { ErrorMessage, isoDatetimeToElapsedPopup, secondsToFrequency, - textEllipsis, useTitle, WROLModeMessage } from "../Common"; @@ -25,6 +24,7 @@ import { import {Button, Header, Modal, ModalActions, ModalContent, ModalHeader, Placeholder, Segment, Table} from "../Theme"; import {useDownloads} from "../../hooks/customHooks"; import {toast} from "react-semantic-toasts-2"; +import {Media} from "../../contexts/contexts"; function ClearCompleteDownloads({callback}) { async function localClearDownloads() { @@ -324,7 +324,7 @@ export function OnceDownloadsTable({downloads, fetchDownloads}) { export function RecurringDownloadsTable({downloads, fetchDownloads}) { if (downloads && downloads.length >= 1) { - return + return
URL