mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-14 06:28:52 +01:00
👁️ fix: Return Focus on My Files Modal Close (#11032)
* fix: focus returns to manage files button on modal close * refactor: remove atoms and re-use components instead * refactor: FilesView to MyFilesModal * chore: import styling * chore: delete file that was meant to be renamed * feat: add trigger ref for settings button as well
This commit is contained in:
parent
1f695e0cdc
commit
98294755ee
4 changed files with 33 additions and 14 deletions
|
|
@ -5,7 +5,15 @@ import { useGetFiles } from '~/data-provider';
|
|||
import { DataTable, columns } from './Table';
|
||||
import { useLocalize } from '~/hooks';
|
||||
|
||||
export default function Files({ open, onOpenChange }) {
|
||||
export function MyFilesModal({
|
||||
open,
|
||||
onOpenChange,
|
||||
triggerRef,
|
||||
}: {
|
||||
open: boolean;
|
||||
onOpenChange: (open: boolean) => void;
|
||||
triggerRef?: React.RefObject<HTMLButtonElement | HTMLDivElement | null>;
|
||||
}) {
|
||||
const localize = useLocalize();
|
||||
|
||||
const { data: files = [] } = useGetFiles<TFile[]>({
|
||||
|
|
@ -18,7 +26,7 @@ export default function Files({ open, onOpenChange }) {
|
|||
});
|
||||
|
||||
return (
|
||||
<OGDialog open={open} onOpenChange={onOpenChange}>
|
||||
<OGDialog open={open} onOpenChange={onOpenChange} triggerRef={triggerRef}>
|
||||
<OGDialogContent
|
||||
title={localize('com_nav_my_files')}
|
||||
className="w-11/12 bg-background text-text-primary shadow-2xl"
|
||||
Loading…
Add table
Add a link
Reference in a new issue