@@ -47,7 +47,6 @@ import { getTime } from 'date-fns'
4747import { Trans , useTranslation } from 'react-i18next'
4848import i18n from './i18n/configs'
4949import { Drawer , DrawerContent , DrawerTrigger } from './components/ui/drawer'
50- import LogoImg from './assets/leavepad_logo.svg'
5150
5251initializeNoteEditor ( )
5352
@@ -245,7 +244,7 @@ function App(): JSX.Element {
245244 if ( currentSearchValue != null && currentSearchValue != '' ) {
246245 const regex = new RegExp ( currentSearchValue )
247246 return notes . filter ( ( note ) => {
248- return regex . test ( note . name )
247+ return regex . test ( note . name ) || regex . test ( note . body )
249248 } )
250249 }
251250
@@ -275,35 +274,22 @@ function App(): JSX.Element {
275274 >
276275 < div
277276 className = { cn (
278- 'flex flex-col h-screen space-y-2' ,
277+ 'flex flex-col h-screen space-y-2 relative ' ,
279278 isSidebarOpen === true ? 'w-3/12 xl:w-2/12' : ''
280279 ) }
281280 >
282- < div className = "mt-2" >
283- { isSidebarOpen === true ? (
284- < Button
285- variant = "ghost"
286- className = "w-full flex items-center justify-start space-x-2 rounded-none"
287- onClick = { onClickSidebarMinimize }
288- >
289- < div className = "min-w-8 w-8 min-h-8 h-8" >
290- < img src = { LogoImg } />
291- </ div >
292- < div className = "grow text-left" > Leavepad</ div >
293- < div className = "codicon codicon-chevron-left" > </ div >
294- </ Button >
281+ < Button
282+ className = { cn ( 'absolute left-[100%] top-[50%] -ml-3 w-7 h-7 z-10' ) }
283+ variant = "outline"
284+ size = "icon"
285+ onClick = { onClickSidebarMinimize }
286+ >
287+ { isSidebarOpen ? (
288+ < span className = "codicon codicon-chevron-left" > </ span >
295289 ) : (
296- < Button
297- variant = "ghost"
298- className = "w-full flex items-center justify-start space-x-2 rounded-none"
299- onClick = { onClickSidebarMinimize }
300- >
301- < div className = "codicon codicon-chevron-right w-full" > </ div >
302- </ Button >
290+ < span className = "codicon codicon-chevron-right" > </ span >
303291 ) }
304- </ div >
305-
306- < Separator />
292+ </ Button >
307293
308294 < div className = "px-2" >
309295 < Button
@@ -338,7 +324,7 @@ function App(): JSX.Element {
338324 { isSidebarOpen === true ? (
339325 < div className = "px-2" >
340326 < Input
341- placeholder = { t ( 'searchByNoteName ' ) }
327+ placeholder = { t ( 'searchByNoteNameOrNoteBody ' ) }
342328 defaultValue = { currentSearchValue }
343329 onChange = { ( e ) => setCurrentSearchValue ( e . target . value ) }
344330 />
@@ -365,14 +351,34 @@ function App(): JSX.Element {
365351 </ div >
366352 </ ScrollArea >
367353 ) : (
368- < Drawer direction = "left" open = { isDrawerOpen } onOpenChange = { setDrawerOpen } >
354+ < Drawer
355+ direction = "left"
356+ open = { isDrawerOpen }
357+ onOpenChange = { setDrawerOpen }
358+ dismissible = { false }
359+ >
369360 < DrawerTrigger asChild >
370361 < Button className = { cn ( isSidebarOpen === false && 'p-2 h-8' ) } >
371- < div className = "codicon codicon-note" > </ div >
362+ < div
363+ className = "codicon codicon-note"
364+ onClick = { ( ) => setDrawerOpen ( false ) }
365+ > </ div >
372366 </ Button >
373367 </ DrawerTrigger >
374368 < DrawerContent className = "w-6/12 md:w-4/12 lg:max-2xl:w-3/12 h-full rounded-none py-3" >
375369 < div className = "flex flex-col h-full space-y-4" >
370+ < div className = "px-3" >
371+ < div className = "flex items-center w-full" >
372+ < Button
373+ className = "w-full items-center justify-start"
374+ onClick = { ( ) => setDrawerOpen ( false ) }
375+ >
376+ < span className = "codicon codicon-close" > </ span >
377+ < span > { t ( 'close' ) } </ span >
378+ </ Button >
379+ </ div >
380+ </ div >
381+
376382 < div className = "px-3" >
377383 < div className = "flex items-center w-full" >
378384 < div className = "grow" >
0 commit comments