-
Notifications
You must be signed in to change notification settings - Fork 101
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
4509078
commit 9d725a6
Showing
3 changed files
with
40 additions
and
23 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React, { useState } from 'react'; | ||
import { Navbar } from 'react-bootstrap'; | ||
import Home from '../../pages/home/Home'; | ||
import Header from '../../components/header/Header'; | ||
|
||
function HeaderHomeLayout ({ children }) { | ||
//This State will keep Track of what is entered in the searchField | ||
const [searchField, setSearchField] = useState(''); | ||
|
||
//updating the State from Header Component which further updating itself from HeaderSearchBar.js | ||
let inputHandler = (event) => { | ||
setSearchField(event.target.value); | ||
}; | ||
|
||
return ( | ||
<div> | ||
<Header inputHandler={inputHandler} /> | ||
<Navbar /> | ||
<Home text={searchField} /> | ||
<main>{children}</main> | ||
</div> | ||
); | ||
}; | ||
|
||
export default HeaderHomeLayout; |
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 |
---|---|---|
@@ -1,13 +1,16 @@ | ||
import { Header } from 'antd/lib/layout/layout'; | ||
import React from 'react'; | ||
import React, { useState } from 'react'; | ||
import { Navbar } from 'react-bootstrap'; | ||
import Header from '../../components/header/Header'; | ||
|
||
const HeaderWithNavbar = ({ children }) => ( | ||
<div> | ||
<Header /> | ||
<Navbar /> | ||
<main>{children}</main> | ||
</div> | ||
); | ||
function HeaderWithNavbar ({ children }) { | ||
|
||
return ( | ||
<div> | ||
<Header /> | ||
<Navbar /> | ||
<main>{children}</main> | ||
</div> | ||
); | ||
}; | ||
|
||
export default HeaderWithNavbar; |
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