Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions src/quiz-question/quiz-question.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -553,4 +553,52 @@ print(cel)
},
};

export const WithRubyText: Story = {
render: QuizQuestionComp,
args: {
question: (
<span>
What does{" "}
<ruby>
你好<rt>nǐ hǎo</rt>
</ruby>{" "}
mean?
</span>
),
answers: [
{ label: "Hello", value: 1 },
{ label: "Goodbye", value: 2 },
{ label: "Thank you", value: 3 },
],
position: 1,
},
parameters: {
docs: {
source: {
code: `const App = () => {
const [answer, setAnswer] = useState();

return (
<QuizQuestion
question={
<span>
What does <ruby>你好<rt>nǐ hǎo</rt></ruby> mean?
</span>
}
answers={[
{ label: "Hello", value: 1 },
{ label: "Goodbye", value: 2 },
{ label: "Thank you", value: 3 }
]}
onChange={(newAnswer) => setAnswer(newAnswer)}
selectedAnswer={answer}
position={1}
/>
);
}`,
},
},
},
};

export default story;
2 changes: 1 addition & 1 deletion src/quiz-question/quiz-question.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const QuestionText = ({
}

return (
<span className="text-foreground-primary flex">
<span className="text-foreground-primary flex items-baseline">
<span>{position}.</span>
&nbsp;
{question}
Expand Down