ligt theme on code

This commit is contained in:
August Skare
2018-10-22 09:11:37 +02:00
parent 15a3c234c5
commit 12087b6b70
2 changed files with 6 additions and 4 deletions

View File

@@ -7,6 +7,7 @@ import BaseButton from './Button';
interface CodeProps {
children: React.ReactNode;
language?: string;
light?: boolean;
}
interface CodeState {
@@ -27,7 +28,8 @@ const Base =
CodeProps >
`
color: ${props => (props.language === undefined ? colors.white : 'inherit')};
background-color: ${props => (props.language === undefined ? colors.black : colors.lightGray)};
background-color: ${props =>
props.light ? 'rgba(255,255,255,.15)' : props.language === undefined ? colors.black : colors.lightGray};
white-space: ${props => (props.language === undefined ? 'nowrap' : '')};
position: relative;
&:hover ${Button} {
@@ -92,10 +94,10 @@ class Code extends React.Component<CodeProps, CodeState> {
};
render() {
const { language, children } = this.props;
const { language, light, children } = this.props;
return (
<Base language={language}>
<Base language={language} light={light}>
<StyledPre>
{this.state.hlCode !== undefined ? (
<StyledCode dangerouslySetInnerHTML={{ __html: this.state.hlCode }} />

View File

@@ -28,7 +28,7 @@ function Trace(props: Props) {
Every time an Ethereum transaction fails, it's extremely hard to trace down the troublemaking
line of code. The only hint you'll get is a generic error.
</MainCopy>
<Code>Error: VM Exception while processing transaction: rever</Code>
<Code light>Error: VM Exception while processing transaction: rever</Code>
<List>
<Item>