-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Showing
7 changed files
with
235 additions
and
6 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,68 @@ | ||
import React from 'react'; | ||
import { Navbar, Nav, NavDropdown } from 'react-bootstrap'; | ||
import { LinkContainer } from 'react-router-bootstrap'; | ||
import Avatar from './Avatar'; | ||
import '../css/dropdown.css'; | ||
import menu from '../constants/navMenu'; | ||
|
||
const DownIcon = () => ( | ||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-down" viewBox="0 0 16 16"> | ||
<path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708"/> | ||
</svg> | ||
); | ||
|
||
export default function NavBar () { | ||
// const menu = ['Learn', 'Submit', 'Individuals', 'Sightings', 'Encounters', 'Administers']; | ||
|
||
return (<Navbar variant="dark" expand="lg" style={{ | ||
width: '100%', | ||
display: 'flex', | ||
justifyContent: 'space-between' }}> | ||
<Navbar.Brand href="#home" style={{ marginLeft: '1rem' }}>Amphibian Wildbook</Navbar.Brand> | ||
<Navbar.Toggle aria-controls="basic-navbar-nav" /> | ||
<Navbar.Collapse id="basic-navbar-nav" style={{marginLeft: '20%'}}> | ||
<Nav className="mr-auto" style={{ display: 'flex', justifyContent: 'flex-end', width: '100%' }}> | ||
{menu.map((item, idx) => ( | ||
<Nav className="me-auto"> | ||
<NavDropdown title={ | ||
<span style={{color: 'white'}}> | ||
{Object.keys(item)[0]} | ||
<DownIcon /> | ||
</span>} id={`basic-nav-dropdown${item}`} | ||
style={{color: 'white'}}> | ||
{Object.values(item).map((subItem, idx) => ( | ||
<LinkContainer to={subItem.to}> | ||
<NavDropdown.Item>{subItem.name}</NavDropdown.Item> | ||
</LinkContainer> | ||
))} | ||
|
||
{/* <NavDropdown.Item href="#action/3.1">Action</NavDropdown.Item> | ||
<NavDropdown.Item href="#action/3.2"> | ||
Another action | ||
</NavDropdown.Item> | ||
<NavDropdown.Item href="#action/3.3">Something</NavDropdown.Item> | ||
<NavDropdown.Divider /> | ||
<NavDropdown.Item href="#action/3.4"> | ||
Separated link | ||
</NavDropdown.Item> */} | ||
</NavDropdown> | ||
</Nav> | ||
))} | ||
</Nav> | ||
<Nav style={{ alignItems: 'center', marginLeft: '35px' }}> | ||
<NavDropdown title={<Avatar />} id="basic-nav-dropdown"> | ||
<LinkContainer to="/profile"> | ||
<NavDropdown.Item>Profile</NavDropdown.Item> | ||
</LinkContainer> | ||
<LinkContainer to="/settings"> | ||
<NavDropdown.Item>Settings</NavDropdown.Item> | ||
</LinkContainer> | ||
<NavDropdown.Divider /> | ||
<LinkContainer to="/logout"> | ||
<NavDropdown.Item>Logout</NavDropdown.Item> | ||
</LinkContainer> | ||
</NavDropdown> | ||
</Nav> | ||
</Navbar.Collapse> | ||
</Navbar>) | ||
} |
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,60 @@ | ||
import React from "react"; | ||
|
||
export default function Progress({ name, encounters, progress }) { | ||
return ( | ||
<div style={{ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
justifyContent: 'space-between', | ||
width: '100%', | ||
marginBottom: '10px', | ||
}}> | ||
<div style={{ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
justifyContent: 'flex-start', | ||
alignItems: 'flex-start', | ||
width: '70%', | ||
}}> | ||
<h5>{name}</h5> | ||
<span>{encounters} encounters</span> | ||
</div> | ||
<div style={{ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
justifyContent: 'flex-start', | ||
alignItems: 'flex-start', | ||
width: '70%', | ||
}}> | ||
<div style={{ | ||
width: '100%', | ||
height: '15px', | ||
backgroundColor: 'lightgrey', | ||
borderRadius: '3px', | ||
position: 'relative', | ||
border: '1px solid darkgrey', | ||
}}> | ||
<div style={{ | ||
position: 'relative', | ||
width: `${progress}%`, | ||
height: '13px', | ||
backgroundColor: 'green', | ||
borderRadius: '3px', | ||
}}> | ||
|
||
<span style={{ | ||
position: 'absolute', | ||
top: '50%', | ||
left: '50%', | ||
transform: 'translate(-50%, -50%)', | ||
color: 'white', | ||
fontSize: '0.8em', | ||
}}> | ||
{progress}% | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |
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 @@ | ||
export default menu = [ | ||
{'Learn': [ | ||
{name: 'About Wildbook', to: '/about'}, | ||
{name: 'Citing Wildbook', to: '/citing.jsp'}, | ||
{name: 'Wildbook for Birds', to: '/about'}, | ||
{name: 'Wildbook for Sharks', to: '/about'}, | ||
]}, | ||
{'Submit': [ | ||
{name: 'Report a Sighting', to: '/submit'}, | ||
{name: 'Bulk Import', to: '/submit'}, | ||
]}, | ||
{'Individuals': [ | ||
{name: 'Search', to: '/individuals'}, | ||
{name: 'Add Individual', to: '/individuals'}, | ||
{name: 'Bulk Import', to: '/individuals'}, | ||
]}, | ||
{'Sightings': [ | ||
{name: 'Search', to: '/sightings'}, | ||
{name: 'Add Sighting', to: '/sightings'}, | ||
{name: 'Bulk Import', to: '/sightings'}, | ||
]}, | ||
{'Encounters': [ | ||
{name: 'Search', to: '/encounters'}, | ||
{name: 'Add Encounter', to: '/encounters'}, | ||
{name: 'Bulk Import', to: '/encounters'}, | ||
]}, | ||
{'Administers': [ | ||
{name: 'Search', to: '/administers'}, | ||
{name: 'Add Administer', to: '/administers'}, | ||
{name: 'Bulk Import', to: '/administers'}, | ||
]}, | ||
] |
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,3 @@ | ||
.dropdown-toggle::after { | ||
display: none !important; | ||
} |