diff options
author | August Skare <post@augustskare.no> | 2018-11-20 22:10:59 +0800 |
---|---|---|
committer | August Skare <post@augustskare.no> | 2018-11-20 22:10:59 +0800 |
commit | ea1805058924e12a18bcc4f9de712bfade64c595 (patch) | |
tree | cb172f39ead2ff076600dbcf53745e2bb1a34580 /packages/dev-tools-pages/ts/components/code.tsx | |
parent | 117726c6d80dd20e8b9409cec23b0c062690b0df (diff) | |
download | dexon-sol-tools-ea1805058924e12a18bcc4f9de712bfade64c595.tar.gz dexon-sol-tools-ea1805058924e12a18bcc4f9de712bfade64c595.tar.zst dexon-sol-tools-ea1805058924e12a18bcc4f9de712bfade64c595.zip |
use lodash isUndefined function
Diffstat (limited to 'packages/dev-tools-pages/ts/components/code.tsx')
-rw-r--r-- | packages/dev-tools-pages/ts/components/code.tsx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/packages/dev-tools-pages/ts/components/code.tsx b/packages/dev-tools-pages/ts/components/code.tsx index 9123192d9..f02ff1331 100644 --- a/packages/dev-tools-pages/ts/components/code.tsx +++ b/packages/dev-tools-pages/ts/components/code.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; import styled from 'styled-components'; +import * as _ from 'lodash'; import { colors } from 'ts/variables'; @@ -49,10 +50,10 @@ const Base = CodeProps > ` font-size: .875rem; - color: ${props => (props.language === undefined ? colors.white : 'inherit')}; + color: ${props => (_.isUndefined(props.language) ? colors.white : 'inherit')}; background-color: ${props => - props.isLight ? 'rgba(255,255,255,.15)' : props.language === undefined ? colors.black : '#F1F4F5'}; - white-space: ${props => (props.language === undefined ? 'nowrap' : '')}; + props.isLight ? 'rgba(255,255,255,.15)' : _.isUndefined(props.language) ? colors.black : '#F1F4F5'}; + white-space: ${props => (_.isUndefined(props.language) ? 'nowrap' : '')}; position: relative; ${props => @@ -149,7 +150,7 @@ class Code extends React.Component<CodeProps, CodeState> { <Container> <Base language={language} isDiff={isDiff} isLight={isLight}> <StyledPre isDiff={isDiff}> - {hlCode === undefined ? ( + {_.isUndefined(hlCode) ? ( <code>{children}</code> ) : ( <StyledCodeDiff |