diff --git a/.gitignore b/.gitignore index 48df55de..235ac9a7 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,7 @@ npm-debug.log* yarn-debug.log* yarn-error.log* +.vscode + +key_file +key_file.pub \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 2ba986f6..00000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "type": "chrome", - "request": "launch", - "name": "Launch Chrome against localhost", - "url": "http://localhost:8080", - "webRoot": "${workspaceFolder}" - } - ] -} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 0f31cbca..00000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - // "editor.formatOnSave": true, - // "eslint.validate": [ - // "javascript", - // "javascriptreact", - // { - // "language": "html", - // "autoFix": true - // } - // ], - // "eslint.enable": true, - // "eslint.options": { - // "extensions": [".html", ".js", ".vue", ".jsx"] - // }, - // "eslint.run": "onSave", - // "eslint.autoFixOnSave": true -} diff --git a/key_file b/key_file new file mode 100644 index 00000000..9cba503f --- /dev/null +++ b/key_file @@ -0,0 +1,54 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: AES-128-CBC,060C7F6BB6D7544F4DF0B0F076801EA9 + +vAqdWMMVskOZWdc0hmMcNDwz8Hx0simnfUJh5PKr+ZZfITt6ODaNVxA4ANIU2IuK +5DaJPj3N1kJVNigQTz9n75na3dTsbAOn36zEte/VA3WwMKjl6tp8IypZb5E64Kqh +z7x3zfmt6Ts4j2uIYdFI4kP9ilgyD6122DbXQNQanONrzdpDa952PqmD3inxabiL +wKFtyhRA5IaeF8NrJwjR+6fe336CPBXmzteQIWcecQ8O5BEgDui8D93G5O7zXD3y +LMn90u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WvFCrj3ALEakUXSqrFrS+6rWRRGh2tYvYi2zqZDShsL5e+XY9Ot9O +9Trgv7sLyOB4vUYLMe+EnVUIC6oK0+z5DAvTwid9din0j39kN1n81Bb4IeC9Cz+a +ACDOI6qH/0JPgbkfllxioqTqnO7u2MtBXaqul8twSVBosWWIrgmR0XMrARKNB4ro +Yu8klhCwk1n3pog9W+Yll3WD5NrOZu4LLLBWPt5j7qfy5/qySNK2uAULIFNyOxih +NauZwV4FzAN32C1a1azgl5+EVmcUj9O+fHkhUNJIwqql35GED8/3JyYSQycb0Ca/ +LI+B9hH44ySvISLWanTxbEbJXzYAWeVt9DzNFE3s1scdUUONeiDzUVg9qnNiu2d+ +tPnCl/BHIr2uRKuZO+Itm1zwlcQXvwrayzgUCDSlrKntbl5AsoYH7Qj2UgXAkrHY +tRPicxyfIi9b4zbwbkO4kBXF+tYKhhVW14/IT4oHhGuxFjR+YBIFnBkn4wIT5Yea +lJpoVSHRXvi1LO8OLgt18RxeEGmt8i4/xE9D/7W/vJ/aXTvDYtBs4qoAZcg/E6hs +om4r62Iuet7ByFWVF9OrZtcHOukk4WcZyQOxNWehTjZ87vdGSymqFeP5CIGncCKy +03MGfXxKKvZa3kTcY6jW6DUJIm8QR7Ik9N8FN4bJcAmOWm6CgNoSyYVlW4TVjy/w +mHC29LEtex2g8bRaQGl/dTnrHlOM1woV34KrpUU+0fzsJW7B+0IrRqtybgh4hktR +-----END RSA PRIVATE KEY----- diff --git a/key_file.pub b/key_file.pub new file mode 100644 index 00000000..ca9ef80d --- /dev/null +++ b/key_file.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCi3kUTVjIVhkaa0GSr3vieErzdaVlZs1tski+XwGQZFFq2jCHfxHl361bLx6pQRwak/QQRZ6soPveHEvOxm/Ss7nMZS34twni3M709uAjanaFVx7hjiRjf+YLiAyyCWlsTt/1QPjMdSl3NUWiK5TUaR3qmOKI6utmqMwB2wT/5Py5wq/zSMcQ7BspytztkTug2o3eKvD7OhWvDfhtjhWgCybk1rETbVdxzbvsqqFsqqWX6YJII97IHlB5VoJBjm7TYopBS+amh4enFTwBkI8wzRuKdONoZ2sR138J1zMN9s4vEe9So1OInshbYM3JISCIeGtIZi5eaJP14N5ewj5K8Pi3i+4rP619f5ZUp4L9qbIKz6VGwmg4xEDc3ARYYFxpsTJz4+wLmmPadW7RqI528cwD/cfLmeO56pli7hviBT0itc9w2GFAhYFHm91EQBsTvkZTSWThXdx9Tt9vl3Cj1B9hpaHwaf8X99aln7NxMzmif6qr/46XwYGa4gVolBDX3fEbdbWXrUHpXMEwP24PpZBfq5QXVx8n9iEvaGEzbVUVwhTVcJrV3Ogt5C+X9AaUfu0ie+fiRW1grcfuk+R1VW2ZvZSbsIJeBhRP8n2bqBfrGF26IMJpkGGJEqyWZbbN+dApfeg4MUQaABbN8nYc9AkyqIFhs37Cj+hLzSqg3Lw== eugen.lefter@gmail.com diff --git a/src/App/AppContainer.js b/src/App/AppContainer.js index 9d9c8c75..711d8495 100644 --- a/src/App/AppContainer.js +++ b/src/App/AppContainer.js @@ -1,21 +1,23 @@ // import React/Redux dependencies -import React, { Component } from 'react'; -import { Route } from 'react-router'; -import { connect } from 'react-redux'; -import PropTypes from 'prop-types'; -import { loadResources } from '../action/resourceDataAction'; -import { getAllSites } from '../api/directoryGoogleSheets'; +import React, { Component } from "react"; +import { Route } from "react-router"; +import { connect } from "react-redux"; +import PropTypes from "prop-types"; +import { loadResources } from "../action/resourceDataAction"; +import { getAllSites } from "../api/directoryGoogleSheets"; // import components -import Header from '../components/Header/Header'; -import MapPage from '../components/MapPage/MapPage'; -import AdminPage from '../components/AdminPage/AdminPage'; -import { SplitScreenTogglePane } from '../components/AdminPage/SplitScreenTogglePane'; -import SavedResourcePanel from '../components/SavedResources/SavedResourcePanel'; -import NotFoundPage from '../components/NotFoundPage/NotFoundPage'; -import { Loading } from '../components/Common/Loading'; -import { FeedbackContainer } from '../components/Common/FeedbackContainer'; +import Header from "../components/Header/Header"; +import MapPage from "../components/MapPage/MapPage"; +import AdminPage from "../components/AdminPage/AdminPage"; +import { SplitScreenTogglePane } from "../components/AdminPage/SplitScreenTogglePane"; +import SavedResourcePanel from "../components/SavedResources/SavedResourcePanel"; +import NotFoundPage from "../components/NotFoundPage/NotFoundPage"; +import { Loading } from "../components/Common/Loading"; +import { FeedbackContainer } from "../components/Common/FeedbackContainer"; +import LandingPage from '../components/LandingPage/LandingPage'; +// import Button from '../components/Button/Button' const envSheetId = process.env.REACT_APP_GOOGLE_SHEETS_ID; @@ -34,14 +36,15 @@ class AppContainer extends Component { constructor(props) { super(props); this.state = { + position: {}, displayFeedbackLink: true, - isValidPage: true, + isValidPage: true }; } static propTypes = { - dispatch: PropTypes.func, + dispatch: PropTypes.func }; componentDidMount() { @@ -75,26 +78,36 @@ class AppContainer extends Component { position: { coordinates: { lat: parseFloat(position.coords.latitude), - lng: parseFloat(position.coords.longitude), - }, - }, + lng: parseFloat(position.coords.longitude) + } + } }); }, error => { console.log(error); - }, + } ); } }; toggleSavedResourcesPane = () => { this.setState({ - isSavedResourcePaneOpen: !this.state.isSavedResourcePaneOpen, + isSavedResourcePaneOpen: !this.state.isSavedResourcePaneOpen }); }; + goToResources = () => { + this.setState({ + landingPage: false + }) + } + + + + render() { const { isFetchingResource } = this.props; + if (!this.state.isValidPage) { return ; @@ -104,13 +117,18 @@ class AppContainer extends Component { return ; } + + + return ( -
-
+
+
+
+ )} +
+ +
); } diff --git a/src/components/Button/Button.js b/src/components/Button/Button.js new file mode 100644 index 00000000..2003beeb --- /dev/null +++ b/src/components/Button/Button.js @@ -0,0 +1,16 @@ +import React, { Component } from "react"; + +class Button extends Component { + constructor(props){ + super(props); + } + + + + render() { + const { goToResources } = this.props; + return ; + } +} + +export default Button; diff --git a/src/components/LandingPage/LandingPage.js b/src/components/LandingPage/LandingPage.js new file mode 100644 index 00000000..598dd60f --- /dev/null +++ b/src/components/LandingPage/LandingPage.js @@ -0,0 +1,29 @@ +import React, { Component } from "react"; + + +class LandingPage extends Component { + render() { + return ( +
+

Welcom to Community Connect

+

+ "Community Connect" is a health resource web application that aims to + consolidate information about businesses and organization available in + communities that promote healthy lifestyle choices. A health resource + is defined as services or materials that improve the quality of life + of others, ranging from affordable child care, substance abuse + counseling, domestic violence support, and more. We are working in + conjunction with Massachusetts General Hospital's Center for Community + Health Improvement, MGH Revere HealthCare Center, and Revere CARES + Coalition to create an extensive database in our pilot region of + Revere, Chelsea, Charlestown, and eventually the Greater Boston Area. +

+ + +
+ + ); + } +} + +export default LandingPage; diff --git a/src/components/MapPage/Map.js b/src/components/MapPage/Map.js index 88f4603e..51e976aa 100644 --- a/src/components/MapPage/Map.js +++ b/src/components/MapPage/Map.js @@ -1,12 +1,13 @@ -import React from 'react'; -import { withScriptjs, withGoogleMap, GoogleMap } from 'react-google-maps'; -import { MarkerClusterer } from 'react-google-maps/lib/components/addons/MarkerClusterer'; -import OrganizationMarker from './OrganizationMarker'; -import { compose, lifecycle } from 'recompose'; +import React from "react"; +import { withScriptjs, withGoogleMap, GoogleMap } from "react-google-maps"; +import { MarkerClusterer } from "react-google-maps/lib/components/addons/MarkerClusterer"; +import OrganizationMarker from "./OrganizationMarker"; +import { compose, lifecycle } from "recompose"; +import Styles from "./mapStyles"; const Map = compose( lifecycle({ - componentWillMount () { + componentWillMount() { this.setState({ zoomToMarkers: map => { const bounds = new window.google.maps.LatLngBounds(); @@ -14,19 +15,27 @@ const Map = compose( bounds.extend( new window.google.maps.LatLng( child.props.resource.coordinates.lat, - child.props.resource.coordinates.lng, - ), + child.props.resource.coordinates.lng + ) ); }); map.fitBounds(bounds); - }, + } }); - }, + } }), + withScriptjs, - withGoogleMap, + withGoogleMap )(props => ( - + diff --git a/src/components/MapPage/OrganizationMarker.js b/src/components/MapPage/OrganizationMarker.js index 04c2eb46..082a55a6 100644 --- a/src/components/MapPage/OrganizationMarker.js +++ b/src/components/MapPage/OrganizationMarker.js @@ -1,11 +1,11 @@ -import React, { Component } from 'react'; -import { Marker, InfoWindow } from 'react-google-maps'; +import React, { Component } from "react"; +import { Marker, InfoWindow } from "react-google-maps"; export class OrganizationMarker extends Component { constructor(props) { super(props); this.state = { - open: this.props.open, + open: this.props.open }; } @@ -31,20 +31,32 @@ export class OrganizationMarker extends Component { render() { let { resource } = this.props; + let iconMarker = new window.google.maps.MarkerImage( + "https://cdn0.iconfinder.com/data/icons/business-human-resources-2/128/60-512.png", + null /* size is determined at runtime */, + null /* origin is 0,0 */, + null /* anchor is bottom center of the scaled image */, + new window.google.maps.Size(32, 32) + ); + const InfoWindowStyle = { + backgroundColor: "green" + }; return ( {this.state.open && ( - +
{resource.groupedResource.map(resource => (

{resource.name}

{resource.combinedaddress}
diff --git a/src/components/MapPage/SplitScreenSlidingPane.js b/src/components/MapPage/SplitScreenSlidingPane.js index c328fd77..57717eb3 100644 --- a/src/components/MapPage/SplitScreenSlidingPane.js +++ b/src/components/MapPage/SplitScreenSlidingPane.js @@ -1,22 +1,22 @@ -import React, { Component } from 'react'; -import cx from 'classnames'; +import React, { Component } from "react"; +import cx from "classnames"; export class SplitScreenSlidingPane extends Component { state = { - isOpen: true, + isOpen: true }; toggle = e => { e.preventDefault(); this.setState({ - isOpen: !this.state.isOpen, + isOpen: !this.state.isOpen }); }; - render () { - const slidingPaneClassNames = cx('sliding-pane', { - open: this.state.isOpen, + render() { + const slidingPaneClassNames = cx("sliding-pane", { + open: this.state.isOpen }); return (
diff --git a/src/components/MapPage/mapStyles.js b/src/components/MapPage/mapStyles.js new file mode 100644 index 00000000..f3ec5ccc --- /dev/null +++ b/src/components/MapPage/mapStyles.js @@ -0,0 +1,187 @@ +let Styles = [ + { + featureType: "all", + elementType: "geometry.fill", + stylers: [ + { + weight: "2.00" + } + ] + }, + { + featureType: "all", + elementType: "geometry.stroke", + stylers: [ + { + color: "#9c9c9c" + } + ] + }, + { + featureType: "all", + elementType: "labels.text", + stylers: [ + { + visibility: "on" + } + ] + }, + { + featureType: "administrative.land_parcel", + elementType: "geometry.fill", + stylers: [ + { + visibility: "on" + }, + { + color: "#372305" + }, + { + saturation: "-25" + } + ] + }, + { + featureType: "landscape", + elementType: "all", + stylers: [ + { + color: "#f2f2f2" + } + ] + }, + { + featureType: "landscape", + elementType: "geometry.fill", + stylers: [ + { + color: "#ffffff" + } + ] + }, + { + featureType: "landscape.man_made", + elementType: "geometry.fill", + stylers: [ + { + color: "#ffffff" + } + ] + }, + { + featureType: "poi", + elementType: "all", + stylers: [ + { + visibility: "off" + } + ] + }, + { + featureType: "road", + elementType: "all", + stylers: [ + { + saturation: -100 + }, + { + lightness: 45 + } + ] + }, + { + featureType: "road", + elementType: "geometry.fill", + stylers: [ + { + color: "#eeeeee" + } + ] + }, + { + featureType: "road", + elementType: "labels.text.fill", + stylers: [ + { + color: "#7b7b7b" + } + ] + }, + { + featureType: "road", + elementType: "labels.text.stroke", + stylers: [ + { + color: "#ffffff" + } + ] + }, + { + featureType: "road.highway", + elementType: "all", + stylers: [ + { + visibility: "simplified" + } + ] + }, + { + featureType: "road.arterial", + elementType: "labels.icon", + stylers: [ + { + visibility: "off" + } + ] + }, + { + featureType: "transit", + elementType: "all", + stylers: [ + { + visibility: "off" + } + ] + }, + { + featureType: "water", + elementType: "all", + stylers: [ + { + color: "#46bcec" + }, + { + visibility: "on" + } + ] + }, + { + featureType: "water", + elementType: "geometry.fill", + stylers: [ + { + color: "#c8d7d4" + } + ] + }, + { + featureType: "water", + elementType: "labels.text.fill", + stylers: [ + { + color: "#070707" + } + ] + }, + { + featureType: "water", + elementType: "labels.text.stroke", + stylers: [ + { + color: "#ffffff" + } + ] + } +]; + +export default Styles; diff --git a/src/index.js b/src/index.js index abe75395..6e84fb5b 100644 --- a/src/index.js +++ b/src/index.js @@ -1,19 +1,19 @@ -import React from 'react'; -import { fab } from '@fortawesome/free-brands-svg-icons'; -import { library } from '@fortawesome/fontawesome-svg-core'; -import { fas } from '@fortawesome/free-solid-svg-icons'; -import ReactDOM from 'react-dom'; -import { BrowserRouter } from 'react-router-dom'; -import configureStore from './store/configureStore'; -import { Provider } from 'react-redux'; -import { Route, Switch, Redirect } from 'react-router'; -import AppContainer from './App/AppContainer'; -import NotFoundPage from './components/NotFoundPage/NotFoundPage'; -import registerServiceWorker from './registerServiceWorker'; - -import 'bootstrap/dist/css/bootstrap.min.css'; -import 'mapbox-gl/dist/mapbox-gl.css'; -import './css/index.scss'; +import React from "react"; +import { fab } from "@fortawesome/free-brands-svg-icons"; +import { library } from "@fortawesome/fontawesome-svg-core"; +import { fas } from "@fortawesome/free-solid-svg-icons"; +import ReactDOM from "react-dom"; +import { BrowserRouter } from "react-router-dom"; +import configureStore from "./store/configureStore"; +import { Provider } from "react-redux"; +import { Route, Switch, Redirect } from "react-router"; +import AppContainer from "./App/AppContainer"; +import NotFoundPage from "./components/NotFoundPage/NotFoundPage"; +import registerServiceWorker from "./registerServiceWorker"; + +import "bootstrap/dist/css/bootstrap.min.css"; +import "mapbox-gl/dist/mapbox-gl.css"; +import "./css/index.scss"; library.add(fab, fas); @@ -50,7 +50,7 @@ ReactDOM.render( {getRoutes(store)} , - document.getElementById('root'), + document.getElementById("root") ); registerServiceWorker();