mirror of https://github.com/fspc/workstand.git
Drew Larson
9 years ago
10 changed files with 153 additions and 22 deletions
@ -0,0 +1,41 @@ |
|||
import React from 'react'; |
|||
import ReactDOM from 'react-dom'; |
|||
import Autocomplete from 'react-toolbox/lib/autocomplete'; |
|||
|
|||
const source = { |
|||
'ES-es': 'Spain', |
|||
'TH-th': 'Thailand', |
|||
'EN-gb': 'England', |
|||
'EN-en': 'USA' |
|||
}; |
|||
|
|||
class AutocompleteTest extends React.Component { |
|||
state = { |
|||
countries: ['ES-es', 'TH-th'] |
|||
}; |
|||
|
|||
handleChange = (value) => { |
|||
this.setState({countries: value}); |
|||
}; |
|||
|
|||
render () { |
|||
return ( |
|||
<Autocomplete |
|||
direction="down" |
|||
selectedPosition="above" |
|||
label="Choose countries" |
|||
onChange={this.handleChange} |
|||
source={source} |
|||
value={this.state.countries} |
|||
/> |
|||
); |
|||
} |
|||
} |
|||
|
|||
class App extends React.Component { |
|||
render () { |
|||
return (<AutocompleteTest />) |
|||
} |
|||
} |
|||
|
|||
ReactDOM.render(<App />, document.getElementById('root')); |
@ -1 +1,7 @@ |
|||
{% extends 'base.html' %} |
|||
{% load render_bundle from webpack_loader %} |
|||
|
|||
{% block content %} |
|||
<div id="root"></div> |
|||
{% render_bundle 'main' %} |
|||
{% endblock %} |
@ -0,0 +1,34 @@ |
|||
{ |
|||
"name": "workstand", |
|||
"version": "0.0.1", |
|||
"description": "A membership management app for the BCBC.", |
|||
"main": "index.js", |
|||
"scripts": { |
|||
"test": "echo \"Error: no test specified\" && exit 1" |
|||
}, |
|||
"author": "", |
|||
"license": "ISC", |
|||
"devDependencies": { |
|||
"babel": "^6.5.2", |
|||
"babel-core": "^6.9.1", |
|||
"babel-loader": "^6.2.4", |
|||
"babel-preset-es2015": "^6.9.0", |
|||
"babel-preset-react": "^6.5.0", |
|||
"babel-preset-stage-0": "^6.5.0", |
|||
"css-loader": "^0.23.1", |
|||
"extract-text-webpack-plugin": "^1.0.1", |
|||
"i": "^0.3.5", |
|||
"node-sass": "^3.4.2", |
|||
"normalize.css": "^4.1.1", |
|||
"postcss-loader": "^0.9.1", |
|||
"react": "^15.1.0", |
|||
"react-addons-css-transition-group": "^15.1.0", |
|||
"react-dom": "^15.1.0", |
|||
"react-toolbox": "^0.16.2", |
|||
"sass-loader": "^3.2.0", |
|||
"style-loader": "^0.13.1", |
|||
"toolbox-loader": "0.0.3", |
|||
"webpack": "^1.13.1", |
|||
"webpack-bundle-tracker": "0.0.93" |
|||
} |
|||
} |
@ -0,0 +1 @@ |
|||
{"status":"done","chunks":{"main":[{"name":"main-68cfa02cc7400e2d6bcc.js","path":"/Users/drew/Development/bikeshop/bikeshop_project/assets/bundles/main-68cfa02cc7400e2d6bcc.js"},{"name":"react-toolbox.css","path":"/Users/drew/Development/bikeshop/bikeshop_project/assets/bundles/react-toolbox.css"}]}} |
@ -0,0 +1,48 @@ |
|||
const path = require("path"); |
|||
const webpack = require('webpack'); |
|||
const BundleTracker = require('webpack-bundle-tracker'); |
|||
const ExtractTextPlugin = require('extract-text-webpack-plugin'); |
|||
const autoprefixer = require('autoprefixer'); |
|||
|
|||
module.exports = { |
|||
context: __dirname, |
|||
devtool: 'inline-source-map', |
|||
entry: './assets/js/index', // entry point of our app. assets/js/index.js should require other js modules and dependencies it needs
|
|||
|
|||
output: { |
|||
path: path.resolve('./assets/bundles/'), |
|||
filename: "[name]-[hash].js" |
|||
}, |
|||
|
|||
plugins: [ |
|||
new BundleTracker({filename: './webpack-stats.json'}), |
|||
new ExtractTextPlugin('react-toolbox.css', { allChunks: true }), |
|||
new webpack.NoErrorsPlugin() |
|||
], |
|||
|
|||
module: { |
|||
loaders: [ |
|||
{ |
|||
test: /\.jsx?$/, |
|||
exclude: /node_modules/, |
|||
loader: 'babel-loader', |
|||
query: { |
|||
presets: ['es2015', 'stage-0', 'react'] |
|||
} |
|||
}, |
|||
{ |
|||
test: /(\.scss|\.css)$/, |
|||
loader: ExtractTextPlugin.extract('style', 'css?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss!sass?sourceMap!toolbox') |
|||
} |
|||
] |
|||
}, |
|||
resolve: { |
|||
modulesDirectories: [ |
|||
'node_modules', |
|||
'bower_components', |
|||
path.resolve(__dirname, './node_modules') |
|||
], |
|||
extensions: ['', '.js', '.jsx', '.scss'] |
|||
}, |
|||
postcss: [autoprefixer] |
|||
} |
Loading…
Reference in new issue