-
Notifications
You must be signed in to change notification settings - Fork 6
project: Storybook audit #1337
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
base: develop
Are you sure you want to change the base?
project: Storybook audit #1337
Changes from 22 commits
b3461f9
864e757
49b6165
8ab9209
a0555d2
a57a856
63a82a4
8ac1ebd
333dbf7
b5288ad
e5f5757
f9f2d03
102a4d7
27a5b9b
3a1ca4b
fd5e894
98cfa26
72ab31f
9a559ef
61b5625
36494fc
22fd1d4
a892214
1bb82e5
a3ecadf
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,46 @@ | ||
| import { useCallback } from 'react'; | ||
| import { Breadcrumbs } from '@ifrc-go/ui'; | ||
|
|
||
| import Link, { type InternalLinkProps } from '../Link'; | ||
|
|
||
| interface RouteData { | ||
| to: InternalLinkProps['to']; | ||
| label: React.ReactNode; | ||
| urlParams?: Record<string, string | number | null | undefined>; | ||
| } | ||
|
|
||
| interface GoBreadcrumbsProps { | ||
| routeData: RouteData[]; | ||
| } | ||
|
|
||
| const keySelector = (datum: RouteData) => datum.to; | ||
| const labelSelector = (datum: RouteData) => datum.label; | ||
|
|
||
| function GoBreadcrumbs(props: GoBreadcrumbsProps) { | ||
| const { routeData } = props; | ||
|
|
||
| const rendererParams = useCallback((_: RouteData['to'], item: RouteData) | ||
| : InternalLinkProps => ( | ||
| { | ||
| to: item.to, | ||
| urlParams: item.urlParams, | ||
| } | ||
| ), []); | ||
|
|
||
| return ( | ||
| <Breadcrumbs | ||
| < | ||
| RouteData['to'], | ||
| RouteData, | ||
| (InternalLinkProps & { children: React.ReactNode }) | ||
| > | ||
| data={routeData} | ||
| keySelector={keySelector} | ||
| labelSelector={labelSelector} | ||
| renderer={Link} | ||
| rendererParams={rendererParams} | ||
| /> | ||
| ); | ||
| } | ||
|
|
||
| export default GoBreadcrumbs; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -188,6 +188,7 @@ function NavigationTab(props: Props) { | |
| )} | ||
| <div className={styles.childrenWrapper}> | ||
| {children} | ||
| <div className={styles.activeChildrenBorder} /> | ||
|
||
| </div> | ||
| {variant === 'primary' && ( | ||
| <div className={styles.dummy} /> | ||
|
|
||
|
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. Was this change required on the storybook audit? |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,7 @@ | ||
| .active-operation-map { | ||
| .filter-actions { | ||
| align-self: end; | ||
| } | ||
| .content { | ||
| position: relative; | ||
|
|
||
|
|
||
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.
I am not sure if changing how we use Breadcrums is a good change.
cc: @frozenhelium @samshara
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.
@tnagorra Can you propose a better alternative. The requirement is that we need to separately style the leaf link.
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.
Looks like the leaf link is already styled differently in current approach as well.
We can use this new approach if we want more flexibility.