Skip to content

Commit e3903e1

Browse files
committed
feat: refined new cache status view
Signed-off-by: Matt Gleich <git@mattglei.ch>
1 parent d294264 commit e3903e1

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

src/lib/time.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import advancedFormat from 'dayjs/plugin/advancedFormat';
66
dayjs.extend(duration);
77
dayjs.extend(advancedFormat);
88

9-
export function renderDate(date: Dayjs, now: Dayjs): string {
9+
export function renderDate(date: Dayjs, now: Dayjs, lowercaseDayOfWeek: boolean = false): string {
1010
const dayjsDate = dayjs(date);
1111
const yesterday = now.subtract(1, 'day');
1212
const tomorrow = now.add(1, 'day');
@@ -34,7 +34,9 @@ export function renderDate(date: Dayjs, now: Dayjs): string {
3434
dayOfWeek = dayjsDate.format('dddd, MMM Do');
3535
}
3636

37-
return dayjsDate.format(`[${dayOfWeek}] [at] h:mm A`);
37+
return dayjsDate.format(
38+
`[${lowercaseDayOfWeek ? dayOfWeek.toLowerCase() : dayOfWeek}] [at] h:mm A`
39+
);
3840
}
3941

4042
export function fromNow(date: Dayjs, currentTime: Dayjs): string {

src/lib/time/formatted-date.svelte

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,4 @@
2323
});
2424
</script>
2525

26-
{#if lowercase}
27-
{renderDate(dayjsTime, now).toLowerCase()} [{fromNow(dayjsTime, now).toLowerCase()}]
28-
{:else}
29-
{renderDate(dayjsTime, now)} [{fromNow(dayjsTime, now)}]
30-
{/if}
26+
{renderDate(dayjsTime, now, lowercase)} [{fromNow(dayjsTime, now)}]

src/routes/writing/lcp/cache-status.svelte

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,10 @@
6464
display: flex;
6565
align-items: center;
6666
padding: 4px 10px;
67+
height: fit-content;
6768
border-top: 0 !important;
6869
border-right: 0 !important;
69-
font-size: 14px;
70+
font-size: 13px;
7071
border-bottom-left-radius: var(--border-radius);
7172
}
7273
@@ -84,6 +85,7 @@
8485
8586
.refresh {
8687
padding: 20px 10px;
88+
padding-bottom: 15px;
8789
display: flex;
8890
gap: 10px;
8991
align-items: center;
@@ -101,7 +103,6 @@
101103
102104
.updated {
103105
color: grey;
104-
border-top: 1px solid var(--border);
105106
padding: 5px;
106107
display: flex;
107108
align-items: center;

0 commit comments

Comments
 (0)