- {React.Children.map(children, tab => {
+ {React.Children.map(children, (tab) => {
return React.cloneElement(tab, {
active: tab.props.name === activeTab,
width: `${tabWidth}rem`,
@@ -87,7 +88,7 @@ TabItem.defaultProps = {
const Block = styled.div<{ align: 'center' | 'left' }>`
display: flex;
- ${props =>
+ ${(props) =>
props.align === 'center' &&
css`
justify-content: center;
@@ -103,11 +104,11 @@ const Indicator = styled(animated.div)<{ theme: 'teal' | 'gray' }>`
display: block;
position: absolute;
bottom: 0px;
- background: ${palette.teal5};
- ${props =>
+ background: ${themedPalette.primary2};
+ ${(props) =>
props.theme === 'gray' &&
css`
- background: ${palette.gray8};
+ background: ${themedPalette.border1};
`}
`;
@@ -120,7 +121,7 @@ const StyledLink = styled(Link)<{
${media.small} {
font-size: 1rem;
}
- color: ${palette.gray6};
+ color: ${themedPalette.text3};
display: flex;
align-items: center;
justify-content: center;
@@ -128,11 +129,11 @@ const StyledLink = styled(Link)<{
&.active {
font-weight: bold;
- color: ${palette.teal5};
- ${props =>
+ color: ${themedPalette.primary2};
+ ${(props) =>
props.theme === 'gray' &&
css`
- color: ${palette.gray8};
+ color: ${themedPalette.text1};
`}
}
`;
diff --git a/src/components/common/LabelInput.tsx b/src/components/common/LabelInput.tsx
index 0cac9fc4..afa89aca 100644
--- a/src/components/common/LabelInput.tsx
+++ b/src/components/common/LabelInput.tsx
@@ -1,5 +1,6 @@
import * as React from 'react';
import styled, { css } from 'styled-components';
+import { themedPalette } from '../../lib/styles/themes';
import palette from '../../lib/styles/palette';
import { MdLockOutline } from 'react-icons/md';
import media from '../../lib/styles/media';
@@ -12,17 +13,18 @@ const LabelInputBlock = styled.div<{ focus: boolean }>`
label {
font-weight: bold;
font-size: 1.125rem;
- color: ${palette.gray9};
+ color: ${themedPalette.text1};
margin-bottom: 1rem;
transition: all 0.125s ease-in;
- ${props =>
+ ${(props) =>
props.focus &&
css`
- color: ${palette.teal7};
+ color: ${themedPalette.primary1};
`}
}
input {
+ background: transparent;
font-size: 1.5rem;
border: none;
outline: none;
@@ -31,18 +33,18 @@ const LabelInputBlock = styled.div<{ focus: boolean }>`
}
width: 100%;
- color: ${palette.gray7};
+ color: ${themedPalette.text2};
transition: all 0.125s ease-in;
- ${props =>
+ ${(props) =>
props.focus &&
css`
- color: ${palette.teal7};
+ color: ${themedPalette.primary1};
`}
&::placeholder {
- color: ${palette.gray5};
+ color: ${themedPalette.text3};
}
&:disabled {
- color: ${palette.gray6};
+ color: ${themedPalette.text3};
}
}
.group {
@@ -51,20 +53,20 @@ const LabelInputBlock = styled.div<{ focus: boolean }>`
}
.input-wrapper {
padding-bottom: 0.5rem;
- border-bottom: 1px solid ${palette.gray7};
+ border-bottom: 1px solid ${themedPalette.border2};
display: flex;
align-items: center;
- ${props =>
+ ${(props) =>
props.focus &&
css`
- border-color: ${palette.teal7};
+ border-color: ${themedPalette.primary1};
`}
input {
width: 1;
}
svg {
font-size: 1.5rem;
- color: ${palette.gray6};
+ color: ${themedPalette.text3};
}
}
.width-maker {
diff --git a/src/components/common/MarkdownEditor.tsx b/src/components/common/MarkdownEditor.tsx
index 4f428fdf..1424f31c 100644
--- a/src/components/common/MarkdownEditor.tsx
+++ b/src/components/common/MarkdownEditor.tsx
@@ -2,22 +2,25 @@ import React, { CSSProperties, useRef, useEffect, useCallback } from 'react';
import styled from 'styled-components';
import CodeMirror, { EditorFromTextArea, Editor } from 'codemirror';
import './atom-one-light.css';
+import './atom-one-dark.css';
import 'codemirror/lib/codemirror.css';
-import palette from '../../lib/styles/palette';
+import { themedPalette } from '../../lib/styles/themes';
+
import 'codemirror/mode/markdown/markdown';
import 'codemirror/addon/display/placeholder';
+import { useTheme } from '../../lib/hooks/useTheme';
const MarkdownEditorBlock = styled.div`
.CodeMirror {
height: auto;
font-size: 1.125rem;
line-height: 1.5;
- color: ${palette.gray8};
+ color: ${themedPalette.text1};
font-family: 'Fira Mono', monospace;
/* font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', */
.cm-header {
line-height: 2;
- color: ${palette.gray9};
+ color: ${themedPalette.text1};
}
.cm-header-1 {
font-size: 2.5rem;
@@ -35,10 +38,10 @@ const MarkdownEditorBlock = styled.div`
}
.cm-strong,
.cm-em {
- color: ${palette.gray9};
+ color: ${themedPalette.text1};
}
.CodeMirror-placeholder {
- color: ${palette.gray5};
+ color: ${themedPalette.text3};
font-style: italic;
}
}
@@ -67,12 +70,14 @@ const MarkdownEditor = ({
[onChangeMarkdown],
);
+ const theme = useTheme();
+
// initialize editor
useEffect(() => {
if (!textArea.current) return;
const cm = CodeMirror.fromTextArea(textArea.current, {
mode: 'markdown',
- theme: 'one-light',
+ theme: `one-${theme}`,
placeholder: '당신은 어떤 사람인가요? 당신에 대해서 알려주세요.',
lineWrapping: true,
});
diff --git a/src/components/common/MarkdownRender.tsx b/src/components/common/MarkdownRender.tsx
index 2c0207c6..35c796c5 100644
--- a/src/components/common/MarkdownRender.tsx
+++ b/src/components/common/MarkdownRender.tsx
@@ -31,11 +31,8 @@ export interface MarkdownRenderProps {
}
const MarkdownRenderBlock = styled.div`
- &.atom-one-dark {
- ${prismThemes['atom-one-dark']}
- }
- &.atom-one-light {
- ${prismThemes['atom-one-light']}
+ &.atom-one {
+ ${prismThemes['atom-one']}
}
&.github {
${prismThemes['github']}
@@ -203,7 +200,7 @@ type RenderedElement =
const MarkdownRender: React.FC
= ({
markdown,
- codeTheme = 'atom-one-light',
+ codeTheme = 'atom-one',
onConvertFinish,
editing,
}) => {
diff --git a/src/components/common/OpaqueLayer.tsx b/src/components/common/OpaqueLayer.tsx
index 5a2f6330..8a28a799 100644
--- a/src/components/common/OpaqueLayer.tsx
+++ b/src/components/common/OpaqueLayer.tsx
@@ -1,5 +1,6 @@
import * as React from 'react';
import styled, { css } from 'styled-components';
+import { themedPalette } from '../../lib/styles/themes';
import transitions from '../../lib/styles/transitions';
import zIndexes from '../../lib/styles/zIndexes';
@@ -12,10 +13,10 @@ const OpaqueLayerBlock = styled.div<{
left: 0;
width: 100%;
height: 100%;
- background: rgba(249, 249, 249, 0.85);
+ background: ${themedPalette.opaque_layer};
z-index: ${zIndexes.OpaqueLayer};
- ${props =>
+ ${(props) =>
props.visible
? css`
animation: ${transitions.fadeIn} 0.25s forwards;
@@ -33,7 +34,7 @@ const { useState, useEffect, useRef } = React;
const OpaqueLayer: React.FC = ({ visible }) => {
const [animate, setAnimate] = useState(false);
- const timeoutId = useRef(null);
+ const timeoutId = useRef | null>(null);
const mounted = useRef(false);
const [closed, setClosed] = useState(true);
diff --git a/src/components/common/PopupBase.tsx b/src/components/common/PopupBase.tsx
index 34f92219..642857b2 100644
--- a/src/components/common/PopupBase.tsx
+++ b/src/components/common/PopupBase.tsx
@@ -4,6 +4,7 @@ import OpaqueLayer from './OpaqueLayer';
import zIndexes from '../../lib/styles/zIndexes';
import transitions from '../../lib/styles/transitions';
import media from '../../lib/styles/media';
+import { themedPalette } from '../../lib/styles/themes';
const PopupBaseBlock = styled.div`
position: fixed;
@@ -20,13 +21,13 @@ const PopupBaseBlock = styled.div`
const PopupWrapper = styled.div<{ visible: boolean }>`
width: 25rem;
border-radius: 4px;
- background: white;
+ background: ${themedPalette.bg_element1};
padding: 2rem 1.5rem;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.09);
${media.small} {
width: calc(100% - 2rem);
}
- ${props =>
+ ${(props) =>
props.visible
? css`
animation: ${transitions.popInFromBottom} 0.4s forwards ease-in-out;
@@ -45,7 +46,7 @@ const { useState, useEffect } = React;
const PopupBase: React.FC = ({ visible, children }) => {
const [closed, setClosed] = useState(true);
useEffect(() => {
- let timeoutId: number | null = null;
+ let timeoutId: ReturnType | null = null;
if (visible) {
setClosed(false);
} else {
diff --git a/src/components/common/PopupOKCancel.tsx b/src/components/common/PopupOKCancel.tsx
index 3b40218d..9b574db4 100644
--- a/src/components/common/PopupOKCancel.tsx
+++ b/src/components/common/PopupOKCancel.tsx
@@ -2,20 +2,21 @@ import * as React from 'react';
import styled from 'styled-components';
import PopupBase from './PopupBase';
import Button from './Button';
+import { themedPalette } from '../../lib/styles/themes';
import palette from '../../lib/styles/palette';
const PopupOKCancelBlock = styled.div`
h3 {
margin: 0;
font-size: 1.5rem;
- color: ${palette.gray8};
+ color: ${themedPalette.text1};
line-height: 1.5;
font-weight: bold;
}
.message {
line-height: 1.5;
font-size: 1rem;
- color: ${palette.gray7};
+ color: ${themedPalette.text2};
margin-top: 1rem;
margin-bottom: 1rem;
white-space: pre-wrap;
@@ -52,7 +53,7 @@ const PopupOKCancel: React.FC = ({
{children}
{onCancel && (
-