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 preview-card styles #88

Merged
merged 6 commits into from
Jan 31, 2025

Conversation

jomcarvajal
Copy link

New ExercisePreview component added (show_all_feedback: false )
Screenshot 2025-01-28 at 2 18 24 PM

New style for selected cards
Screenshot 2025-01-28 at 2 18 28 PM

@jomcarvajal jomcarvajal requested a review from a team as a code owner January 28, 2025 22:07
@jomcarvajal jomcarvajal requested review from bethshook and jivey and removed request for a team January 28, 2025 22:07
Copy link
Member

@jivey jivey left a comment

Choose a reason for hiding this comment

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

Looking good, just small things and a different prop interface. Do you also want to include the smaller bubble sizes in this? The figma designs were made smaller after I made this branch.

@@ -103,7 +104,7 @@ const exerciseWithQuestionStatesProps = (): ExerciseWithQuestionStatesProps => {
is_answer_order_important: false,
answers: [{
id: '1',
correctness: undefined,
correctness: '1.0',
Copy link
Member

Choose a reason for hiding this comment

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

Does this break any of the other stories? Seems alright, I just can't remember why it was undefined originally

Copy link
Author

Choose a reason for hiding this comment

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

This marks a question as correct, I can keep it as undefined and create a new variable just for new stories


.question-info {
font-weight: bold;
font-size: 1.6rem;
Copy link
Member

Choose a reason for hiding this comment

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

Does this match Figma? I think Figma might be slightly smaller. Also I'm not sure when that other PR will get merged, so maybe we do include the fix you made last week for the broken separator :D

Copy link
Author

@jomcarvajal jomcarvajal Jan 29, 2025

Choose a reason for hiding this comment

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

You're right, it should be 1.2rem


beforeEach(() => {
exercise = {
uid: '1@1',
Copy link
Member

Choose a reason for hiding this comment

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

I think these are indented 4 but we use 2 in this repo (and most of the repos)

/**
* An Exercise version with less interaction with card and grants an Overlay with Include/Remove component
*/
export const ExercisePreview = (
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer this to take selected and onSelectionChange props, that keeps it flexible on the consuming side

@@ -160,7 +160,7 @@ export const mixins = {
.answer-letter-wrapper::before {
color: ${invertBubble ? '#fff' : color};
border-color: ${color};
${invertBubble ? `background-color: ${color};` : null}
${invertBubble ? `background-color: ${color} !important;` : null}
Copy link
Member

Choose a reason for hiding this comment

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

Which style is this overriding?

Copy link
Author

Choose a reason for hiding this comment

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

When a card is selected, all background should change color(including letter wrappers). But when a letter is marked as correct, I forced to overrides the "correct theme"

Copy link
Member

Choose a reason for hiding this comment

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

Ah I see now, I didn't realize we set an explicit background on those

src/components/Exercise/styles.ts Outdated Show resolved Hide resolved
src/components/Exercise/styles.ts Outdated Show resolved Hide resolved
@jomcarvajal
Copy link
Author

Looking good, just small things and a different prop interface. Do you also want to include the smaller bubble sizes in this? The figma designs were made smaller after I made this branch.

@jivey bubbles mean "answer-letters" ?

@jivey
Copy link
Member

jivey commented Jan 29, 2025

@jomcarvajal Yeah I think the answer-letter-wrapper maybe? I was thinking of the bubbleSize setting in theme that the normal component uses

@jomcarvajal jomcarvajal requested a review from jivey January 29, 2025 19:40
@jomcarvajal jomcarvajal merged commit 946c936 into preview-card Jan 31, 2025
1 check passed
@jomcarvajal jomcarvajal deleted the CORE-675-new-styles-for-preview-card branch January 31, 2025 13: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