-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎨 style: bookmarks UI update (#3479)
* style: bookmarks update; style(Files): minor update * style: update conversation bookmarks * style: fix w TableCell
- Loading branch information
Showing
15 changed files
with
223 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 25 additions & 51 deletions
76
client/src/components/SidePanel/Bookmarks/BookmarkPanel.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,46 @@ | ||
import { BookmarkPlusIcon } from 'lucide-react'; | ||
import type { FC } from 'react'; | ||
import { useConversationTagsQuery, useRebuildConversationTagsMutation } from '~/data-provider'; | ||
import { Button, Dialog, DialogContent, DialogHeader, DialogTitle } from '~/components/ui'; | ||
import { Button } from '~/components/ui'; | ||
import { BookmarkContext } from '~/Providers/BookmarkContext'; | ||
import { BookmarkEditDialog } from '~/components/Bookmarks'; | ||
import BookmarkTable from './BookmarkTable'; | ||
import { Spinner } from '~/components/svg'; | ||
import { useLocalize } from '~/hooks'; | ||
import { cn } from '~/utils/'; | ||
import HoverCardSettings from '~/components/Nav/SettingsTabs/HoverCardSettings'; | ||
|
||
const BookmarkPanel: FC<{ open: boolean; onOpenChange: (open: boolean) => void }> = ({ | ||
open, | ||
onOpenChange, | ||
}) => { | ||
const BookmarkPanel = () => { | ||
const localize = useLocalize(); | ||
const { mutate, isLoading } = useRebuildConversationTagsMutation(); | ||
const { data } = useConversationTagsQuery(); | ||
const rebuildTags = () => { | ||
mutate({}); | ||
}; | ||
return ( | ||
<Dialog open={open} onOpenChange={onOpenChange}> | ||
<DialogContent | ||
showCloseButton={true} | ||
className={cn( | ||
'overflow-x-auto shadow-2xl dark:bg-gray-700 dark:text-white md:max-h-[600px] md:min-h-[373px] md:w-[680px]', | ||
)} | ||
> | ||
<DialogHeader> | ||
<DialogTitle className="text-lg font-medium leading-6 text-gray-900 dark:text-gray-200"> | ||
{localize('com_ui_bookmarks')} | ||
</DialogTitle> | ||
</DialogHeader> | ||
<BookmarkContext.Provider value={{ bookmarks: data || [] }}> | ||
<div className="p-0 sm:p-6 sm:pt-4"> | ||
<BookmarkTable /> | ||
<div className="mt-5 sm:mt-4" /> | ||
<div className="flex justify-between gap-2 pr-2 sm:pr-0"> | ||
<Button variant="outline" onClick={rebuildTags} className="text-sm"> | ||
{isLoading ? ( | ||
<Spinner /> | ||
) : ( | ||
<div className="flex gap-2"> | ||
{localize('com_ui_bookmarks_rebuild')} | ||
<HoverCardSettings side="bottom" text="com_nav_info_bookmarks_rebuild" /> | ||
</div> | ||
)} | ||
</Button> | ||
|
||
<div className="h-auto max-w-full overflow-x-hidden"> | ||
<BookmarkContext.Provider value={{ bookmarks: data || [] }}> | ||
<BookmarkTable /> | ||
<div className="flex justify-between gap-2"> | ||
<Button variant="outline" onClick={rebuildTags} className="w-50 text-sm"> | ||
{isLoading ? ( | ||
<Spinner /> | ||
) : ( | ||
<div className="flex gap-2"> | ||
<BookmarkEditDialog | ||
trigger={ | ||
<Button variant="outline" onClick={rebuildTags} className="text-sm"> | ||
<BookmarkPlusIcon className="mr-1 size-4" /> | ||
<div className="break-all">{localize('com_ui_bookmarks_new')}</div> | ||
</Button> | ||
} | ||
/> | ||
<Button variant="subtle" onClick={() => onOpenChange(!open)} className="text-sm"> | ||
{localize('com_ui_close')} | ||
</Button> | ||
{localize('com_ui_bookmarks_rebuild')} | ||
<HoverCardSettings side="top" text="com_nav_info_bookmarks_rebuild" /> | ||
</div> | ||
</div> | ||
</div> | ||
</BookmarkContext.Provider> | ||
</DialogContent> | ||
</Dialog> | ||
)} | ||
</Button> | ||
<BookmarkEditDialog | ||
trigger={ | ||
<Button variant="outline" onClick={rebuildTags} className="w-full text-sm"> | ||
<BookmarkPlusIcon className="mr-1 size-4" /> | ||
<div className="break-all">{localize('com_ui_bookmarks_new')}</div> | ||
</Button> | ||
} | ||
/> | ||
</div> | ||
</BookmarkContext.Provider> | ||
</div> | ||
); | ||
}; | ||
export default BookmarkPanel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.