Skip to content

Commit

Permalink
Merge pull request #2 from hackforla/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
ryanmswan authored Dec 5, 2019
2 parents 87c3dbc + 62a6b6c commit 08610ce
Show file tree
Hide file tree
Showing 22 changed files with 144 additions and 130 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"dependencies": {
"axios": "^0.19.0",
"babel-jest": "^24.9.0",
"bulma": "^0.8.0",
"dataframe-js": "^1.4.3",
"dotenv-webpack": "^1.7.0",
"gh-pages": "^2.1.1",
Expand Down
44 changes: 11 additions & 33 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,14 @@
import React from 'react';
import Header from './containers/Header/Header.jsx'
import MapContainer from './containers/Map/MapContainer.jsx'
import FrequencyContainer from './containers/Graphs/FrequencyContainer.jsx'
import TimeToCloseContainer from './containers/Graphs/TimeToCloseContainer.jsx'
// import TreeMapVis from './components/TreeMapVis/TreeMapVis.js';
// import CandleStick from './components/CandleStick/CandleStick.js';
// import PinMap from './components/PinMap/PinMap.jsx';
// import HeatMap from './components/HeatMap/HeatMap.js';
// import LoadingSpinner from './components/LoadingSpinner/LoadingSpinner.js';
import Header from './components/main/header/Header';
import Body from './components/main/body/Body';
import Footer from './components/main/footer/Footer';

const App = () => (
<div className="main">
<Header />
<Body />
<Footer />
</div>
);


class App extends React.Component{
constructor(props){
super(props);
this.state = {
loading:false
}
}

handleLoadingChanged = (loadingState) => {
this.setState({loading:loadingState});
}

render(){
return (
<div className="App" >
<Header/>
<MapContainer/>
<TimeToCloseContainer/>
<FrequencyContainer/>
</div>
);
}
}
export default App;
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import Enzyme, {shallow, mount} from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import Legend from '../Legend.jsx';

Enzyme.configure({adapter: new Adapter()});

Expand All @@ -10,8 +9,8 @@ describe('Tree map legend component test suite', () => {
expect(true).toEqual(true);
});

test('renders', () => {
const wrapper = shallow(<Legend />);
expect(wrapper.exists()).toBe(true);
});
// test('renders', () => {
// const wrapper = shallow(<Legend />);
// expect(wrapper.exists()).toBe(true);
// });
});
File renamed without changes
11 changes: 0 additions & 11 deletions src/components/PinMap/PinMap.js

This file was deleted.

7 changes: 5 additions & 2 deletions src/components/PinMap/PinMap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import Choropleth from 'react-leaflet-choropleth';

import constants from '../common/CONSTANTS.js';
import { getDataResources } from '../../Util/DataService.js';
import DatePicker from '../common/dataPicker.jsx';

import neighborhoodOverlay from '../../data/la-county-neighborhoods-v6.json';
import municipalOverlay from '../../data/la-county-municipal-regions-current.json';
Expand Down Expand Up @@ -209,7 +208,11 @@ class PinMap extends Component {

render() {
return (
<div className="pinmap">{this.renderMap()}</div>
<div className="column">
<div className="pinmap">
{this.renderMap()}
</div>
</div>
)
}
}
Expand Down
36 changes: 36 additions & 0 deletions src/components/common/Dropdown.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import React from 'react';

const Dropdown = () => (
<div className="dropdown is-active">
<div className="dropdown-trigger">
<button className="button" aria-haspopup="true" aria-controls="dropdown-menu">
<span>Dropdown button</span>
<span className="icon is-small">
<i className="fas fa-angle-down" aria-hidden="true"></i>
</span>
</button>
</div>
<div className="dropdown-menu" id="dropdown-menu" role="menu">
<div className="dropdown-content">
<a href="#" className="dropdown-item">
Dropdown item
</a>
<a className="dropdown-item">
Other dropdown item
</a>
<a href="#" className="dropdown-item is-active">
Active dropdown item
</a>
<a href="#" className="dropdown-item">
Other dropdown item
</a>
<hr className="dropdown-divider" />
<a href="#" className="dropdown-item">
With a divider
</a>
</div>
</div>
</div>
);

