This repository houses new Topcoder pages, using React, Redux, and Webpack.
We use node 5.x and npm 3.x, so you may need to download a new version of node. The easiest way is to download nvm. We have a .nvmrc
file in the root of the project, so you can just run nvm use
to switch to the correct version of node.
Install dependencies by running the following in the root of the project:
npm i
npm -v
to ensure you have a 3.x version.npm start
and head to http://localhost:3000/search/challenges
npm test
or use npm run test:watch
to rerun tests after files changenpm run lint
npm run build
To contribute to the repository, please create a feature branch off of the dev branch. Once you're finished working on the feature, make a pull request to merge it into dev. Please make sure that every pull request has passed the build checks, which appear just before the "Merge pull request" button in github.
Checkout the code and comments in src/components/ExampleComponent
for an example React component, .scss
file, and tests.
React
classnames
for dynamic classes. See ExampleComponent
for an example.JavaScript
i
or err
.lodash
and functional JavaScript if it makes the code clearer..eslintrc.json
npm run lint
to check your code against the linterSCSS Files
@import 'topcoder/tc-includes;'
at the top of your .scss
file. Locally, you can look in ./node_modules/appirio-styles/styles/topcoder/_tc-colors.scss
to find many colors already defined (e.g. #A3A3AE
=> $accent-gray
)When adding media queries, nest them inside the element, rather than creating a new section
@import 'topcoder/tc-includes;'
$my-local-var: 50px;
.box {
height: $my-local-var;
width: 50px;
color: $medium-gray;
@media screen and (min-width: 768px) {
height: 100px;
width: 100px;
color: $dark-gray;
}
.inside-box {
font-size: 14px;
@media screen and (min-width: 768px) {
font-size: 18px;
}
}
}
npm test
will run the current testsnpm run test:watch
will rerun tests when files changeComponentName.spec.js
/src/components
.js
extensionView
from the menuSyntax -> Open all with current extension as...
Babel -> JavaScript (Babel)
.jsx
Sublime Text -> Preferences -> Settings-User
(⌘ + ,
on Mac)
{
"color_scheme": "Packages/Oceanic Next Color Scheme/Oceanic Next.tmTheme",
"theme": "Oceanic Next.sublime-theme"
}
SublimeLinter-contrib-eslint
div.cool-class
becomes <div className="cool-class"></div>
a
becomes <a href="https://github.com/appirio-tech/topcoder-app-r/blob/dev/"></a>
className
instead of class
reg_replace.sublime-settings
by navigating to Sublime Text -> Preferences -> Package Settings -> Reg Replace -> Settings-User