-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from andela/ft-create-navbar-165180332
#165180332 Create Navbar component
- Loading branch information
Showing
7 changed files
with
146 additions
and
3 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
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,32 @@ | ||
import React from 'react'; | ||
import { | ||
Button, Container, Form, FormControl, Image, Nav, Navbar, Row, | ||
} from 'react-bootstrap'; | ||
|
||
import authors from '../../img/authors.png'; | ||
|
||
const NavbarInstance = () => ( | ||
<Navbar bg="light" expand="lg" className="navbar navbar-expand-lg navbar-dark bg-dark" fixed="top"> | ||
<Image src={authors} alt="logo" width="90" responsive="true" /> | ||
<Navbar.Toggle aria-controls="basic-navbar-nav" /> | ||
<Navbar.Collapse id="basic-navbar-nav"> | ||
<Container> | ||
<Row> | ||
<Nav className="mr-auto"> | ||
<Nav.Link href="#home">Home</Nav.Link> | ||
<Nav.Link href="#top">Newest</Nav.Link> | ||
<Nav.Link href="#top">Technology</Nav.Link> | ||
<Nav.Link href="#top">Local</Nav.Link> | ||
</Nav> | ||
<Form inline> | ||
<FormControl type="text" placeholder="Search" className="mr-sm-2" /> | ||
<Button variant="outline-success">Search</Button> | ||
</Form> | ||
</Row> | ||
</Container> | ||
|
||
</Navbar.Collapse> | ||
</Navbar> | ||
); | ||
|
||
export default NavbarInstance; |
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,87 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Should render Navbar 1`] = ` | ||
<Bootstrap(undefined) | ||
bg="light" | ||
className="navbar navbar-expand-lg navbar-dark bg-dark" | ||
expand="lg" | ||
fixed="top" | ||
> | ||
<Bootstrap(Image) | ||
alt="logo" | ||
responsive="true" | ||
src="authors.png" | ||
width="90" | ||
/> | ||
<NavbarToggle | ||
aria-controls="basic-navbar-nav" | ||
as="button" | ||
label="Toggle navigation" | ||
/> | ||
<NavbarCollapse | ||
id="basic-navbar-nav" | ||
> | ||
<Container | ||
as="div" | ||
fluid={false} | ||
> | ||
<Bootstrap(Row)> | ||
<Nav | ||
as="div" | ||
className="mr-auto" | ||
fill={false} | ||
justify={false} | ||
> | ||
<NavLink | ||
as={[Function]} | ||
disabled={false} | ||
href="#home" | ||
> | ||
Home | ||
</NavLink> | ||
<NavLink | ||
as={[Function]} | ||
disabled={false} | ||
href="#top" | ||
> | ||
Newest | ||
</NavLink> | ||
<NavLink | ||
as={[Function]} | ||
disabled={false} | ||
href="#top" | ||
> | ||
Technology | ||
</NavLink> | ||
<NavLink | ||
as={[Function]} | ||
disabled={false} | ||
href="#top" | ||
> | ||
Local | ||
</NavLink> | ||
</Nav> | ||
<Form | ||
as="form" | ||
inline={true} | ||
> | ||
<FormControl | ||
as="input" | ||
className="mr-sm-2" | ||
placeholder="Search" | ||
type="text" | ||
/> | ||
<Button | ||
active={false} | ||
disabled={false} | ||
type="button" | ||
variant="outline-success" | ||
> | ||
Search | ||
</Button> | ||
</Form> | ||
</Bootstrap(Row)> | ||
</Container> | ||
</NavbarCollapse> | ||
</Bootstrap(undefined)> | ||
`; |
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,8 @@ | ||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import NavbarInstance from './Navbar'; | ||
|
||
test('Should render Navbar', () => { | ||
const wrapper = shallow(<NavbarInstance />); | ||
expect(wrapper).toMatchSnapshot(); | ||
}); |
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.