Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
fix: set correct display for layout
Browse files Browse the repository at this point in the history
  • Loading branch information
tilmx committed Feb 11, 2019
1 parent 4b10499 commit 4ebddcc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/layout/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface LayoutProps {
/** @name Background color @default transparent */ backgroundColor?: string;
center?: boolean;
children?: React.ReactNode;
className?: string;
}

export enum LayoutDirection {
Expand All @@ -16,10 +17,10 @@ export enum LayoutDirection {
}

export const Layout = styled.div<LayoutProps>`
display: flex;
display: ${props => (props.direction === LayoutDirection.Vertical ? "block" : "flex")};
position: relative;
margin: 0 ${props => (props.center && "auto") || ""};
width: ${props => props.width || "auto"};
max-width: ${props => props.maxWidth || "none"};
background-color: ${props => props.backgroundColor || "none"};
flex-direction: ${props => (props.direction === LayoutDirection.Vertical ? "column" : "row")};
`;

1 comment on commit 4ebddcc

@marionebl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.