diff --git a/components/Navbar/Navbar.jsx b/components/Navbar/Navbar.jsx index 7c8f84834..8a2a7a887 100755 --- a/components/Navbar/Navbar.jsx +++ b/components/Navbar/Navbar.jsx @@ -1,35 +1,33 @@ require('./Navbar.scss') import MenuBar from '../MenuBar/MenuBar' -import React, { Component } from 'react' +import React from 'react' import SearchBar from '../SearchBar/SearchBar' import QuickLinks from '../QuickLinks/QuickLinks' import UserDropdownMenu from '../UserDropdownMenu/UserDropdownMenu' const primaryNavigationItems = [ - {img: require('./nav-community.svg'), text: 'Community', link: 'javascript:;'}, - {img: require('./nav-compete.svg'), text: 'Compete', link: 'javascript:;', selected: true}, - {img: require('./nav-learn.svg'), text: 'Learn', link: 'javascript:;'} + {img: require('./nav-community.svg'), text: 'Community', link: '/community'}, + {img: require('./nav-compete.svg'), text: 'Compete', link: '/compete', selected: true}, + {img: require('./nav-learn.svg'), text: 'Learn', link: '/learn'} ] -class Navbar extends Component { - render() { - return ( -
-
-
-
- -
- -
-
-
- -
+const Navbar = ({username, domain}) => { + return ( +
+
+
+
+
- ) - } + +
+
+
+ +
+
+ ) } export default Navbar diff --git a/components/Navbar/NavbarExample.jsx b/components/Navbar/NavbarExample.jsx index 9aba6f991..c90bee489 100755 --- a/components/Navbar/NavbarExample.jsx +++ b/components/Navbar/NavbarExample.jsx @@ -2,7 +2,7 @@ import Navbar from './Navbar' import React from 'react' const NavbarExample = () => ( - + ) module.exports = NavbarExample diff --git a/components/QuickLinks/QuickLinks.jsx b/components/QuickLinks/QuickLinks.jsx index fcec8056d..94db46460 100644 --- a/components/QuickLinks/QuickLinks.jsx +++ b/components/QuickLinks/QuickLinks.jsx @@ -1,34 +1,32 @@ require('./QuickLinks.scss') -import React, { Component } from 'react' +import React from 'react' import Dropdown from '../Dropdown/Dropdown' import StandardListItem from '../StandardListItem/StandardListItem' -class QuickLinks extends Component { - render() { - return ( -
- - -
    -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
-
-
- ) - } +const QuickLinks = ({domain}) => { + const orLink = '//software.' + domain + const arenaLink = '//arena.' + domain + const arenaAppletLink = '//' + domain + '/contest/arena/ContestAppletProd.jnlp' + return ( +
+ + +
    +
  • + +
  • +
  • + +
  • +
  • + +
  • +
+
+
+ ) } export default QuickLinks \ No newline at end of file diff --git a/components/QuickLinks/QuickLinks.scss b/components/QuickLinks/QuickLinks.scss index 18238b450..8f1490c84 100644 --- a/components/QuickLinks/QuickLinks.scss +++ b/components/QuickLinks/QuickLinks.scss @@ -1,6 +1,6 @@ @import "topcoder/tc-includes"; -$logo-placeholder-bg: #B47DD6; +$link-text-hover-color: #7A7F83; .QuickLinks { position: relative; @@ -22,22 +22,22 @@ $logo-placeholder-bg: #B47DD6; .dropdown-menu-list-item { display: inline-block; - cursor: pointer; - - .icon-placeholder { - width: 30px; - height: 30px; - background-color: $logo-placeholder-bg; - margin: 0 auto; - margin-bottom: 6px; - } + cursor: pointer; .StandardListItem { padding: 0; + &:active, + &:hover { + .label { + color: $link-text-hover-color; + } + } + .label { font-size: 12px; line-height: 26px; + color: $accent-gray-dark; } } } diff --git a/components/QuickLinks/QuickLinksExample.jsx b/components/QuickLinks/QuickLinksExample.jsx index d7ff74f87..4a4727993 100644 --- a/components/QuickLinks/QuickLinksExample.jsx +++ b/components/QuickLinks/QuickLinksExample.jsx @@ -5,7 +5,7 @@ import QuickLinks from './QuickLinks' const QuickLinksExample = () => (
- +
) diff --git a/components/QuickLinks/placeholder.svg b/components/QuickLinks/placeholder.svg new file mode 100644 index 000000000..d3e7220e5 --- /dev/null +++ b/components/QuickLinks/placeholder.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/components/StandardListItem/StandardListItem.jsx b/components/StandardListItem/StandardListItem.jsx index 6e0ff92ed..2e89f2aca 100644 --- a/components/StandardListItem/StandardListItem.jsx +++ b/components/StandardListItem/StandardListItem.jsx @@ -1,4 +1,4 @@ -import {PropTypes, Component } from 'react' +import {PropTypes } from 'react' import React from 'react' require('./StandardListItemStyles.scss') @@ -8,39 +8,45 @@ require('./StandardListItemStyles.scss') // labelText: The text for the label // placeIcon: defines the position of the icon. Either: top | left | right. Default to top -class StandardListItem extends Component { - constructor(props) { - super(props) - } - render() { - const classes = 'StandardListItem transition ' + this.props.placeIcon - let label - let icon +const StandardListItem = ({showIcon, showLabel, imgSrc, labelText, linkUrl, linkTarget='_self', placeIcon='top'}) => { + const classes = 'StandardListItem transition ' + placeIcon + let label + let icon + let item - if (this.props.showLabel){ - label =

{this.props.labelText}

- } + if (showLabel) { + label =

{labelText}

+ } - if (this.props.showIcon){ - icon = - } + if (showIcon) { + icon = + } - return (
{label}{icon}
) + if (linkUrl) { + item = + {label}{icon} + } else { + item =
{label}{icon}
} + + return item } StandardListItem.propTypes = { - showIcon : PropTypes.bool, - showLabel : PropTypes.bool, - imgSrc : PropTypes.string, - labelText : PropTypes.node, - placeIcon : PropTypes.string + showIcon : PropTypes.bool, + showLabel : PropTypes.bool, + imgSrc : PropTypes.string, + labelText : PropTypes.node, + linkUrl : PropTypes.string, + linkTarget : PropTypes.string, + placeIcon : PropTypes.string } StandardListItem.defaultProps = { - showIcon: true, - showLabel: true, - placeIcon: 'top' + showIcon : true, + showLabel : true, + linkTarget : '_self', + placeIcon : 'top' } export default StandardListItem diff --git a/components/StandardListItem/StandardListItemExamples.jsx b/components/StandardListItem/StandardListItemExamples.jsx index f3b30c335..499ac6ccf 100644 --- a/components/StandardListItem/StandardListItemExamples.jsx +++ b/components/StandardListItem/StandardListItemExamples.jsx @@ -16,7 +16,7 @@ const StandardListItemExamples = () => (

Icon on the Right

- +

Icon Hidden

@@ -24,6 +24,18 @@ const StandardListItemExamples = () => (

Label Hidden

+

With Link In Self

+ + +

With Link In New Tab

+ + +

Link: Icon on the Right

+ + +

Link: Icon on the Left

+ +
) diff --git a/components/UserDropdownMenu/UserDropdownMenu.jsx b/components/UserDropdownMenu/UserDropdownMenu.jsx index 0ebf8b393..1269bd9d9 100644 --- a/components/UserDropdownMenu/UserDropdownMenu.jsx +++ b/components/UserDropdownMenu/UserDropdownMenu.jsx @@ -1,6 +1,6 @@ require('./UserDropdownMenu.scss') -import React, { Component } from 'react' +import React from 'react' import Dropdown from '../Dropdown/Dropdown' const userDropdownLists = [ @@ -18,45 +18,38 @@ const userDropdownLists = [ ] ] -class UserDropdownMenu extends Component { - constructor(props) { - super(props) - - this.state = { isLoggedIn: true } - } - - render() { - const publicDOM =
- - const loggedInDOM = ( -
- -
- - { this.props.username } - -
+const UserDropdownMenu = ({username}) => { + + const publicDOM =
-
- { - userDropdownLists.map((list, i) => { - return ( ) - }) - } - -
-
-
- ) - - return this.state.isLoggedIn ? loggedInDOM : publicDOM - } + const loggedInDOM = ( +
+ +
+ + { username } + +
+ +
+ { + userDropdownLists.map((list, i) => { + return ( ) + }) + } + +
+
+
+ ) + + return username ? loggedInDOM : publicDOM } export default UserDropdownMenu \ No newline at end of file diff --git a/components/UserDropdownMenu/UserDropdownMenuExamples.jsx b/components/UserDropdownMenu/UserDropdownMenuExamples.jsx index 0fbc7ea5a..9d4585471 100644 --- a/components/UserDropdownMenu/UserDropdownMenuExamples.jsx +++ b/components/UserDropdownMenu/UserDropdownMenuExamples.jsx @@ -2,7 +2,14 @@ import React from 'react' import UserDropdownMenu from './UserDropdownMenu' const UserDropdownMenuExamples = () => { - return + return ( +
+

Logged In state

+ +

Logged Out state

+ +
+ ) } module.exports = UserDropdownMenuExamples