-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2cfa498
commit 8c6102b
Showing
2 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* eslint-disable react/require-default-props */ | ||
import React from 'react'; | ||
import { Layout } from 'antd'; | ||
import PropTypes from 'prop-types'; | ||
import NavHeader from './NavHeader'; | ||
import Sidebar from './Sidebar'; | ||
import PageFooter from './PageFooter'; | ||
import './PageLayout.css'; | ||
|
||
const { Content } = Layout; | ||
|
||
/** | ||
* Function for displaying the landing page | ||
* | ||
* @function | ||
* @param {Function} title controls the title of the page | ||
* @param {Function} isAuthenticated controls if user is authrnticated or not | ||
* @param {Function} children other pages who are children of this layout | ||
* @param {Function} footerPresent displays footer if true | ||
* @param {Function} siderIsPresent displays side for mobile pages | ||
* @return {Object} controlvhe over all layout of the webpage | ||
*/ | ||
export default function PageLayout(props) { | ||
const { | ||
title, | ||
isAuthenticated, | ||
children, | ||
footerPresent, | ||
siderIsPresent, | ||
} = props; | ||
|
||
return ( | ||
<> | ||
<Layout className="LandingPage_layout"> | ||
<NavHeader | ||
title={title || 'Helpme | Connect with Friends'} | ||
isAuthenticated={isAuthenticated} | ||
/> | ||
<Content className="PageLayout_body"> | ||
<Layout hasSider> | ||
<Sidebar siderIsPresent={siderIsPresent} /> | ||
<Content className="PageLayout_content"> | ||
{children} | ||
</Content> | ||
</Layout> | ||
</Content> | ||
</Layout> | ||
{footerPresent ? <PageFooter /> : null} | ||
</> | ||
); | ||
} | ||
|
||
PageLayout.propTypes = { | ||
children: PropTypes.node, | ||
footerPresent: PropTypes.bool, | ||
isAuthenticated: PropTypes.bool, | ||
siderIsPresent: PropTypes.bool, | ||
title: PropTypes.string, | ||
}; |