forked from baron/baron-sso
fix(adminfront): prevent bulk import modal from unmounting when dropdown closes
Lifted the modal state out of the DropdownMenuContent to ensure the dialog does not unmount immediately when the dropdown item is clicked.
This commit is contained in:
@@ -146,6 +146,7 @@ function UserListPage() {
|
||||
React.useState("");
|
||||
const [sortConfig, setSortConfig] =
|
||||
React.useState<SortConfig<UserSortKey> | null>(null);
|
||||
const [bulkUploadOpen, setBulkUploadOpen] = React.useState(false);
|
||||
|
||||
const limit = 1000;
|
||||
const offset = (page - 1) * limit;
|
||||
@@ -513,10 +514,16 @@ function UserListPage() {
|
||||
{t("ui.admin.users.csv_template", "템플릿 다운로드")}
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuSeparator />
|
||||
<UserBulkUploadModal
|
||||
variant="dropdown"
|
||||
onSuccess={() => query.refetch()}
|
||||
/>
|
||||
<DropdownMenuItem
|
||||
onSelect={(e) => {
|
||||
e.preventDefault();
|
||||
setBulkUploadOpen(true);
|
||||
}}
|
||||
className="cursor-pointer"
|
||||
>
|
||||
<Upload size={16} className="mr-2 opacity-50" />
|
||||
{t("ui.admin.users.list.bulk_import", "일괄 등록 (CSV)")}
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuItem
|
||||
onClick={() => handleExport(false)}
|
||||
@@ -538,6 +545,12 @@ function UserListPage() {
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
<UserBulkUploadModal
|
||||
variant="custom"
|
||||
open={bulkUploadOpen}
|
||||
onOpenChange={setBulkUploadOpen}
|
||||
onSuccess={() => query.refetch()}
|
||||
/>
|
||||
<Dialog>
|
||||
<DialogTrigger asChild>
|
||||
<Button variant="outline" size="icon" className="h-9 w-9">
|
||||
|
||||
Reference in New Issue
Block a user