-
Notifications
You must be signed in to change notification settings - Fork 64
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
LG-4620: ChartCard
and Header
components
#2550
Conversation
This reverts commit 215c193.
🦋 Changeset detectedLatest commit: 78c8b34 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Size Change: +2.07 kB (+0.15%) Total Size: 1.39 MB
ℹ️ View Unchanged
|
| `onChartReady` | Callback to be called when chart is finished rendering. | () => void | | | ||
| Name | Description | Type | Default | | ||
| -------------- | ------------------------------------------------------- | ------------ | ------- | | ||
| `onChartReady` | Callback to be called when chart is finished rendering. | `() => void` | | |
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.
Made some drive-by style changes in the README, mostly to use backticks on some code that wasn't previously formatted
className={cx( | ||
getContainerStyles(theme, height, headerHeight), | ||
className, | ||
isOpen && 'open', |
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.
We don't typically use this pattern. An alternative could be to pass isOpen
to getContainerStyles(theme, height, headerHeight, isOpen)
and then conditionally render the style:
export const getContainerStyles = (
theme: Theme,
height?: number,
headerHeight?: number,
isOpen,
) => cx(css`
... default styles here
`,
{
[css`
... open styles here
`]: isOpen
}
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.
Gotcha, will change!
grid-template-rows: 40px 0fr; | ||
transition: grid-template-rows ${transitionDuration.slower}ms ease-in-out; | ||
|
||
&.open { |
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.
Curious: why do you prefer using .open
instead of conditionally rendering the styles with cx
?
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.
Actually not a preference, just not used to having cx
as an option! Will update this.
> | ||
<Icon | ||
glyph="ChevronDown" | ||
className={cx(toggleIconStyles, isOpen && 'open')} |
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.
nit:
[css`...`]:open
✍️ Proposed changes
This adds both
ChartCard
andHeader
components.🎟 Jira tickets:
✅ Checklist
For bug fixes, new features & breaking changes
yarn changeset
and documented my changesFor new components
🧪 How to test changes