Skip to content

Commit

Permalink
Moved (again) share manager component to its own dedicated file
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianLeChat committed Feb 28, 2024
1 parent 36c6101 commit a930abe
Show file tree
Hide file tree
Showing 3 changed files with 238 additions and 216 deletions.
1 change: 1 addition & 0 deletions app/[locale]/dashboard/components/file-history.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export default function FileHistory( {
</DialogTrigger>

<DialogContent className="h-fit max-h-[calc(100%-2rem)] overflow-auto max-sm:max-w-[calc(100%-2rem)] md:max-h-[75%]">
{/* En-tête de la fenêtre modale */}
<DialogHeader>
<DialogTitle>
<History className="mr-2 inline h-5 w-5 align-text-top" />
Expand Down
40 changes: 5 additions & 35 deletions app/[locale]/dashboard/components/row-actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { Ban,
Trash,
UserX,
Globe,
Share2,
Loader2,
RefreshCw,
FolderLock,
Expand All @@ -34,12 +33,6 @@ import { deleteFile,
renameFile,
deleteSharedUser,
changeFileStatus } from "../actions";
import { Dialog,
DialogTitle,
DialogHeader,
DialogTrigger,
DialogContent,
DialogDescription } from "../../components/ui/dialog";
import { buttonVariants } from "../../components/ui/button";
import { DropdownMenu,
DropdownMenuItem,
Expand Down Expand Up @@ -488,34 +481,11 @@ export default function RowActions( {
<DropdownMenuSeparator />

{/* Gestion des partages */}
<Dialog>
<DialogTrigger asChild>
<DropdownMenuItem
// https://github.com/radix-ui/primitives/issues/1836#issuecomment-1674338372
disabled={!isFileOwner}
onSelect={( event ) => event.preventDefault()}
>
<Share2 className="mr-2 h-4 w-4" />
Gérer les partages
</DropdownMenuItem>
</DialogTrigger>

<DialogContent className="h-fit max-h-[calc(100%-2rem)] overflow-auto max-sm:max-w-[calc(100%-2rem)] md:max-h-[75%]">
<DialogHeader>
<DialogTitle>
<Share2 className="mr-2 inline h-5 w-5 align-text-top" />
Partage du fichier
</DialogTitle>

<DialogDescription>
Copier et partager le lien d&lsquo;accès aux
utilisateurs de votre choix.
</DialogDescription>
</DialogHeader>

<ShareManager file={dataFiles[ 0 ]} states={states} />
</DialogContent>
</Dialog>
<ShareManager
file={dataFiles[ 0 ]}
states={states}
disabled={!isFileOwner}
/>

{/* Suppression des partages */}
<AlertDialog>
Expand Down
Loading

0 comments on commit a930abe

Please sign in to comment.