Skip to content

Commit

Permalink
chore: 🧹some more clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
aum-deriv committed Jan 26, 2024
1 parent aae8fcb commit 6272d25
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
25 changes: 25 additions & 0 deletions lib/components/PageLayout/PageLayout.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.page-layout {
width: 100%;
display: flex;
gap: 1.5rem;
padding-top: 1.5rem;

@include mobile {
flex-direction: column;
}

&__left {
display: flex;
flex-direction: column;
}

&__content {
display: flex;
flex-direction: column;
}

&__right {
display: flex;
flex-direction: column;
}
}
18 changes: 18 additions & 0 deletions lib/components/PageLayout/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react';
import { useDevice } from '../../hooks/useDevice';
import './PageLayout.scss';

type PageLayoutProps = {
left?: JSX.Element;
right?: JSX.Element;
};

export const PageLayout: React.FC<React.PropsWithChildren<PageLayoutProps>> = ({children, left, right}) => {
const {isMobile} = useDevice();

return <div className="page-layout">
{left && !isMobile && <div className="page-layout__left">{left}</div>}
{children && <div className="page-layout__content">{children}</div>}
{right && <div className="page-layout__right">{right}</div>}
</div>
}

0 comments on commit 6272d25

Please sign in to comment.