-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: QuizAnswerModal 내 AnswerCodeBlock 컴포넌트 분리
[#221]
- Loading branch information
Showing
6 changed files
with
44 additions
and
25 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
packages/frontend/src/components/quiz/AnswerCodeBlock/AnswerCodeBlock.css.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { globalStyle, style } from "@vanilla-extract/css"; | ||
|
||
import color from "../../../design-system/tokens/color"; | ||
import typography from "../../../design-system/tokens/typography"; | ||
|
||
export const answerContainer = style([ | ||
typography.$semantic.body2Regular, | ||
{ | ||
backgroundColor: color.$semantic.bgAlt, | ||
borderRadius: 8, | ||
width: "100%", | ||
padding: "23px 25px", | ||
marginBottom: 19, | ||
whiteSpace: "break-spaces", | ||
color: color.$scale.grey700, | ||
}, | ||
]); | ||
|
||
globalStyle(`${answerContainer} code`, { | ||
color: color.$scale.coral500, | ||
}); |
18 changes: 18 additions & 0 deletions
18
packages/frontend/src/components/quiz/AnswerCodeBlock/AnswerCodeBlock.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { toCodeTag } from "../../../utils/mapper"; | ||
|
||
import { answerContainer } from "./AnswerCodeBlock.css"; | ||
|
||
interface AnswerCodeBlockProps { | ||
answer: string[]; | ||
} | ||
|
||
export function AnswerCodeBlock({ answer }: AnswerCodeBlockProps) { | ||
return ( | ||
<p | ||
className={answerContainer} | ||
dangerouslySetInnerHTML={{ | ||
__html: toCodeTag(answer.join("\n")), | ||
}} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { AnswerCodeBlock } from "./AnswerCodeBlock"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters