Skip to content
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

New Metric Card Component #8987

Merged
merged 11 commits into from
Nov 28, 2024
Merged

Conversation

pinotalexandre
Copy link
Collaborator

Description

New component to display metrics (already existing in the workspace but not as a component).

Risk

Deploy Plan

Merge
Deploy sparkle

Copy link
Contributor

@JulesBelveze JulesBelveze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! A few feedbacks:

  • it seems to as a very generic "card" right? Could we rename it to "Card" (or equivalent) instead of "MetricCard"?
  • You have a problem in package.json, seems like you installed sparkle as a dependency of sparkle
  • to make the API a tiny bit more friendly could we have a general component that instantiates the others, to be used like:
<MetricCard
  size="xs"
  isLoading={false}
  title="blabla"
  content={<div>test</div>}
/>

Let me know if you need help with any of those!

footer: "s-flex s-items-center s-gap-2",
loading: "s-flex s-items-center s-justify-start",
},
} as const;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: not sure we need the as const here?

Comment on lines 45 to 55
interface MetricCardRootProps
extends BaseProps,
VariantProps<typeof metricCardVariants> {}
interface MetricCardHeaderProps extends BaseProps {}
interface MetricCardTitleProps extends BaseProps {}
interface MetricCardSubtitleProps extends BaseProps {}
interface MetricCardContentProps extends Omit<BaseProps, "children"> {
children?: React.ReactNode;
isLoading?: boolean;
}
interface MetricCardFooterProps extends BaseProps {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we usually try to have the interface directly above its associated component

@JulesBelveze JulesBelveze force-pushed the feature/sparkle-metric-card-clean branch from 63725ac to 38723e1 Compare November 28, 2024 14:15
@JulesBelveze JulesBelveze force-pushed the feature/sparkle-metric-card-clean branch from 0211220 to a03e46f Compare November 28, 2024 14:22
 - Standardize object and component formatting for consistency
 - Remove extraneous newlines and ensure proper newline at EOF in Card component files
 - Simplify export statements in components index file
Copy link
Contributor

@JulesBelveze JulesBelveze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 🔥

 - Updated package version in package-lock.json and package.json for new release
 - Changes include synchronization of the version across both files
@pinotalexandre pinotalexandre merged commit 66e190e into main Nov 28, 2024
3 checks passed
@pinotalexandre pinotalexandre deleted the feature/sparkle-metric-card-clean branch November 28, 2024 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants