Skip to content

Commit 79b70dd

Browse files
committed
Improve layout markup
1 parent d596cf5 commit 79b70dd

File tree

3 files changed

+13
-27
lines changed

3 files changed

+13
-27
lines changed

src/renderer/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ function App(): JSX.Element {
124124
window.addEventListener('resize', updateWindowState)
125125

126126
return () => {
127-
window.removeEventListener("resize", updateWindowState)
127+
window.removeEventListener('resize', updateWindowState)
128128
}
129129
}, [isSidebarOpen])
130130

@@ -371,7 +371,7 @@ function App(): JSX.Element {
371371
<div className="codicon codicon-note"></div>
372372
</Button>
373373
</DrawerTrigger>
374-
<DrawerContent className="w-4/12 h-full rounded-none py-3">
374+
<DrawerContent className="w-6/12 md:w-4/12 lg:max-2xl:w-3/12 h-full rounded-none py-3">
375375
<div className="flex flex-col h-full space-y-4">
376376
<div className="px-3">
377377
<div className="flex items-center w-full">

src/renderer/src/components/note-card.tsx

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -163,33 +163,19 @@ function NoteCard({ note, onClick, onNoteCardSetName, onDeleteNote }): JSX.Eleme
163163
)}
164164
</div>
165165

166-
<div className="flex flex-col w-full">
167-
<div className="grid grid-rows-1 grid-cols-3 space-x-1 justify-start text-muted-foreground text-xs">
168-
<div className="text-nowrap truncate">
169-
<div className="flex">
170-
<div>{t('createdAt')}</div>
171-
<div className="grow text-right">:</div>
172-
</div>
173-
</div>
174-
<div
175-
className="col-span-2 text-nowrap truncate font-mono"
176-
title={formatToISO8601(note.createdAt)}
177-
>
166+
<div className="grid grid-cols-1 sm:grid-cols-[min-content_min-content_1fr] gap-x-0.5 text-muted-foreground text-xs">
167+
<div className="grid grid-cols-subgrid col-span-full">
168+
<div className="text-nowrap truncate">{t('createdAt')}</div>
169+
<div className="hidden sm:block">:</div>
170+
<div className="text-nowrap truncate font-mono" title={formatToISO8601(note.createdAt)}>
178171
{formatToRecent(note.createdAt)}
179172
</div>
180173
</div>
181-
<div className="grid grid-rows-1 grid-cols-3 space-x-1 justify-start text-muted-foreground text-xs">
182-
<div className="text-nowrap truncate">
183-
<div className="flex">
184-
<div>{t('updatedAt')}</div>
185-
<div className="grow text-right">:</div>
186-
</div>
187-
</div>
188-
<div
189-
className="col-span-2 text-nowrap truncate font-mono"
190-
title={formatToISO8601(note.updatedAt)}
191-
>
192-
{formatToRecent(note.updatedAt)}
174+
<div className="grid grid-cols-subgrid col-span-full">
175+
<div className="text-nowrap truncate">{t('updatedAt')}</div>
176+
<div className="hidden sm:block">:</div>
177+
<div className="text-nowrap truncate font-mono" title={formatToISO8601(note.createdAt)}>
178+
{formatToRecent(note.createdAt)}
193179
</div>
194180
</div>
195181
</div>

src/renderer/src/lib/formatDateTime.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { format, formatISO, isSameDay, isSameYear } from 'date-fns'
1+
import { format, formatISO, isSameDay } from 'date-fns'
22

33
export const formatToISO8601 = (dateTimeMilliSeconds: number | undefined) => {
44
if (dateTimeMilliSeconds == null) {

0 commit comments

Comments
 (0)