Skip to content

Commit 8831259

Browse files
fix(QuizQuestion): align position and question text along baseline (#718)
1 parent b68ab12 commit 8831259

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed

src/quiz-question/quiz-question.stories.tsx

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,4 +553,52 @@ print(cel)
553553
},
554554
};
555555

556+
export const WithRubyText: Story = {
557+
render: QuizQuestionComp,
558+
args: {
559+
question: (
560+
<span>
561+
What does{" "}
562+
<ruby>
563+
你好<rt>nǐ hǎo</rt>
564+
</ruby>{" "}
565+
mean?
566+
</span>
567+
),
568+
answers: [
569+
{ label: "Hello", value: 1 },
570+
{ label: "Goodbye", value: 2 },
571+
{ label: "Thank you", value: 3 },
572+
],
573+
position: 1,
574+
},
575+
parameters: {
576+
docs: {
577+
source: {
578+
code: `const App = () => {
579+
const [answer, setAnswer] = useState();
580+
581+
return (
582+
<QuizQuestion
583+
question={
584+
<span>
585+
What does <ruby>你好<rt>nǐ hǎo</rt></ruby> mean?
586+
</span>
587+
}
588+
answers={[
589+
{ label: "Hello", value: 1 },
590+
{ label: "Goodbye", value: 2 },
591+
{ label: "Thank you", value: 3 }
592+
]}
593+
onChange={(newAnswer) => setAnswer(newAnswer)}
594+
selectedAnswer={answer}
595+
position={1}
596+
/>
597+
);
598+
}`,
599+
},
600+
},
601+
},
602+
};
603+
556604
export default story;

src/quiz-question/quiz-question.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const QuestionText = ({
1616
}
1717

1818
return (
19-
<span className="text-foreground-primary flex">
19+
<span className="text-foreground-primary flex items-baseline">
2020
<span>{position}.</span>
2121
&nbsp;
2222
{question}

0 commit comments

Comments
 (0)