-
Notifications
You must be signed in to change notification settings - Fork 461
Component: Button Migration 3: IconTextButton #7603
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
Changes from all commits
d420b9b
71a8a08
d0ca40e
794feb4
26267e5
f2d32ed
e49e8a7
3d65d85
ee1c577
ab35d35
7c52b41
e772bff
6fd35b5
c1b3455
fa2b153
109e3b1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| import type { Meta, StoryObj } from '@storybook/vue3-vite' | ||
|
|
||
| import IconTextButton from './IconTextButton.vue' | ||
| import Button from '@/components/ui/button/Button.vue' | ||
| import MoreButton from './MoreButton.vue' | ||
|
|
||
| const meta: Meta<typeof MoreButton> = { | ||
|
|
@@ -17,30 +17,26 @@ type Story = StoryObj<typeof MoreButton> | |
|
|
||
| export const Basic: Story = { | ||
| render: () => ({ | ||
| components: { MoreButton, IconTextButton }, | ||
| components: { MoreButton, Button }, | ||
| template: ` | ||
| <div style="height: 200px; display: flex; align-items: center; justify-content: center;"> | ||
| <MoreButton> | ||
| <template #default="{ close }"> | ||
| <IconTextButton | ||
| type="transparent" | ||
| label="Settings" | ||
| <Button | ||
| variant="textonly" | ||
| @click="() => { close() }" | ||
| > | ||
| <template #icon> | ||
| <i class="icon-[lucide--download] size-4" /> | ||
| </template> | ||
| </IconTextButton> | ||
| <i class="icon-[lucide--download] size-4" /> | ||
| <span>Settings</span> | ||
|
Contributor
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. 🧹 Nitpick | 🔵 Trivial Consider using i18n for string literals. While this is a Storybook story for demonstration, the coding guidelines specify using vue-i18n for all UI strings in As per coding guidelines, all UI strings should use i18n translation keys. Also applies to: 38-38 🤖 Prompt for AI Agents |
||
| </Button> | ||
|
|
||
| <IconTextButton | ||
| type="transparent" | ||
| label="Profile" | ||
| <Button | ||
| variant="textonly" | ||
| @click="() => { close() }" | ||
| > | ||
| <template #icon> | ||
| <i class="icon-[lucide--scroll-text] size-4" /> | ||
| </template> | ||
| </IconTextButton> | ||
| <i class="icon-[lucide--scroll-text] size-4" /> | ||
| <span>Profile</span> | ||
| </Button> | ||
| </template> | ||
| </MoreButton> | ||
| </div> | ||
|
|
||
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.
🧹 Nitpick | 🔵 Trivial
Simplify click handlers.
The arrow function wrappers are unnecessary since
closeis already a function. You can pass it directly.🔎 Proposed simplification
Apply the same change on both lines 27 and 35.
Also applies to: 35-35
🤖 Prompt for AI Agents