Skip to content

Commit

Permalink
feat: Create Spoiler component folder
Browse files Browse the repository at this point in the history
  • Loading branch information
flacial committed Jul 14, 2022
1 parent 3643bc0 commit e0626ee
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import React from 'react'
import styles from './spoiler.module.scss'

type Props = {
name?: string
}
const Spoiler: React.FC<Props> = ({ children, name }) => {
return (
<details className="mb-4">
<details className="mb-3">
<summary>{name || 'Answer'}</summary>
<div className="ms-4">{children}</div>
<div className={styles.content}>{children}</div>
</details>
)
}
Expand Down
1 change: 1 addition & 0 deletions components/mdx/Spoiler/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './Spoiler'
3 changes: 3 additions & 0 deletions components/mdx/Spoiler/spoiler.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.content {
margin-left: 0.9rem;
}

0 comments on commit e0626ee

Please sign in to comment.