Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: add DropdownMenu component#15941

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
BrunoQuaresma merged 9 commits intomainfrombq/add-dropdown
Dec 20, 2024
Merged

chore: add DropdownMenu component#15941

BrunoQuaresma merged 9 commits intomainfrombq/add-dropdown
Dec 20, 2024

Conversation

BrunoQuaresma
Copy link
Collaborator

Related to#15617

};
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";

export {
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a preference to not place all exports at the bottom of the file.

BrunoQuaresma reacted with thumbs up emoji
@@ -0,0 +1,198 @@
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
import { Check, ChevronRight, Circle } from "lucide-react";
import * as React from "react";
Copy link
Contributor

Choose a reason for hiding this comment

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

I have been following the pattern of not using the * import for React for the other shadcn/ui components as we don't generally have this pattern in Coder

BrunoQuaresma reacted with thumbs up emoji
<DropdownMenuPrimitive.SubContent
ref={ref}
className={cn(
"z-50 min-w-[8rem] overflow-hidden rounded-md border border-solid bg-surface-primary p-1 text-content-secondary shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
Copy link
Contributor

Choose a reason for hiding this comment

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

For the other shadcn/ui components I have been converting very long classNames to multi line strings, roughly grouped by the general types of classes. This make it easier to read.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, we are not currently using the classname sorting

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

We should definitely usecn if we want to create extendable components. It really helps in figuring out class hierarchies and merging similar styles.

The function cn is a helper utility that makes it easier to handle className manipulation in a React + Tailwind environment, ensuring that classNames are appropriately merged and any conflicts are resolved, making the component styling more consistent and maintainable.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I meant the biome classname sorting that just sorts the order the utility classes appear in the code.

BrunoQuaresma reacted with thumbs up emoji
@@ -0,0 +1,53 @@
/**
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this comment should be on the component instead of the stories.tsx

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

Totally! Idk why I put it in the stories 🤦

Copy link
Contributor

@jaaydenhjaaydenh left a comment

Choose a reason for hiding this comment

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

Just let a few comments about the style to match how to the other shadcn components have been integrated. Otherwise looks good.

BrunoQuaresma reacted with thumbs up emoji
@BrunoQuaresmaBrunoQuaresma merged commit809c611 intomainDec 20, 2024
29 checks passed
@BrunoQuaresmaBrunoQuaresma deleted the bq/add-dropdown branchDecember 20, 2024 17:12
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsDec 20, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@jaaydenhjaaydenhjaaydenh approved these changes

Assignees

@BrunoQuaresmaBrunoQuaresma

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@BrunoQuaresma@jaaydenh

[8]ページ先頭

©2009-2025 Movatter.jp