alernate prop on inlinecode component

This commit is contained in:
August Skare
2018-10-26 09:23:09 +02:00
parent f17c7e4a22
commit 74f0515370
2 changed files with 9 additions and 3 deletions

View File

@@ -45,7 +45,7 @@ const cards = [
title: 'Project-centric',
body: (
<React.Fragment>
It can compile an entire project instead of only individual <InlineCode>.sol</InlineCode> files
It can compile an entire project instead of only individual <InlineCode alt>.sol</InlineCode> files
</React.Fragment>
),
},

View File

@@ -1,8 +1,14 @@
import * as React from 'react';
import styled from 'styled-components';
import { colors } from '../variables';
const InlineCode = styled.code`
background-color: ${colors.blueGray}
interface InlineCodeProps {
alt?: boolean;
children: React.ReactNode;
}
const InlineCode = styled(({ alt, children, ...props }: InlineCodeProps) => <code {...props}>{children}</code>)`
background-color: ${props => (props.alt ? '#E5E8E9' : colors.blueGray)};
padding: 0.1875rem;
`;