Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion components/ExampleNav/ExampleNavContainer.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ navs =
'ImageViewerExamples'
'LoaderExamples',
'PanelExamples',
'StandardListItemExamples'
'StandardListItemExamples',
'NavbarExample',
'QuickLinksExample'
]
ManageSteps: [
'ManageStepsExamples'
Expand Down
39 changes: 39 additions & 0 deletions components/Navbar/Navbar.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
'use strict'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as 'use strict' / imports comments here 3118fed

import MenuBar from '../MenuBar/MenuBar.jsx'

require('./Navbar.scss')
const React = require('react')
const SearchBar = require('../SearchBar/SearchBar.jsx')
const QuickLinks = require('../QuickLinks/QuickLinks.jsx')
const UserDropdownMenu = require('../UserDropdownMenu/UserDropdownMenu.jsx')

const primaryNavigationItems = [
{img: '../components/MenuBar/nav-community.svg', text: 'Community', link: 'javascript:;'},
{img: '../components/MenuBar/nav-compete.svg', text: 'Compete', link: 'javascript:;', selected: true},
{img: '../components/MenuBar/nav-learn.svg', text: 'Learn', link: 'javascript:;'}
]

const Navbar = {
render() {
const dom = (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Return jsx code directly (no dom var)

<div className="Navbar flex middle space-between">
<div className="topcoder-logo"></div>
<div className="search-bar-wrap">
<div className="icon-placeholder"></div>
<SearchBar />
</div>
<MenuBar items={primaryNavigationItems} mobileBreakPoint={767} orientation="horizontal" />
<div className="collapse-group">
<div className="icon-placeholder"></div>
<div className="quick-links-wrap"><QuickLinks /></div>
<UserDropdownMenu username="vic-tor" />
</div>
</div>
)

return dom
}
}

module.exports = React.createClass(Navbar)
121 changes: 121 additions & 0 deletions components/Navbar/Navbar.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
@import "work/work-includes";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use topcoder/tc-includes instead


$navbar-bg: #FAFAFB;
$border-color: #CFCFD2;
$placeholder-bg: #B47DD6;

$iphone6: 768px;

.Navbar {
height: 60px;
background-color: $navbar-bg;
border-bottom: 1px solid $border-color;
padding: 10px 20px;
position: fixed;
top: 0;
left: 0;
width: 100%;

@media screen and (max-width: $iphone6) {
height: 40px;
padding-top: 0;
padding-bottom: 0;
}

.topcoder-logo {
width: 56px;
height: 24px;
background-color: $placeholder-bg;
margin-right: 40px;
flex: 0 0 auto;

@media screen and (min-width: 1376px) {
width: 155px;
}

@media screen and (max-width: $iphone6) {
width: 40px;
margin-right: 26px;
order: 1;
}
}

.search-bar-wrap {
.icon-placeholder {
display: none;

@media screen and (max-width: $iphone6) {
display: block;
height: 25px;
width: 25px;
background-color: $placeholder-bg;
margin: 9.5px;
order: 2;
}
}

.SearchBar {
margin-right: 45px;
max-width: 789px;

@media screen and (max-width: $iphone6) {
display: none;
}
}
}

.MenuBar {
margin-right: 30px;

@media screen and (max-width: $iphone6) {
order: 1;
}
}

.collapse-group {
flex: 1 0 auto;
position: relative;

@media screen and (max-width :$iphone6) {
width: 43px;
height: 43px;
background-color: #A3A3AE;
order: 3;
}

.icon-placeholder {
display: none;

@media screen and (max-width: $iphone6) {
display: initial;
height: 24px;
width: 24px;
background-color: $placeholder-bg;
margin: 10px;
}
}

.quick-links-wrap {
margin-right: 30px;
display: inline-block;

@media screen and (max-width: $iphone6) {
display: none;
}

.Dropdown {
right: -46px;
top: 10px;
}
}

.UserDropdownMenu {
flex-shrink: 0;
background-color: transparent;

@media screen and (max-width: $iphone6) {
display: none;
}
}
}
}
12 changes: 12 additions & 0 deletions components/Navbar/NavbarExample.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use strict'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comments as above regarding use strict/imports

const Navbar = require('./Navbar.jsx')
const React = require('react')

const NavbarExample = {
render() {
return <Navbar />
}
}

module.exports = React.createClass(NavbarExample)
8 changes: 7 additions & 1 deletion components/Router/Router.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ ManageStepsExamples = require '../ManageSteps/ManageStepsExamples.cjsx
StepRowExamples = require '../StepRow/StepRowExamples.cjsx'
PanelExamples = require '../Panel/PanelExamples.jsx'
StandardListItemExamples = require '../StandardListItem/StandardListItemExamples.cjsx'
NavbarExample = require '../Navbar/NavbarExample.jsx'
QuickLinksExample = require '../QuickLinks/QuickLinksExample.jsx'

{ Router, Route, Link, IndexRoute, browserHistory } = require 'react-router'

Expand Down Expand Up @@ -51,8 +53,12 @@ component = ->
<Route path="/PanelExamples" component={PanelExamples} />

<Route path="/StandardListItemExamples" component={StandardListItemExamples} />

<Route path="/NavbarExample" component={NavbarExample} />

<Route path="/QuickLinksExample" component={QuickLinksExample} />
</Route>
</Router>
</Provider>

module.exports = component
module.exports = component