Files
flipper/desktop/flipper-plugin/src/ui/CodeBlock.tsx
Michel Weststrate be3cdedf52 Some UI / docs fine-tuning
Summary: Added wash color option to Toolbar, made codeblocks transparent rather than gray & bordered, which looks cleaner

Reviewed By: passy

Differential Revision: D28119720

fbshipit-source-id: 9d1f4db5b39a91d9d117046bd5482726ac2f555d
2021-05-04 13:50:31 -07:00

35 lines
744 B
TypeScript

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
import React from 'react';
import {Typography} from 'antd';
import styled from '@emotion/styled';
import {ParagraphProps} from 'antd/lib/typography/Paragraph';
export function CodeBlock({children, ...props}: ParagraphProps) {
return (
<StyledParagrah {...props}>
<pre>{children}</pre>
</StyledParagrah>
);
}
const StyledParagrah = styled(Typography.Paragraph)({
padding: 0,
fontSize: '9pt',
'&.ant-typography': {
margin: 0,
},
'& pre': {
margin: 0,
border: 'none',
background: 'none',
},
});