Skip to content

Commit 276999c

Browse files
author
vikasrohit
committed
AS#101967871059519, Bundle NavBar components to be used by tc-site
-- Added new web pack config for navbar components, to publish it as library -- Fixed issues with NavBar and SearchBar
1 parent a83c598 commit 276999c

File tree

10 files changed

+82
-9
lines changed

10 files changed

+82
-9
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ coverage
77
.idea
88
.env
99
npm-debug.log
10-
.DS_Store
10+
.DS_Store
11+
dist

components/Navbar/Navbar.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import QuickLinks from '../QuickLinks/QuickLinks'
77
import UserDropdownMenu from '../UserDropdownMenu/UserDropdownMenu'
88

99
const primaryNavigationItems = [
10-
{img: '../components/MenuBar/nav-community.svg', text: 'Community', link: 'javascript:;'},
11-
{img: '../components/MenuBar/nav-compete.svg', text: 'Compete', link: 'javascript:;', selected: true},
12-
{img: '../components/MenuBar/nav-learn.svg', text: 'Learn', link: 'javascript:;'}
10+
{img: require('./nav-community.svg'), text: 'Community', link: 'javascript:;'},
11+
{img: require('./nav-compete.svg'), text: 'Compete', link: 'javascript:;', selected: true},
12+
{img: require('./nav-learn.svg'), text: 'Learn', link: 'javascript:;'}
1313
]
1414

1515
class Navbar extends Component {

components/Navbar/Navbar.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ $super-wide: 1376px;
1313
background-color: $navbar-bg;
1414
border-bottom: 1px solid $border-color;
1515
padding: 10px 20px;
16-
position: fixed;
17-
top: 0;
18-
left: 0;
1916
width: 100%;
2017

2118
@media screen and (max-width: $mobile) {
Lines changed: 14 additions & 0 deletions
Loading

components/Navbar/nav-compete.svg

Lines changed: 12 additions & 0 deletions
Loading

components/Navbar/nav-learn.svg

Lines changed: 18 additions & 0 deletions
Loading

components/SearchBar/SearchBar.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ $active-icon-wrap-bg: #888894;
132132
top: 43px;
133133
left: 0;
134134
width: 100%;
135+
z-index: 1000;
135136

136137
strong {
137138
font-weight: 600;

index.coffee

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1+
Router = require './components/Router/Router.cjsx'
2+
13
module.exports =
24
default: require './components/FileUploader/FileUploaderContainer.cjsx'
5+
NavBar: require './components/Navbar/Navbar.jsx'
6+
SearchBar: require './components/SearchBar/SearchBar.jsx'
7+
UserDropdown: require './components/UserDropdownMenu/UserDropdownMenu.jsx'
8+
TCFooter: require './components/TCFooter/TCFooter.jsx'

navbar.webpack.config.coffee

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
webpackConfig = require 'appirio-tech-webpack-config'
2+
webpack = require('webpack')
3+
4+
config = webpackConfig
5+
dirname: __dirname
6+
template: './index.html'
7+
entry:
8+
TCNavComponents: [
9+
'./index.coffee'
10+
]
11+
12+
config.output.filename = 'TCNavComponents.[name].js';
13+
config.output.publicPath = 'http://local.topcoder.com/mf/js/app/header/partials/'
14+
config.output.libraryTarget = 'var'
15+
console.log config.output
16+
17+
18+
config.externals = {"react" : "React"}
19+
20+
module.exports = config

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"build": "webpack --config webpack.config.js; cp example/index.html dist/",
2525
"lint": "eslint --ext .js,.jsx .",
2626
"test": "cross-env NODE_ENV=test mocha --reporter progress --compilers js:babel-core/register --require ignore-styles --recursive \"./components/**/*.spec.js\"",
27-
"test:watch": "npm run test -- --watch"
27+
"test:watch": "npm run test -- --watch",
28+
"build-navbar": "webpack --config navbar.webpack.config.coffee; cp index.html dist/",
2829
},
2930
"dependencies": {
3031
"appirio-styles": "0.0.25",
@@ -38,6 +39,9 @@
3839
"react-dom": "^0.14.7",
3940
"react-dropzone": "^3.3.2",
4041
"react-redux": "^4.2.1",
41-
"react-select": "^0.9.1"
42+
"react-select": "^0.9.1",
43+
"url-loader": "^0.5.7",
44+
"img-loader": "^1.2.0",
45+
"file-loader": "^0.8.4"
4246
}
4347
}

0 commit comments

Comments
 (0)