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

feat: redesign InfoCards component and update schema #414

Merged
merged 14 commits into from
Aug 12, 2024

Conversation

dcshzj
Copy link
Contributor

@dcshzj dcshzj commented Aug 2, 2024

Problem

InfoCards component has drifted from the Figma designs.

Solution

Breaking Changes

  • Yes - this PR contains breaking changes
    • This will require schema changes and migrations!
  • No - this PR is backwards compatible

Improvements:

  • Redesigned InfoCards component to remove the button label.
  • Added no image variant of InfoCards.
  • Updated schema to enforce that all cards have or don't have images.
  • Also updated JSONForms boolean control to avoid rendering if there is a const present, similar to how we do for type properties.
  • Added the new InfoCards component to the auto-generated index page.

@dcshzj dcshzj requested a review from a team as a code owner August 2, 2024 06:29
Copy link

vercel bot commented Aug 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
isomer-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 12, 2024 6:10am

}: ControlProps) {
schema,
}: ControlProps): JSX.Element {
if (schema.const !== undefined) {
Copy link
Contributor

Choose a reason for hiding this comment

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

what's schema.const?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

schema.const is a JSON Schema construct where the particular property takes in a specific literal (can be string/number/boolean). In this case, if the const is defined (say it's true) then it is not meaningful to show the toggle, since the false` case is invalid.

@@ -84,6 +84,7 @@ export const DEFAULT_BLOCKS: Record<
type: "infocards",
title: "This is an optional title of the Infocards component",
subtitle: "This is an optional subtitle for the Infocards component",
isCardsWithImages: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

do you think there can be other states for cards? if so we can use an enum like "WithImages, TextOnly" etc. and is extensible?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah good point, this was the original based on designs where there was a toggle button but this has changed to use a dropdown to select the variants. Adjusted in 34dcbfd!

@dcshzj dcshzj force-pushed the feat/redesign-infocards-component branch from c0f9b58 to 1d97a4f Compare August 5, 2024 01:45
@dcshzj dcshzj force-pushed the feat/redesign-infocards-component branch from 1d97a4f to 08ffbbc Compare August 5, 2024 01:48
@dcshzj dcshzj requested review from harishv7 and a team August 5, 2024 02:30
@karrui karrui force-pushed the karrui/isom-1265-iconbutton-new-component branch 3 times, most recently from 910cbe3 to 7fa4c7a Compare August 5, 2024 06:26
Copy link
Contributor

Choose a reason for hiding this comment

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

run formatted on generated stuff pls :P

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Rebase removed le

Base automatically changed from karrui/isom-1265-iconbutton-new-component to main August 5, 2024 06:38
@dcshzj dcshzj force-pushed the feat/redesign-infocards-component branch from 34dcbfd to e98e00c Compare August 5, 2024 13:45
@sehyunidaaa
Copy link
Contributor

Updated with styling tweaks. Please re-review!

"imageUrl" | "imageAlt" | "url"
>): JSX.Element => (
<div
className={compoundStyles.cardImageContainer({ isClickableCard: !!url })}
Copy link
Contributor

Choose a reason for hiding this comment

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

@dcshzj I had to pass icClickableCard here as well because the hover effect applies to both InfoCardImage (hover on image) AND cardTitle (color change, arrow moves). Previously group-hover wasn't working on the InfoCardImage. Hope this is not weird in terms of practice though?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup this works!

Copy link
Contributor

@karrui karrui left a comment

Choose a reason for hiding this comment

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

lgtm if design passes design

@@ -11,5 +11,6 @@
"devDependencies": {
"@isomer/eslint-config": "*",
"@isomer/prettier-config": "*"
}
},
"prettier": "@isomer/prettier-config"
Copy link
Contributor

Choose a reason for hiding this comment

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

need run formatting again since all tooling affected hehehe

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah okay for some reason it didn't give me anything the first time round, fixed in d2a6419.

@dcshzj dcshzj merged commit 69e458f into main Aug 12, 2024
17 of 19 checks passed
@dcshzj dcshzj deleted the feat/redesign-infocards-component branch August 12, 2024 08:44
@karrui
Copy link
Contributor

karrui commented Aug 14, 2024

ISOM-1272

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.

4 participants