1
0
mirror of https://github.com/phuoc-ng/csslayout.git synced 2025-10-23 02:36:11 +02:00

Some layout tweaks

This commit is contained in:
Phuoc Nguyen
2019-11-29 10:10:38 +07:00
parent 4e80dfdf79
commit 86eb00f7da
13 changed files with 40 additions and 81 deletions

View File

@@ -4,15 +4,21 @@ import highlight from '../helpers/highlight';
interface SampleCodeProps {
code: string;
fullHeight?: boolean;
lang: string;
}
const SampleCode: React.FC<SampleCodeProps> = ({ code, lang }) => {
const SampleCode: React.FC<SampleCodeProps> = ({ code, fullHeight = false, lang }) => {
return code === ''
? <></>
: (
<pre
style={{ height: '100%', lineHeight: 1.5, margin: 0 }}
className="hljs"
style={{
height: fullHeight ? '100%' : 'auto',
lineHeight: 1.5,
margin: 0,
}}
dangerouslySetInnerHTML={{ __html: highlight(code, lang) }}
/>
);