From e0626ee43818179ddce71197d387c2fd8df523fe Mon Sep 17 00:00:00 2001 From: Flacial Date: Thu, 14 Jul 2022 21:44:16 +0400 Subject: [PATCH] feat: Create Spoiler component folder Related to https://github.com/garageScript/c0d3-app/issues/2080 --- components/mdx/{ => Spoiler}/Spoiler.test.js | 0 components/mdx/{ => Spoiler}/Spoiler.tsx | 6 ++++-- components/mdx/Spoiler/index.tsx | 1 + components/mdx/Spoiler/spoiler.module.scss | 3 +++ 4 files changed, 8 insertions(+), 2 deletions(-) rename components/mdx/{ => Spoiler}/Spoiler.test.js (100%) rename components/mdx/{ => Spoiler}/Spoiler.tsx (62%) create mode 100644 components/mdx/Spoiler/index.tsx create mode 100644 components/mdx/Spoiler/spoiler.module.scss diff --git a/components/mdx/Spoiler.test.js b/components/mdx/Spoiler/Spoiler.test.js similarity index 100% rename from components/mdx/Spoiler.test.js rename to components/mdx/Spoiler/Spoiler.test.js diff --git a/components/mdx/Spoiler.tsx b/components/mdx/Spoiler/Spoiler.tsx similarity index 62% rename from components/mdx/Spoiler.tsx rename to components/mdx/Spoiler/Spoiler.tsx index 61e3852aa..f1cc97312 100644 --- a/components/mdx/Spoiler.tsx +++ b/components/mdx/Spoiler/Spoiler.tsx @@ -1,12 +1,14 @@ import React from 'react' +import styles from './spoiler.module.scss' + type Props = { name?: string } const Spoiler: React.FC = ({ children, name }) => { return ( -
+
{name || 'Answer'} -
{children}
+
{children}
) } diff --git a/components/mdx/Spoiler/index.tsx b/components/mdx/Spoiler/index.tsx new file mode 100644 index 000000000..5787f3812 --- /dev/null +++ b/components/mdx/Spoiler/index.tsx @@ -0,0 +1 @@ +export { default } from './Spoiler' diff --git a/components/mdx/Spoiler/spoiler.module.scss b/components/mdx/Spoiler/spoiler.module.scss new file mode 100644 index 000000000..1117844cb --- /dev/null +++ b/components/mdx/Spoiler/spoiler.module.scss @@ -0,0 +1,3 @@ +.content { + margin-left: 0.9rem; +}