-
Notifications
You must be signed in to change notification settings - Fork 0
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 #3 from PyConColombia/navbar
Navbar component , Data filtering based on language
- Loading branch information
Showing
66 changed files
with
845 additions
and
632 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,6 @@ | ||
{ | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": true | ||
} | ||
} |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
|
@@ -5,3 +5,4 @@ | |
*/ | ||
|
||
// You can delete this file if you're not using it | ||
import 'bootstrap/dist/css/bootstrap.min.css'; |
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
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,38 +1,80 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { Navbar, Nav, NavDropdown } from 'react-bootstrap'; | ||
import { injectIntl, Link } from 'gatsby-plugin-intl'; | ||
import Language from './language'; | ||
import Logo from '../../assets/icon.svg'; | ||
|
||
import 'bootstrap/dist/css/bootstrap.min.css'; | ||
|
||
const SiteBar = () => { | ||
const YEARS = ['2020', '2019', '2018', '2017']; | ||
const SiteBar = ({ intl }) => { | ||
return ( | ||
<Navbar collapseOnSelect expand="lg" bg="light" variant="light" fixed="top"> | ||
<Navbar.Brand href="#home">React-Bootstrap</Navbar.Brand> | ||
<Navbar | ||
collapseOnSelect | ||
className="navbar" | ||
expand="lg" | ||
// bg="light" | ||
variant="light" | ||
fixed="top" | ||
> | ||
<Navbar.Brand> | ||
<Logo style={{ width: '50px' }} /> | ||
</Navbar.Brand> | ||
<Navbar.Toggle aria-controls="responsive-navbar-nav" /> | ||
<Navbar.Collapse id="responsive-navbar-nav"> | ||
<Nav className="mr-auto"> | ||
<Nav.Link href="#features">Features</Nav.Link> | ||
<Nav.Link href="#pricing">Pricing</Nav.Link> | ||
<NavDropdown title="Dropdown" id="collasible-nav-dropdown"> | ||
<NavDropdown.Item href="#action/3.1">Action</NavDropdown.Item> | ||
<NavDropdown.Item href="#action/3.2"> | ||
Another action | ||
<Nav.Link as="h6"> | ||
<Link to="/resources" className="navbar_a"> | ||
{intl.formatMessage({ id: 'navbar.resources' })} | ||
</Link> | ||
</Nav.Link> | ||
<NavDropdown | ||
title={intl.formatMessage({ id: 'navbar.schedule.main' })} | ||
id="collasible-nav-dropdown" | ||
className="navbar_a" | ||
> | ||
<NavDropdown.Item as="h6"> | ||
<Link to="/schedule"> | ||
{intl.formatMessage({ id: 'navbar.schedule.op1' })} | ||
</Link> | ||
</NavDropdown.Item> | ||
<NavDropdown.Item href="#action/3.3">Something</NavDropdown.Item> | ||
<NavDropdown.Divider /> | ||
<NavDropdown.Item href="#action/3.4"> | ||
Separated link | ||
<NavDropdown.Item as="h6"> | ||
<Link to="/keynotes"> | ||
{intl.formatMessage({ id: 'navbar.schedule.op2' })} | ||
</Link> | ||
</NavDropdown.Item> | ||
<NavDropdown.Item as="h6"> | ||
<Link to="/speakers"> | ||
{intl.formatMessage({ id: 'navbar.schedule.op3' })} | ||
</Link> | ||
</NavDropdown.Item> | ||
</NavDropdown> | ||
<Nav.Link as="h6" className="cfp"> | ||
<Link to="/cfp"> | ||
{intl.formatMessage({ id: 'navbar.proposals' })} | ||
</Link> | ||
</Nav.Link> | ||
</Nav> | ||
<Nav> | ||
<Nav.Link href="#deets">More deets</Nav.Link> | ||
<Nav.Link eventKey={2} href="#memes"> | ||
Dank memes | ||
</Nav.Link> | ||
<NavDropdown title="v.2021" id="collasible-nav-dropdown"> | ||
{YEARS.map((year) => ( | ||
<NavDropdown.Item | ||
key={year} | ||
href={`http://${year}.pycon.co`} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
{`v.${year}`} | ||
</NavDropdown.Item> | ||
))} | ||
</NavDropdown> | ||
<Language /> | ||
</Nav> | ||
</Navbar.Collapse> | ||
</Navbar> | ||
); | ||
}; | ||
|
||
export default SiteBar; | ||
SiteBar.propTypes = { | ||
intl: PropTypes.object, | ||
}; | ||
export default injectIntl(SiteBar); |
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,52 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { | ||
IntlContextConsumer, | ||
changeLocale, | ||
injectIntl, | ||
} from 'gatsby-plugin-intl'; | ||
import { NavDropdown } from 'react-bootstrap'; | ||
|
||
const languageName = { | ||
es: 'Español', | ||
en: 'English', | ||
}; | ||
|
||
const Language = ({ intl }) => { | ||
const languageClick = (e, language) => { | ||
e.preventDefault(); | ||
changeLocale(language); | ||
}; | ||
return ( | ||
<NavDropdown | ||
title={intl.locale.toUpperCase()} | ||
id="collasible-nav-dropdown" | ||
style={{ margin: '0 2.5em' }} | ||
> | ||
<IntlContextConsumer> | ||
{({ languages, language: currentLocale }) => | ||
languages.map((language) => ( | ||
<NavDropdown.Item | ||
key={language} | ||
onClick={(e) => languageClick(e, language)} | ||
style={{ | ||
color: currentLocale === language ? `yellow` : `black`, | ||
}} | ||
// margin: 10, | ||
// textDecoration: `underline`, | ||
// cursor: `pointer`, | ||
// }} | ||
href="/" | ||
> | ||
{languageName[language]} | ||
</NavDropdown.Item> | ||
)) | ||
} | ||
</IntlContextConsumer> | ||
</NavDropdown> | ||
); | ||
}; | ||
Language.propTypes = { | ||
intl: PropTypes.object, | ||
}; | ||
export default injectIntl(Language); |
Oops, something went wrong.