diff --git a/package-lock.json b/package-lock.json index 737babc..f2e241d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9837,6 +9837,15 @@ "minimatch": "3.0.4" } }, + "redux": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/redux/-/redux-4.0.5.tgz", + "integrity": "sha512-VSz1uMAH24DM6MF72vcojpYPtrTUu3ByVWfPL1nPfVRb5mZVTve5GnNCUV53QM/BZ66xfWrm0CTWoM+Xlz8V1w==", + "requires": { + "loose-envify": "^1.4.0", + "symbol-observable": "^1.2.0" + } + }, "regenerate": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", @@ -11149,6 +11158,11 @@ "util.promisify": "~1.0.0" } }, + "symbol-observable": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", + "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==" + }, "symbol-tree": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", diff --git a/package.json b/package.json index 144c8f6..ab276f6 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,8 @@ "react": "^16.9.0", "react-dom": "^16.9.0", "react-geolocated": "^2.5.1", - "react-scripts": "3.1.1" + "react-scripts": "3.1.1", + "redux": "^4.0.5" }, "eslintConfig": { "extends": "react-app" diff --git a/src/App.js b/src/App.js index 18c8beb..0b2e511 100644 --- a/src/App.js +++ b/src/App.js @@ -2,6 +2,10 @@ import React, { Component } from 'react'; import LRTree from 'legislative-rtree'; import {geolocated} from 'react-geolocated'; +import Location from './components/location-component/location.component' +import Districts from './components/district/districts.component' +import Profile from './components/profile/profile.component' + function _browserLocation(props) { if (!props.isGeolocationAvailable || !props.isGeolocationEnabled) return {}; @@ -13,6 +17,8 @@ function _browserLocation(props) { return {}; } + + class App extends Component { constructor(props) { @@ -36,7 +42,7 @@ class App extends Component { if (!location.lng) { setTimeout(() => this._loadData(), 500); return; - } + } let districts = await tree.getDistricts(location.lng, location.lat); let civ = await tree.mimicGoogleCivicsAPI(location.lng, location.lat); @@ -46,31 +52,25 @@ class App extends Component { render() { const {civ, districts} = this.state; - + let properties = ["name", "address", "line1", "line2", "line3", "zip", "phone", "phones", "photoUrl", "city", "party", "urls", "type", "id"] let location = _browserLocation(this.props); if (!location.lng || !location.lat) return (
{JSON.stringify(civ, null, 2)}
+ {JSON.stringify(otherProps.official.officials, otherProps.properties, 2)}
+