blob: 64bcfec59542e189776f51180b1ba43a1aac826f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
import * as React from 'react';
import styled from 'styled-components';
import { bigText, smallText } from './common-styles';
export const Container = styled.div({
flex: 0,
padding: '2px 22px 20px',
});
export const ContentWrapper = styled.div({
':not(:first-child)': {
paddingTop: '8px',
},
});
export const HeaderTitle = styled.span(bigText);
export const HeaderSubTitle = styled.span(smallText);
interface ISettingsHeaderProps {
children?: React.ReactNode;
className?: string;
}
function SettingsHeader(props: ISettingsHeaderProps, forwardRef: React.Ref<HTMLDivElement>) {
return (
<Container ref={forwardRef} className={props.className}>
{React.Children.map(props.children, (child) => {
return React.isValidElement(child) ? <ContentWrapper>{child}</ContentWrapper> : undefined;
})}
</Container>
);
}
export default React.forwardRef(SettingsHeader);
|