Adding minimum width to ellipsis text for mobile screens. Adding button to clear active tags filter.

This commit is contained in:
Roland 2023-11-04 15:57:13 -06:00
parent c4c39e0557
commit 00ab6401a0
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
6 changed files with 37 additions and 13 deletions

View file

@ -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 {

View file

@ -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 = <TagsGroup tagNames={localTags} onClick={removeTag}/>;
const unusedTags = _.difference(tagNames, localTags);
const unusedTagsGroup = <TagsGroup tagNames={unusedTags} onClick={addTag}/>;
@ -369,6 +387,7 @@ export function AddTagsButton({
</Grid.Column>
<Grid.Column width={8}>
<Button onClick={() => setOpen(false)} floated='right'>Close</Button>
<Button floated='right' secondary onClick={() => clearLocalTags()}>Clear</Button>
</Grid.Column>
</Grid.Row>
</Grid>

View file

@ -439,11 +439,11 @@ function ChannelPage({create, header}) {
</>
}
export function EditChannel(props) {
export function ChannelEditPage(props) {
return <ChannelPage header="Edit Channel" {...props}/>;
}
export function NewChannel(props) {
export function ChannelNewPage(props) {
useTitle('New Channel');
return <ChannelPage header='New Channel' {...props} create/>
}

View file

@ -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) {

View file

@ -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) {
<Route path='/' exact element={<VideosPage/>}/>
<Route path='channel' exact element={<ChannelsPage/>}/>
<Route path='statistics' exact element={<VideosStatistics/>}/>
<Route path='channel/new' exact element={<NewChannel/>}/>
<Route path='channel/:channelId/edit' exact element={<EditChannel/>}/>
<Route path='channel/new' exact element={<ChannelNewPage/>}/>
<Route path='channel/:channelId/edit' exact element={<ChannelEditPage/>}/>
<Route path='channel/:channelId/video' exact element={<VideosPage/>}/>
</Routes>
</PageContainer>

View file

@ -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 <Table unstackable className='table-ellipsis'>
return <Table className='table-ellipsis'>
<TableHeader>
<TableRow>
<TableHeaderCell width={8}>URL</TableHeaderCell>