export default Dropdown;
6 changes: 0 additions & 6 deletions src/components/common/Styles/Legend.scss

This file was deleted.

15 changes: 0 additions & 15 deletions src/components/common/Styles/NCFilter.scss

This file was deleted.

12 changes: 12 additions & 0 deletions src/components/main/body/Body.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';
import PinMap from '../../PinMap/PinMap.jsx';

const Body = () => (
<div className="container is-fluid">
<div className="columns">
<PinMap />
</div>
</div>
);

export default Body;
24 changes: 24 additions & 0 deletions src/components/main/footer/Footer.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react';

const Footer = () => (
<footer className="footer" style={{
position: 'fixed',
bottom: '0',
width: '100%',
}}>
<div className="content has-text-centered">
<p>
<strong>
311 Data
</strong>
by
<a href="https://www.hackforla.org/">
Hack4LA
</a>
.
</p>
</div>
</footer>
);

export default Footer;
34 changes: 34 additions & 0 deletions src/components/main/header/Header.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import React from 'react'
import NCFilter from './NCFilter.jsx'
import DataPicker from './dataPicker.jsx'
import Legend from './Legend.jsx'
import Dropdown from '../../common/Dropdown';

const Header = () => (
<section className="hero">
<div className="hero-body">
<div className="container">
<h1 className="title">
311 Data
</h1>
<h2 className="subtitle">
Dashboard for NC
</h2>
<div className="columns">
<div className="column">
{/* <Dropdown /> */}
</div>
<div className="column">
<NCFilter />
</div>
<div className="column">
<DataPicker />
</div>
</div>
<Legend />
</div>
</div>
</section>
);

export default Header;
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import {DiscreteColorLegend} from 'react-vis';
import {getColorMap} from '../../Util/DataService.js';
// import './Styles/Legend.scss'
import {getColorMap} from '../../../Util/DataService.js';


export default () => {
Expand All @@ -11,7 +10,7 @@ export default () => {
<div className="Legend">
<DiscreteColorLegend
items={colorData}

orientation="horizontal" />
</div>
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react'
import './Styles/NCFilter.scss'
import constants from '../common/CONSTANTS.js';
import constants from '../../common/CONSTANTS.js';

export default ({
isPrimary,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import constants from '../common/CONSTANTS.js';
import constants from '../../common/CONSTANTS';

export default ({
showMarkerDropdown,
Expand Down
15 changes: 0 additions & 15 deletions src/containers/Header/Header.jsx

This file was deleted.

8 changes: 0 additions & 8 deletions src/containers/Header/Styles/Header.scss

This file was deleted.

10 changes: 0 additions & 10 deletions src/containers/Map/MapContainer.jsx

This file was deleted.

8 changes: 0 additions & 8 deletions src/containers/Map/Styles/MapContainer.scss

This file was deleted.

1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import ReactDOM from 'react-dom';
// import './index.css';
import 'bulma';
import App from './App';

ReactDOM.render(<App />, document.getElementById('root'));
File renamed without changes.
23 changes: 12 additions & 11 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
const Dotenv = require('dotenv-webpack');
module.exports = {
entry: './src/index.js',
output: {
path: __dirname + '/dist',
publicPath: '/',
filename: 'bundle.js'
},
resolve: {
extensions: ['.js', '.jsx']
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: ['babel-loader']
use: {
loader: 'babel-loader',
},
},
{
test: /\.(css|scss)$/,
test: /\.(css|scss|sass)$/,
use: [
'style-loader',
'css-loader',
'sass-loader'

],
},
{
Expand All @@ -28,14 +37,6 @@ module.exports = {
plugins: [
new Dotenv()
],
resolve: {
extensions: ['*', '.js', '.jsx']
},
output: {
path: __dirname + '/dist',
publicPath: '/',
filename: 'bundle.js'
},
devServer: {
open: true,
contentBase: './public',
Expand Down

0 comments on commit 08610ce

Please sign in to comment.