Skip to content

Commit

Permalink
hotfix: 문제 페이지 스타일링
Browse files Browse the repository at this point in the history
  • Loading branch information
YuHyun-P committed Nov 24, 2023
1 parent 32e958f commit 72e1dd1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ import {
import badgeGroupLayout from "./CommandAccordion.css";

interface CommandAccordionProps {
width?: number | string;
items: string[];
}

export default function CommandAccordion({ items }: CommandAccordionProps) {
export default function CommandAccordion({
width = "100%",
items,
}: CommandAccordionProps) {
return (
<Accordion>
<Accordion width={width}>
<Accordion.Details>
<Accordion.Summary color="grey" size="sm">
{({ open }) => <>핵심명령어 {open ? "숨기기" : "보기"}</>}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const description = style([
whiteSpace: "break-spaces",
"@media": {
"(min-width: 1920px) and (max-width: 2559px)": {
height: "330px",
height: 250,
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import AccordionDetails from "./AccordionDetails";
import AccordionSummary from "./AccordionSummary";

interface AccordionProps {
width?: number;
width?: number | string;
open?: boolean;
children: ReactNode;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {

export type AccordionContextType = {
open: boolean;
width: number;
width: number | string;
onChange: (open: boolean) => void;
};

Expand All @@ -27,7 +27,7 @@ export function AccordionContextProvider({
children,
}: {
open: boolean;
width: number;
width: number | string;
children: ReactNode;
}) {
const [open, setOpen] = useState(initOpen);
Expand All @@ -36,12 +36,12 @@ export function AccordionContextProvider({
(nextOpen: boolean) => {
setOpen(nextOpen);
},
[setOpen]
[setOpen],
);

const accordionContextValue = useMemo(
() => ({ open, onChange: handleChange, width }),
[open, handleChange, width]
[open, handleChange, width],
);

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/pages/quizzes/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function QuizPage({ quiz }: { quiz: Quiz }) {
description={quiz.description}
/>
<div className={styles.commandAccordion}>
<CommandAccordion items={quiz.keywords} />
<CommandAccordion width="100%" items={quiz.keywords} />
</div>
<div className={styles.checkAnswerButton}>
<Button variant="secondaryFill">모범 답안 확인하기</Button>
Expand Down

0 comments on commit 72e1dd1

Please sign in to comment.