-
Notifications
You must be signed in to change notification settings - Fork 528
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
feat(panel): smoother accessing of widgetRenderState #4558
Changes from all commits
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 |
---|---|---|
|
@@ -151,11 +151,13 @@ storiesOf('Basics/Panel', module) | |
withHits( | ||
({ search, container }) => { | ||
const breadcrumbInPanel = panel<typeof breadcrumb>({ | ||
collapsed({ widgetRenderState }) { | ||
return widgetRenderState.canRefine; | ||
collapsed({ canRefine }) { | ||
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. This usage is much better and eventually what we want to enable in next major version so if there can't be collision with the IS instance (which is also passed and spread) that's great! 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. Yeah, I didn't realize there cannot be collision. This looks so much better. 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. as far as I can tell there's no collision here, so this doesn't even need a major :) 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. Yeah, it makes sense there is no collision :) |
||
return canRefine === false; | ||
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. your example used to be wrong |
||
}, | ||
templates: { | ||
header: 'Collapsible panel', | ||
header({ canRefine }) { | ||
return `Breadcrumb that can${canRefine ? '' : "'t "} refine`; | ||
}, | ||
footer: | ||
'The panel collapses if it cannot refine. Click "Home". This panel will collapse and you will not see this footer anymore.', | ||
}, | ||
|
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.
didn't know about
infer
. looks nice 👍