From c8522ff66ea3260c084012bd13a2e2f50baf3616 Mon Sep 17 00:00:00 2001 From: Pedro Nauck Date: Tue, 19 Feb 2019 15:43:25 -0300 Subject: [PATCH] chore(docz-theme-default): codemirror adjustments --- .../src/components/ui/CodeMirror/index.tsx | 1 + core/docz-theme-default/src/components/ui/Editor/index.tsx | 4 +--- core/docz-theme-default/src/components/ui/Props.tsx | 5 ++++- core/docz-theme-default/src/types.d.ts | 3 --- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/core/docz-theme-default/src/components/ui/CodeMirror/index.tsx b/core/docz-theme-default/src/components/ui/CodeMirror/index.tsx index 6fe9627c1..69d3ced3b 100644 --- a/core/docz-theme-default/src/components/ui/CodeMirror/index.tsx +++ b/core/docz-theme-default/src/components/ui/CodeMirror/index.tsx @@ -85,6 +85,7 @@ const CodeMirror: SFC = props => { const editorProps = { ...props, editorDidMount: (codemirror: any) => { + props.editorDidMount && props.editorDidMount(codemirror) editor.current = codemirror }, } diff --git a/core/docz-theme-default/src/components/ui/Editor/index.tsx b/core/docz-theme-default/src/components/ui/Editor/index.tsx index 094579b51..d3aae2d71 100644 --- a/core/docz-theme-default/src/components/ui/Editor/index.tsx +++ b/core/docz-theme-default/src/components/ui/Editor/index.tsx @@ -86,9 +86,7 @@ export const Editor: React.SFC = ({ } const onEditorDidMount = (editor: any) => { - if (editor) { - removeLastLine(editor) - } + if (editor) removeLastLine(editor) } const removeLastLine = useCallback( diff --git a/core/docz-theme-default/src/components/ui/Props.tsx b/core/docz-theme-default/src/components/ui/Props.tsx index 180a82466..720c0fe44 100644 --- a/core/docz-theme-default/src/components/ui/Props.tsx +++ b/core/docz-theme-default/src/components/ui/Props.tsx @@ -21,10 +21,11 @@ const Title = styled.div` const PropName = styled.span` background: ${get('colors.sidebarBg')}; - color: ${get('colors.sidebarText')}; + color: ${get('colors.primary')}; padding: 5px 10px; border-radius: 4px 4px 0 0; font-size: 14px; + font-weight: 500; & ~ & { margin-left: 5px; @@ -33,6 +34,8 @@ const PropName = styled.span` const PropType = styled(PropName)` color: ${get('colors.blockquoteColor')}; + background: ${get('colors.sidebarBg')}; + font-weight: 400; ` const PropDefaultValue = styled(PropType)` diff --git a/core/docz-theme-default/src/types.d.ts b/core/docz-theme-default/src/types.d.ts index b851b93d5..e9c8de627 100644 --- a/core/docz-theme-default/src/types.d.ts +++ b/core/docz-theme-default/src/types.d.ts @@ -2,9 +2,6 @@ declare module 'copy-text-to-clipboard' declare module 'facepaint' declare module 'hotkeys-js' declare module 'match-sorter' -declare module 'polished/lib/color/lighten' -declare module 'polished/lib/color/darken' -declare module 'polished/lib/color/rgba' declare module 'react-codemirror2' declare module 'react-feather/dist/icons/edit-2' declare module 'react-feather/dist/icons/chevron-down'