-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Field service groups): update appearance of edit and delete modals
- Loading branch information
Showing
8 changed files
with
72 additions
and
39 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
1 change: 0 additions & 1 deletion
1
src/features/congregation/field_service_groups/group_delete/index.types.ts
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
export type GroupDeleteProps = { | ||
open: boolean; | ||
onClose: VoidFunction; | ||
index: number; | ||
group_id: string; | ||
|
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
1 change: 0 additions & 1 deletion
1
src/features/congregation/field_service_groups/group_edit/index.types.ts
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
38 changes: 38 additions & 0 deletions
38
src/features/congregation/field_service_groups/group_item/edit_delete_dialog/index.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,38 @@ | ||
import { useAppTranslation } from '@hooks/index'; | ||
import { EditDeleteDialogProps } from './index.types'; | ||
import Dialog from '@components/dialog'; | ||
import GroupEdit from '../../group_edit'; | ||
import GroupDelete from '../../group_delete'; | ||
|
||
const EditDeleteDialog = ({ | ||
group, | ||
index, | ||
onClose, | ||
onDelete, | ||
open, | ||
type, | ||
}: EditDeleteDialogProps) => { | ||
const { t } = useAppTranslation(); | ||
|
||
return ( | ||
<Dialog onClose={onClose} open={open} sx={{ padding: '24px' }}> | ||
{type === 'edit' && ( | ||
<GroupEdit | ||
group={group} | ||
index={index} | ||
onClose={onClose} | ||
onDelete={onDelete} | ||
/> | ||
)} | ||
{type === 'delete' && ( | ||
<GroupDelete | ||
group_id={group.group_id} | ||
index={index} | ||
onClose={onClose} | ||
/> | ||
)} | ||
</Dialog> | ||
); | ||
}; | ||
|
||
export default EditDeleteDialog; |
10 changes: 10 additions & 0 deletions
10
src/features/congregation/field_service_groups/group_item/edit_delete_dialog/index.types.ts
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,10 @@ | ||
import { FieldServiceGroupType } from '@definition/field_service_groups'; | ||
|
||
export type EditDeleteDialogProps = { | ||
open: boolean; | ||
onClose: VoidFunction; | ||
type: 'edit' | 'delete'; | ||
onDelete: VoidFunction; | ||
group: FieldServiceGroupType; | ||
index: number; | ||
}; |
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