Files
flipper/src/ui/components/Heading.js
Daniel Büchele 95a7298d21 updating UI documentation
Summary:
adding documentation for more of our UI components.

Deleted some unused components, which were not working anyways.

Reviewed By: jknoxville

Differential Revision: D12896109

fbshipit-source-id: 959c7864240883869ad67283f80a3c189b94bf00
2018-11-05 03:12:23 -08:00

45 lines
928 B
JavaScript

/**
* Copyright 2018-present Facebook.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
* @format
*/
import styled from '../styled/index.js';
const LargeHeading = styled('div')({
fontSize: 18,
fontWeight: 'bold',
lineHeight: '20px',
borderBottom: '1px solid #ddd',
marginBottom: 10,
});
const SmallHeading = styled('div')({
fontSize: 12,
color: '#90949c',
fontWeight: 'bold',
marginBottom: 10,
textTransform: 'uppercase',
});
/**
* A heading component.
*/
export default function Heading(props: {
/**
* Level of the heading. A number from 1-6. Where 1 is the largest heading.
*/
level?: number,
/**
* Children.
*/
children?: React$Node,
}) {
if (props.level === 1) {
return <LargeHeading>{props.children}</LargeHeading>;
} else {
return <SmallHeading>{props.children}</SmallHeading>;
}
}