Skip to content

feat: add dropdown menu#97

Merged
wendyyuchensun merged 2 commits into
coseeing:mainfrom
wendyyuchensun:dropdown-menu
Mar 17, 2026
Merged

feat: add dropdown menu#97
wendyyuchensun merged 2 commits into
coseeing:mainfrom
wendyyuchensun:dropdown-menu

Conversation

@wendyyuchensun

@wendyyuchensun wendyyuchensun commented Mar 8, 2026

Copy link
Copy Markdown
Collaborator

Figma: https://www.figma.com/design/nAK7djdtFJ9vfXLo6Yq4r4/%E6%95%B8%E5%AD%B8%E5%85%AC%E5%BC%8F?node-id=905-3293&t=ouVD0DIIj0vtBUva-4

之後會用在 header 的「語言」、「更多」兩處,以及預覽區切換「白底黑字/黑底白字」。

@andy19910102 andy19910102 requested review from WendellLiu and removed request for WendellLiu March 11, 2026 14:25
Comment on lines +21 to +40
<a
href={item.href}
target="_blank"
rel="noopener noreferrer"
className={cn(
'block w-full px-3 py-2 text-sm leading-[1.4] text-text-primary text-left',
active ? 'bg-bg-main' : 'bg-white'
)}
>
<span>{item.label}</span>
</a>
) : (
<button
type="button"
onClick={item.onClick}
className={cn(
'w-full px-3 py-2 text-sm leading-[1.4] text-text-primary text-left',
active ? 'bg-bg-main' : 'bg-white'
)}
>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

a 的 className 比 button 多了 block,兩邊需要一至嗎~?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

這邊希望 dropdown 裡的每個 anchor/button 會占滿一行。

因為 anchor 原本預設的 display mode 是 inline,所以才加了 block 讓它可以占滿一行。

button 則是預設 display mode 是 inline-block,所以不需要改成 block,用了 w-full 後就會占滿一行 :)

@wendyyuchensun

Copy link
Copy Markdown
Collaborator Author

Thanks!

@wendyyuchensun wendyyuchensun merged commit 6143eef into coseeing:main Mar 17, 2026
1 check passed
@wendyyuchensun wendyyuchensun deleted the dropdown-menu branch March 17, 2026 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants