Skip to content
This repository was archived by the owner on Feb 28, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*

.vscode

key_file
key_file.pub
15 changes: 0 additions & 15 deletions .vscode/launch.json

This file was deleted.

17 changes: 0 additions & 17 deletions .vscode/settings.json

This file was deleted.

2 changes: 2 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<!DOCTYPE html>
<html lang="en">
<head>
<link href="https://fonts.googleapis.com/css?family=Fjalla+One|Noto+Sans:400,700&display=swap" rel="stylesheet">
<!-- Global site tag (gtag.js) - Google Analytics -->

<script async src="https://www.googletagmanager.com/gtag/js?id=UA-126500329-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
Expand Down
67 changes: 44 additions & 23 deletions src/App/AppContainer.js
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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() {
Expand Down Expand Up @@ -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 <NotFoundPage />;
Expand All @@ -104,13 +117,18 @@ class AppContainer extends Component {
return <Loading />;
}




return (
<div className="viewport">
<div className="viewport-header">
<div className="viewport" >
<div>
<div className="viewport-header">
<Header toggleSavedResourcesPane={this.toggleSavedResourcesPane} />
</div>

<div className="page">

<Route
exact
path="/:resource/admin"
Expand All @@ -136,6 +154,9 @@ class AppContainer extends Component {
{this.state.displayFeedbackLink && (
<FeedbackContainer hideFeedbackLink={this.hideFeedbackLink} />
)}
</div>


</div>
);
}
Expand Down
5 changes: 4 additions & 1 deletion src/components/Common/subcomponents/OrganizationCardBody.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React from 'react';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';



export const OrganizationCardBody = ({
categories,
distance,
Expand All @@ -11,7 +13,8 @@ export const OrganizationCardBody = ({
children,
}) => (
<div className="organization-card-body">
<div className="organization-card-body-subtitle">{categories}</div>
<div className="organization-card-body-subtitle">{categories} </div>

{distance && <p>Distance from your location: {distance} miles</p>}
{location && (
<span>
Expand Down
50 changes: 50 additions & 0 deletions src/components/LandingPage/LandingPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import React, { Component } from "react";
import {Link} from 'react-router-dom';
import {withRouter} from 'react-router';

import {Button} from 'reactstrap';


class LandingPage extends Component {
// check if user has seen the landing page
setLocalStorage = () => {
localStorage.setItem('hasSeenLanding', true)
}

componentDidMount() {
if (localStorage.getItem('hasSeenLanding')){
// this.props.history.push('/revere')
}
}


render() {
return (
<div style={{textAlign: "center", padding: "2rem"}}>
<h1> Welcom to Community Connect</h1>
<p style={{ margin: "5rem", fontSize: "1.2rem", lineHeight: "2.2rem" }}>
"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.
</p>

<Button
color='success'
tag={Link}
to={"/revere"}
onClick={this.setLocalStorage}
> Go to Resources</Button>
</div>

);
}
}

export default withRouter(LandingPage);
43 changes: 30 additions & 13 deletions src/components/MapPage/Map.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
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 {Marker} from 'react-google-maps/lib/components/Marker'
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();
Expand All @@ -15,19 +18,31 @@ const Map = compose(
new window.google.maps.LatLng(
child.props.resource.coordinates.lat,
child.props.resource.coordinates.lng,
),
// console.log(child.props.resource.groupedResource[0].categories)
)
);
});
map.fitBounds(bounds);
},
}
});
},

}


}),

withScriptjs,
withGoogleMap,
withGoogleMap
)(props => (
<GoogleMap {...props} ref={props.zoomToMarkers} defaultZoom={5}>
<MarkerClusterer
<GoogleMap
{...props}
ref={props.zoomToMarkers}
defaultZoom={5}
defaultOptions={{
styles: Styles
}}
>
<Marker
averageCenter={true}
enableRetinaIcons={true}
gridSize={60}
Expand All @@ -42,8 +57,10 @@ const Map = compose(
open={resource.showInfo}
resource={resource}
/>

))}
</MarkerClusterer>

</Marker>
</GoogleMap>
));
export default Map;
12 changes: 6 additions & 6 deletions src/components/MapPage/MapPage.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React, { Component } from 'react';
import React, { Component } from "react";

import ResultList from './ResultList';
import OrganizationMap from './OrganizationMap';
import { SplitScreenSlidingPane } from './SplitScreenSlidingPane';
import cx from 'classnames';
import ResultList from "./ResultList";
import OrganizationMap from "./OrganizationMap";
import { SplitScreenSlidingPane } from "./SplitScreenSlidingPane";
import cx from "classnames";

class MapPage extends Component {
render() {
const mapClassName = cx('map-container');
const mapClassName = cx("map-container");
return (
<div className={mapClassName}>
<SplitScreenSlidingPane>
Expand Down
Loading