Skip to content
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

Refactor: restructure component layers for kebab button on groupcard #389

Conversation

ShoeheyOt
Copy link
Member

@ShoeheyOt ShoeheyOt commented Apr 1, 2024

Overview

This PR is for refactoring, changing structure

Changes

The below 2 diagrams are comparison of how I changed component structure.
Before

graph TD;
GroupCard --> GroupCardContent;
GroupCardContent --> RenameGroupForm & Card;
Card --> GroupCardDropdownMenuTriggerButton;
GroupCardDropdownMenuTriggerButton --> DropdownMenu;
DropdownMenu --> GroupCardDropdownMenuContent;
GroupCardDropdownMenuContent --> DropdownMenuContent;
DropdownMenuContent --> DeleteGroupDialogTriggerButton;
DeleteGroupDialogTriggerButton --> DialogRoot;
DialogRoot --> DeleteGroupDialogContent;
Loading

After

graph TD;
GroupCard --> GroupCardContent;
GroupCardContent --> RenameGroupForm & Card;
Card --> GroupCardDropdownMenu;
GroupCardDropdownMenu --> DropdownMenu & DialogRoot;
DropdownMenu --> GroupCardDropdownMenuContent;
DialogRoot --> DeleteGroupDialogContent
Loading

Screen Captures

screen-capture.webm

Assignee Checklist:

  • The naming convention of the PR title is correct (See the comment at the top of this template)
  • The base branch is correct (See: Types of Branches)
  • The branch name follows the Branch Naming Conventions
  • The correct assignees and reviewers have been designated for this PR
  • The coding style follows the Coding Style Guide
  • All the related issues are associated with this PR
  • All criteria in the associated issues are met (please tick the checkboxes)
  • My changes do not generate new warnings or errors (especially in the console)

Reviewer Checklist:

  • Double-check the "Assignee Checklist"
  • The code follows the generic best practices and our Coding Style Guide
  • The code is well-commented and easy to understand
  • The UI changes accurately reflect the provided design

@ShoeheyOt ShoeheyOt self-assigned this Apr 1, 2024
@ShoeheyOt ShoeheyOt linked an issue Apr 1, 2024 that may be closed by this pull request
@ShoeheyOt ShoeheyOt marked this pull request as ready for review April 1, 2024 21:38
Copy link
Member

@nick-y-ito nick-y-ito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ShoeheyOt
Thank you for your work and for clarifying the structure with Mermaid. And, I am sorry for my late review.

I suppose some tiny adjustments might be needed. Please take a look at the comments.

containerCount: number;
/**
* a number of user who belongs to a group
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The ID (identifier) of ...
  • The number of ...

}: IGroupCardDropdownMenuContentProps) => {
return (
<DropdownMenuContent>
<DropdownMenuItem>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

asChild should be added so we can remove the unnecessary div and manipulate it only with the keyboard.

Do you mind fixing the ones on the profile page as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nick-y-ito Thank you for your review! as we dicussed in person, I leave fixing ones on the profile page and make an another issue.

const [isDropdownMenuOpen, setIsDropdownMenuOpen] = useState(false);
const [isDeleteGroupDialogOpen, setIsDeleteGroupDialogOpen] = useState(false);

const kebabRef = useAutoFocus<HTMLButtonElement>(!isDeleteGroupDialogOpen && !isRenameFormOpen);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for adding this!

Copy link
Member

@nick-y-ito nick-y-ito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ShoeheyOt
Thank you for updating! LGTM :)

@ShoeheyOt ShoeheyOt merged commit eff0cde into develop Apr 6, 2024
5 checks passed
@ShoeheyOt ShoeheyOt deleted the refactor/385-restructure-component-layers-for-kebab-button-on-groupcard branch April 6, 2024 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Restructure component layers for Kebab button on GroupCard
2 participants