mirror of
https://github.com/bulwarkmail/native.git
synced 2026-11-01 16:05:39 +00:00
fix: say what an empty folder list or a finished task is on the widgets #52
Folder counts showed only its "Folders" heading when there was no folder to list, which looks broken; it now says there are no folders to show. A finished task past its due date still read "Overdue" on the Tasks widget; it shows its date instead.
This commit is contained in:
@@ -1282,6 +1282,7 @@
|
||||
"in_outbox_short": "{count} waiting",
|
||||
"inbox": "Inbox",
|
||||
"more_unread": "+{count} more unread",
|
||||
"no_folders": "No folders to show",
|
||||
"no_starred": "No starred mail",
|
||||
"no_starred_body": "Star a message to keep it here.",
|
||||
"no_subject": "(no subject)",
|
||||
|
||||
@@ -250,6 +250,13 @@ export const FolderCountsLayout: Layout = ({ s, p, f, height }) => {
|
||||
const count = role === 'drafts' ? folder.total : folder.unread;
|
||||
rows.push({ role, name: folder.name, count, strong: role !== 'drafts' && folder.unread > 0 });
|
||||
}
|
||||
if (rows.length === 0) {
|
||||
return (
|
||||
<Surface p={p}>
|
||||
<Placeholder p={p} iconName="inbox" title={f.t('widgets.mail.no_folders', 'No folders to show')} click={open(links.inbox())} />
|
||||
</Surface>
|
||||
);
|
||||
}
|
||||
const fit = Math.max(1, Math.floor((height - 40) / 31));
|
||||
const colors: Record<FolderCount['role'], string> = {
|
||||
inbox: p.folder.inbox,
|
||||
|
||||
@@ -206,7 +206,9 @@ export function TaskRow({
|
||||
now: number;
|
||||
last?: boolean;
|
||||
}) {
|
||||
const kind = dueKind(task, now);
|
||||
// A finished task is not overdue: it shows its date.
|
||||
const due = dueKind(task, now);
|
||||
const kind = task.done && due === 'overdue' ? 'later' : due;
|
||||
const dueColor = task.done
|
||||
? p.muted
|
||||
: kind === 'overdue'
|
||||
|
||||
Reference in New Issue
Block a user