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

Modify Card component to accept header #417

Merged
merged 3 commits into from
Jun 27, 2024
Merged

Conversation

rebeccahum
Copy link
Contributor

@rebeccahum rebeccahum commented Jun 26, 2024

Description

Modify existing Card component to accept header property:

Screenshot 2024-06-27 at 10 52 31 AM

Checklist

  • This PR has good automated test coverage
  • The storybook for the component has been updated

Steps to Test

Outline the steps to test and verify the PR here.

Example:

  1. Pull down PR.
  2. npm run dev.
  3. Open Storybook.
  4. Eat cookies.
  5. Verify cookies are delicious.

Copy link

netlify bot commented Jun 26, 2024

Deploy Preview for vip-design-system-components ready!

Name Link
🔨 Latest commit 7e6ba2a
🔍 Latest deploy log https://app.netlify.com/sites/vip-design-system-components/deploys/667dd29ea9fb940008065453
😎 Deploy Preview https://deploy-preview-417--vip-design-system-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@rebeccahum rebeccahum requested a review from djalmaaraujo June 26, 2024 22:54
@rebeccahum rebeccahum force-pushed the add/box-with-heading branch from db64c3c to 12117e1 Compare June 26, 2024 22:59
@rebeccahum rebeccahum requested a review from chriszarate June 26, 2024 23:01
@rebeccahum rebeccahum force-pushed the add/box-with-heading branch 2 times, most recently from 294f631 to c4a6d7e Compare June 26, 2024 23:08
Copy link
Contributor

@djalmaaraujo djalmaaraujo left a comment

Choose a reason for hiding this comment

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

First of all, thanks for creating the component here first! This is really important.

I would like to propose a different a approach from what you started, if you don't mind. The goal is to keep thins standard with the way we've be doing things.

1 - I believe the BoxWithHeading could easily be a variation of "Card". You could add a header property accepting a text or another component, and simply use the Card.

2 - The way you're customizing the variables is a little bit different of what we do usually. It might look not so "flexible", but to keep the design aligned with Figma, we usually work with "variants" of a component. Instead of passing the header bg color and header text color, you can pass the variant="primary" for example. The primary variant will have a "static" variation of the header you want to use.

If I may suggest what it would like in my mind, is this:

<Card>
  <Card.Header>This is my header</Card.Header>
  <Card.Body>This is my body</Card.Body> // this is optional
</Card>

You can take a look of a variant example here: src/system/Button/Button.tsx

3 - If you go with the Card idea, can you move this stories.tsx documentation and write some documentation? I can help too.

4 - We have a set of border colors, you might want to try borders.2 or something similar. Figma should show the correct set of colors.

@rebeccahum rebeccahum force-pushed the add/box-with-heading branch from c4a6d7e to d2a35c2 Compare June 27, 2024 15:37
@rebeccahum rebeccahum changed the title Add BoxWithHeading component Modify Card component to accept header Jun 27, 2024
@rebeccahum rebeccahum force-pushed the add/box-with-heading branch 2 times, most recently from 25699b5 to 59335e8 Compare June 27, 2024 16:00
@rebeccahum rebeccahum requested a review from djalmaaraujo June 27, 2024 16:21
@rebeccahum rebeccahum force-pushed the add/box-with-heading branch 3 times, most recently from 29c120b to 093578b Compare June 27, 2024 16:48
@rebeccahum rebeccahum force-pushed the add/box-with-heading branch from 093578b to 21fca0f Compare June 27, 2024 16:52
Copy link
Contributor

@djalmaaraujo djalmaaraujo left a comment

Choose a reason for hiding this comment

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

Thanks! I left some things, but it's in a much better shape now!

@rebeccahum rebeccahum requested a review from djalmaaraujo June 27, 2024 21:02
Copy link
Contributor

@djalmaaraujo djalmaaraujo left a comment

Choose a reason for hiding this comment

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

Amazing! :D
Thanks for your patience!

:shipit:

@rebeccahum rebeccahum merged commit 19e2b95 into trunk Jun 27, 2024
8 checks passed
@rebeccahum rebeccahum deleted the add/box-with-heading branch June 27, 2024 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants