-
Notifications
You must be signed in to change notification settings - Fork 1
Breadcrumbの修正 #136
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
Breadcrumbの修正 #136
Changes from all commits
2f1f79d
909c625
d355a03
9559a19
732db68
ab8489d
5ac2dd3
e8932f3
f5dfd38
7963f98
eb9fa85
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,42 @@ | ||
| import React from "react"; | ||
| import figma from "@figma/code-connect"; | ||
| import { | ||
| Breadcrumb, | ||
| BreadcrumbList, | ||
| BreadcrumbItem, | ||
| BreadcrumbLink, | ||
| BreadcrumbSeparator, | ||
| BreadcrumbPage, | ||
| } from "./index"; | ||
|
|
||
| /** | ||
| * -- This file was auto-generated by Code Connect -- | ||
| * `props` includes a mapping from your code props to Figma properties. | ||
| * You should check this is correct, and update the `example` function | ||
| * to return the code example you'd like to see in Figma | ||
| */ | ||
|
|
||
| /** | ||
| * 基本的なBreadcrumbナビゲーション | ||
| * en: Basic breadcrumb navigation | ||
| */ | ||
| figma.connect( | ||
| "breadcrumb", | ||
| "https://www.figma.com/design/UMKFYVERnT3YM5Ht8bLJkf/-all-playground?node-id=2755-25149&t=nSzq9SKlxNkN6D14-4", | ||
| { | ||
| props: {}, | ||
| example: props => ( | ||
| <Breadcrumb> | ||
| <BreadcrumbList> | ||
| <BreadcrumbItem> | ||
| <BreadcrumbLink href="/">Home</BreadcrumbLink> | ||
| </BreadcrumbItem> | ||
| <BreadcrumbSeparator>/</BreadcrumbSeparator> | ||
| <BreadcrumbItem> | ||
| <BreadcrumbPage>Current Page</BreadcrumbPage> | ||
| </BreadcrumbItem> | ||
| </BreadcrumbList> | ||
| </Breadcrumb> | ||
| ), | ||
| } | ||
| ); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| import type { Meta, StoryObj } from "@storybook/react"; | ||
| import { action } from "@storybook/addon-actions"; | ||
| import { | ||
| Breadcrumb, | ||
| BreadcrumbList, | ||
|
|
@@ -11,6 +12,9 @@ import { | |
| const meta: Meta<typeof Breadcrumb> = { | ||
| title: "Components/Breadcrumb", | ||
| component: Breadcrumb, | ||
| subcomponents: { | ||
| BreadcrumbLink, | ||
| }, | ||
| parameters: { | ||
| layout: "centered", | ||
| }, | ||
|
|
@@ -26,15 +30,34 @@ export const Default: Story = { | |
| <Breadcrumb> | ||
| <BreadcrumbList> | ||
| <BreadcrumbItem> | ||
| <BreadcrumbLink href="/">Home</BreadcrumbLink> | ||
| <BreadcrumbLink | ||
| href="/" | ||
| onClick={e => { | ||
| e.preventDefault(); | ||
| action("breadcrumb link clicked")({ href: "/", label: "Home" }); | ||
| }} | ||
| > | ||
| Home | ||
| </BreadcrumbLink> | ||
| </BreadcrumbItem> | ||
| <BreadcrumbSeparator /> | ||
| <BreadcrumbItem> | ||
| <BreadcrumbLink href="/components">Components</BreadcrumbLink> | ||
|
Member
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. これはLinkコンポーネントも同様なのでうまくいったら横展開できればというところなんですが などをして実際の遷移をしないようにしておくと動作確認がしやすそうと思いました
Author
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.
Member
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. そこのコードはそもそもrender関数がそのまま出ちゃうので参考にだけしてあくまで綺麗なサンプルはドキュメントの方の使用例を見てもらう運用にする、で割と今のフォーマットのままいける気がするのでいいかと思いました🙆♂️ どうしても気になるようであればargsに定義できるようにしておいてそっちで指定したら出なくなるとかあるかも?ですね
Author
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. 対応しました! |
||
| <BreadcrumbLink | ||
| href="/link" | ||
| onClick={e => { | ||
| e.preventDefault(); | ||
| action("breadcrumb link clicked")({ | ||
| href: "/link", | ||
| label: "Link", | ||
| }); | ||
| }} | ||
| > | ||
| Link | ||
| </BreadcrumbLink> | ||
| </BreadcrumbItem> | ||
| <BreadcrumbSeparator /> | ||
| <BreadcrumbItem> | ||
| <BreadcrumbPage>Breadcrumb</BreadcrumbPage> | ||
| <BreadcrumbPage>Current Page</BreadcrumbPage> | ||
| </BreadcrumbItem> | ||
| </BreadcrumbList> | ||
| </Breadcrumb> | ||
|
|
||

Uh oh!
There was an error while loading. Please reload this page.