aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components/ui/container.tsx
blob: 3b55a18ce2426352e53372a89f257c748f0e3c5f (plain) (blame)
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
35
import * as React from 'react';

type StringOrNum = string | number;

export interface ContainerProps {
    marginTop?: StringOrNum;
    marginBottom?: StringOrNum;
    marginRight?: StringOrNum;
    marginLeft?: StringOrNum;
    paddingTop?: StringOrNum;
    paddingBottom?: StringOrNum;
    paddingRight?: StringOrNum;
    paddingLeft?: StringOrNum;
    backgroundColor?: string;
    borderRadius?: StringOrNum;
    maxWidth?: StringOrNum;
    isHidden?: boolean;
    className?: string;
    position?: 'absolute' | 'fixed' | 'relative' | 'unset';
    top?: string;
    left?: string;
    right?: string;
    bottom?: string;
}

export const Container: React.StatelessComponent<ContainerProps> = ({ children, className, isHidden, ...style }) => {
    const visibility = isHidden ? 'hidden' : undefined;
    return (
        <div style={{ ...style, visibility }} className={className}>
            {children}
        </div>
    );
};

Container.displayName = 'Container';