Skip to content

Fix Issue #104 : change link of Topcoder Logo #92

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions config/webpack/default.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
URL: {
DASH_BOARD: '/my-dashboard',
}
};
5 changes: 4 additions & 1 deletion config/webpack/development.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
const configFactory = require('./lib-development')
const path = require('path')
const webpackMerge = require('webpack-merge')

const defaultConfig = require('./default');

const standardConfig = configFactory({
context: path.resolve(__dirname, '../..'),
entry: './src',
library: 'navigation-component'
})

module.exports = standardConfig
module.exports = webpackMerge.smart(standardConfig, defaultConfig)
5 changes: 4 additions & 1 deletion config/webpack/production.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
const webpackMerge = require('webpack-merge') // eslint-disable-line import/no-extraneous-dependencies

const configFactory = require('./lib-production')
const path = require('path')
const defaultConfig = require('./default')

const standardConfig = configFactory({
context: path.resolve(__dirname, '../..'),
entry: './src',
library: 'navigation-component'
})

module.exports = standardConfig
module.exports = webpackMerge.smart(standardConfig, defaultConfig)
6 changes: 4 additions & 2 deletions src/components/TopNav/MobileNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import PropTypes from 'prop-types'
import styles from './MobileNav.module.scss'
import IconClose from '../../assets/images/icon-close.svg'
import IconMenu from '../../assets/images/icon-menu.svg'
import { config } from 'topcoder-react-utils'

const MobileNav = ({ showLeftMenu, onClickLeftMenu, logo, rightMenu }) => (
const MobileNav = ({ loggedIn, showLeftMenu, onClickLeftMenu, logo, rightMenu }) => (
<div className={styles.mobileNav}>
<div className={styles.leftMenuContainer}>
<button className={styles.menuBtn} onClick={onClickLeftMenu}>
Expand All @@ -15,7 +16,7 @@ const MobileNav = ({ showLeftMenu, onClickLeftMenu, logo, rightMenu }) => (
)}
</button>
</div>
<a href='/'>
<a href={loggedIn ? config.URL.DASH_BOARD : config.URL.BASE}>
{logo}
</a>
{rightMenu && (
Expand All @@ -27,6 +28,7 @@ const MobileNav = ({ showLeftMenu, onClickLeftMenu, logo, rightMenu }) => (
)

MobileNav.propTypes = {
loggedIn: PropTypes.bool,
showLeftMenu: PropTypes.bool,
onClickLeftMenu: PropTypes.func,
logo: PropTypes.node,
Expand Down
5 changes: 4 additions & 1 deletion src/components/TopNav/PrimaryNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ import ResizeDetector from 'react-resize-detector'
import ChosenArrow from '../ChosenArrow'
import IconArrowSmalldown from '../../assets/images/arrow-small-down.svg'
import styles from './PrimaryNav.module.scss'
import { config } from 'topcoder-react-utils'

const PrimaryNav = ({
loggedIn,
collapsed,
showLeftMenu,
logo,
Expand Down Expand Up @@ -36,7 +38,7 @@ const PrimaryNav = ({
<a
className={cn(styles.tcLogo, collapsed && styles.tcLogoPush)}
onClick={onClickLogo}
href='/'
href={loggedIn ? config.URL.DASH_BOARD : config.URL.BASE}
>
{logo}
</a>
Expand Down Expand Up @@ -119,6 +121,7 @@ const PrimaryNav = ({
}

PrimaryNav.propTypes = {
loggedIn: PropTypes.bool,
collapsed: PropTypes.bool,
showLeftMenu: PropTypes.bool,
logo: PropTypes.node,
Expand Down
1 change: 1 addition & 0 deletions src/components/TopNav/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ const TopNav = ({

{/* Primary navigation (level 1 and level 2 menu) */}
<PrimaryNav
loggedIn={loggedIn}
collapsed={collapsed}
showLeftMenu={showLeftMenu}
logo={logo}
Expand Down