-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: implement DeleteGroupDialog #248
Changes from 1 commit
9849cc3
d12a2d2
b40824e
ef85449
9c5e7d2
00e3444
0e04270
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { | ||
Button, | ||
DialogBody, | ||
DialogClose, | ||
DialogContent, | ||
DialogFooter, | ||
DialogHeader, | ||
DialogTitle, | ||
} from '@/components/ui'; | ||
|
||
import React from 'react'; | ||
|
||
export const DeleteGroupConfirmDialogContent = () => { | ||
return ( | ||
<DialogContent> | ||
<DialogHeader> | ||
<DialogTitle>Delete Group</DialogTitle> | ||
</DialogHeader> | ||
<DialogBody> | ||
<p>Are you sure you want to delete group?</p> | ||
</DialogBody> | ||
<DialogFooter> | ||
<DialogClose asChild> | ||
<Button variant="cancel" size="sm"> | ||
Cancel | ||
</Button> | ||
</DialogClose> | ||
<Button | ||
variant="error" | ||
size="sm" | ||
onClick={() => { | ||
alert('delete'); | ||
}} | ||
> | ||
Delete | ||
</Button> | ||
</DialogFooter> | ||
</DialogContent> | ||
); | ||
}; |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file has changed just because I removed I did the change only to this file for now because the file was in this PR's scope. Maybe I'll refactor rest of |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
'use client'; | ||
import { MenuKebabIcon } from '@/assets/images/icons'; | ||
import { Button, DropdownMenu, DropdownMenuTrigger, Icon } from '@/components/ui'; | ||
import { Button, DialogRoot, DropdownMenu, DropdownMenuTrigger, Icon } from '@/components/ui'; | ||
|
||
import { FC } from 'react'; | ||
|
||
import { DeleteGroupConfirmDialogContent } from './DeleteGroupConfirmDialogContent'; | ||
import { GroupCardDropdownMenuContent } from './GroupCardDropdownMenuContent'; | ||
|
||
interface IGroupCardMenuButtonProps { | ||
|
@@ -14,13 +15,17 @@ export const GroupCardDropdownMenuTriggerButton: FC<IGroupCardMenuButtonProps> = | |
handleRenameClick, | ||
}) => { | ||
return ( | ||
<DropdownMenu> | ||
<DropdownMenuTrigger asChild> | ||
<Button variant="ghost" className="w-12"> | ||
<Icon icon={MenuKebabIcon} size={4.5} /> | ||
</Button> | ||
</DropdownMenuTrigger> | ||
<GroupCardDropdownMenuContent handleRenameClick={handleRenameClick} /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because I separated ( The directory structure itself is reasonable one tho, let me know if you feel we have to do something for this props drilling. I personally chose to keep this directory structure for now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I agree. I think it's acceptable for now. |
||
</DropdownMenu> | ||
// Wrapping dialog menu with DialogRoot. Trigger is in GroupCarDropdownMenuContent | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm sorry, but could you please clarify this comment? It's a bit difficult to understand what it's trying to say. I could be like the following if my understanding is correct:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This issue was addressed by adjusting |
||
<DialogRoot> | ||
<DropdownMenu> | ||
<DropdownMenuTrigger asChild> | ||
<Button variant="ghost" className="w-12"> | ||
<Icon icon={MenuKebabIcon} size={4.5} /> | ||
</Button> | ||
</DropdownMenuTrigger> | ||
<GroupCardDropdownMenuContent handleRenameClick={handleRenameClick} /> | ||
</DropdownMenu> | ||
<DeleteGroupConfirmDialogContent /> | ||
</DialogRoot> | ||
); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my perspective, naming this component
DeleteGroupDialogContent
(without "confirmation") is understandable enough. The nameDeleteGroupConfirmDialogContent
sounds to me like a "second" dialog to confirm the deletion. You can decide it. However, since our design has multiple delete dialogs, we should prioritize consistency across the project. You can decide :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed the file name to
DeleteGroupDialog
!