Skip to content
Merged
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
12 changes: 10 additions & 2 deletions src/components/Answer/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ import Details from "@theme/Details";
/**
* component that hide an answer
*/
export default function Answer({ children }) {
return <Details summary={<summary>解答</summary>}>{children}</Details>;
export default function Answer({ type = undefined, children }) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

typeというよりは、titleな気がする?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

この引数だけ見てもどういう引数かが、わからないんだよね...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

確かに

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

とりあえず、マージしてからでいいや。

return (
<Details
summary={
type ? <summary>解答例: {type}</summary> : <summary>解答例</summary>
}
>
{children}
</Details>
);
}