-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pci-db-analytics): rework modals (#14216)
ref: DATATR-1690 ref: DATATR-1695 ref: DATATR-1757 Signed-off-by: Jonathan Perchoc <[email protected]> Co-authored-by: CDS Translator Agent <[email protected]>
- Loading branch information
1 parent
a549c73
commit 6b29873
Showing
143 changed files
with
5,346 additions
and
3,669 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
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
53 changes: 53 additions & 0 deletions
53
packages/manager/apps/pci-databases-analytics/src/components/route-modal/RouteModal.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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { useNavigate } from 'react-router-dom'; | ||
import { | ||
Dialog, | ||
DialogContent, | ||
DialogDescription, | ||
DialogFooter, | ||
DialogHeader, | ||
} from '../ui/dialog'; | ||
import { Skeleton } from '../ui/skeleton'; | ||
|
||
interface RouteModalProps { | ||
backUrl?: string; | ||
isLoading?: boolean; | ||
children: React.ReactNode | React.ReactNode[]; | ||
} | ||
const RouteModal = ({ | ||
backUrl = '../', | ||
isLoading = false, | ||
children, | ||
}: RouteModalProps) => { | ||
const navigate = useNavigate(); | ||
const onOpenChange = (open: boolean) => { | ||
if (!open) navigate(backUrl); | ||
}; | ||
|
||
return ( | ||
<Dialog defaultOpen onOpenChange={onOpenChange}> | ||
{isLoading ? ( | ||
<DialogContent> | ||
<DialogHeader> | ||
<Skeleton className="w-3/5 h-5" /> | ||
</DialogHeader> | ||
<DialogDescription className="flex flex-col gap-2"> | ||
<Skeleton className="w-4/5 h-4" /> | ||
<Skeleton className="w-100 h-4" /> | ||
<Skeleton className="w-2/3 h-4" /> | ||
<Skeleton className="w-4/5 h-4" /> | ||
<Skeleton className="w-1/3 h-4" /> | ||
<Skeleton className="w-4/5 h-4" /> | ||
</DialogDescription> | ||
<DialogFooter className="flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 flex justify-end mt-2"> | ||
<Skeleton className="w-20 h-10" /> | ||
<Skeleton className="w-20 h-10" /> | ||
</DialogFooter> | ||
</DialogContent> | ||
) : ( | ||
children | ||
)} | ||
</Dialog> | ||
); | ||
}; | ||
|
||
export default RouteModal; |
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
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.