Skip to content

Commit

Permalink
Restore UnsavedChangesWarningContent to roles edit page
Browse files Browse the repository at this point in the history
  • Loading branch information
DarksightKellar committed Dec 6, 2024
1 parent 5ed75bb commit 9f6b415
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion src/pages/dao/roles/edit/SafeRolesEditPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as amplitude from '@amplitude/analytics-browser';
import { Box, Button, Flex, Show } from '@chakra-ui/react';
import { Box, Button, Flex, Hide, Show } from '@chakra-ui/react';
import { Plus } from '@phosphor-icons/react';
import { useFormikContext } from 'formik';
import { useEffect, useState } from 'react';
Expand All @@ -9,7 +9,10 @@ import { Hex, toHex } from 'viem';
import { RoleCardEdit } from '../../../../components/Roles/RoleCard';
import { RoleCardLoading } from '../../../../components/Roles/RolePageCard';
import { RolesEditTable } from '../../../../components/Roles/RolesTable';
import DraggableDrawer from '../../../../components/ui/containers/DraggableDrawer';
import NoDataCard from '../../../../components/ui/containers/NoDataCard';
import { ModalBase } from '../../../../components/ui/modals/ModalBase';
import { UnsavedChangesWarningContent } from '../../../../components/ui/modals/UnsavedChangesWarningContent';
import PageHeader from '../../../../components/ui/page/Header/PageHeader';
import { DAO_ROUTES } from '../../../../constants/routes';
import { getRandomBytes } from '../../../../helpers';
Expand Down Expand Up @@ -51,6 +54,36 @@ export function SafeRolesEditPage() {

return (
<>
{blocker.state === 'blocked' && (
<>
<Hide above="md">
<DraggableDrawer
isOpen
onClose={() => {}}
onOpen={() => {}}
headerContent={null}
initialHeight="23rem"
closeOnOverlayClick={false}
>
<UnsavedChangesWarningContent
onDiscard={blocker.proceed}
onKeepEditing={blocker.reset}
/>
</DraggableDrawer>
</Hide>
<Hide below="md">
<ModalBase
isOpen
onClose={() => {}}
>
<UnsavedChangesWarningContent
onDiscard={blocker.proceed}
onKeepEditing={blocker.reset}
/>
</ModalBase>
</Hide>
</>
)}
<Box>
<PageHeader
title={t('roles')}
Expand Down

0 comments on commit 9f6b415

Please sign in to comment.