diff --git a/ui/src/shared/components/overlay/OverlayBody.tsx b/ui/src/shared/components/overlay/OverlayBody.tsx new file mode 100644 index 0000000000..9ae148da93 --- /dev/null +++ b/ui/src/shared/components/overlay/OverlayBody.tsx @@ -0,0 +1,11 @@ +import React, {SFC, ReactNode} from 'react' + +interface Props { + children: ReactNode +} + +const OverlayBody: SFC = ({children}) => ( +
{children}
+) + +export default OverlayBody diff --git a/ui/src/shared/components/overlay/OverlayContainer.tsx b/ui/src/shared/components/overlay/OverlayContainer.tsx new file mode 100644 index 0000000000..14d1d6ac6b --- /dev/null +++ b/ui/src/shared/components/overlay/OverlayContainer.tsx @@ -0,0 +1,30 @@ +import React, {Component, ReactNode, CSSProperties} from 'react' + +interface Props { + children: ReactNode + maxWidth?: number +} + +class OverlayContainer extends Component { + public static defaultProps: Partial = { + maxWidth: 600, + } + + public render() { + const {children} = this.props + + return ( +
+ {children} +
+ ) + } + + private get style(): CSSProperties { + const {maxWidth} = this.props + + return {maxWidth: `${maxWidth}px`} + } +} + +export default OverlayContainer diff --git a/ui/src/shared/components/overlay/OverlayHeading.tsx b/ui/src/shared/components/overlay/OverlayHeading.tsx new file mode 100644 index 0000000000..c37034d16a --- /dev/null +++ b/ui/src/shared/components/overlay/OverlayHeading.tsx @@ -0,0 +1,28 @@ +import React, {PureComponent, ReactChildren} from 'react' + +interface Props { + children?: ReactChildren + title: string + onDismiss?: () => void +} + +class OverlayHeading extends PureComponent { + constructor(props: Props) { + super(props) + } + + public render() { + const {title, onDismiss, children} = this.props + + return ( +
+
{title}
+ {onDismiss && ( +
+ ) + } +} +export default OverlayHeading