Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
web app update
  • Loading branch information
rkv14001 committed Apr 11, 2019
1 parent e74fcea commit b2a7d39
Show file tree
Hide file tree
Showing 12 changed files with 380 additions and 46 deletions.
5 changes: 0 additions & 5 deletions Web-App/README.md
@@ -1,8 +1,3 @@
A web app to display GPS tracking data on the UConn campus for research studies.

For Senior Design project 2018-2019
To run:
(1)Install Node.js and npm
(2)enter Web-App folder
npm install
npm start
11 changes: 9 additions & 2 deletions Web-App/package.json
Expand Up @@ -4,14 +4,19 @@
"private": true,
"dependencies": {
"react": "^16.6.3",
"react-datepicker": "^2.1.0",
"react-dom": "^16.6.3",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"react-scripts": "2.1.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"eject": "react-scripts eject",
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
},
"eslintConfig": {
"extends": "react-app"
Expand All @@ -23,6 +28,8 @@
"not op_mini all"
],
"devDependencies": {
"gh-pages": "^2.0.1",
"node-sass": "^4.10.0"
}
},
"homepage": "https://renojvarghese.github.io/oncampus-walking-web-display/"
}
10 changes: 3 additions & 7 deletions Web-App/src/App.js
@@ -1,15 +1,11 @@
import React, { Component } from "react";
import "./scss/App.scss";
import SearchBar from "./components/searchBar";
import ParticipantContainer from "./components/participantContainer";
import "react-datepicker/dist/react-datepicker.css";
import AppRouter from "./components/router";
class App extends Component {
render() {
return (
<div className="App">
Hello World!
<SearchBar />
<ParticipantContainer />
</div>
<AppRouter/>
);
}
}
Expand Down
21 changes: 10 additions & 11 deletions Web-App/src/components/participantBox/index.js
@@ -1,16 +1,15 @@
import React, { Component } from "react";

import React from "react";
export const ParticipantBox = ({
name = "default",
start = "N/A",
end = "N/A",
miles = 0
name = "PARTICPANT ID",
start = "10/12",
end = "Present",
miles = 100
}) => (
<div>
<div>{name}</div>
<div>{start}</div>
<div>{end}</div>
<div>{miles}</div>
<div className="part-box">
<div className="part-name">{name}</div>
<div className="part-start">Start Time: {start}</div>
<div className="part-end">End Time:{end}</div>
<div className="part-miles">Total Miles: {miles} mi</div>
</div>
);

Expand Down
8 changes: 4 additions & 4 deletions Web-App/src/components/participantContainer/index.js
@@ -1,12 +1,12 @@
import React, { Component } from "react";
import ParticipantBox from "../participantBox";

import { Link } from "react-router-dom";
export default class ParticipantContainer extends Component {
render() {
return (
<div>
<ParticipantBox />
<ParticipantBox />
<div className="part-container">
<Link to="/map"><ParticipantBox /></Link>
<Link to="/map"><ParticipantBox /></Link>
</div>
);
}
Expand Down
12 changes: 8 additions & 4 deletions Web-App/src/components/searchBar/SearchBox.js
@@ -1,8 +1,12 @@
import React, { Component } from "react";
import React from "react";

export const SearchBox = ({ onChange, placeholder }) => (
<div>
<input onChange={onChange} placeholder={placeholder} />
export const SearchBox = ({ onChange, placeholder = "Search" }) => (
<div className="search-box">
<input
className="search-input"
onChange={onChange}
placeholder={placeholder}
/>
</div>
);

Expand Down
8 changes: 5 additions & 3 deletions Web-App/src/components/searchBar/SearchButton.js
@@ -1,8 +1,10 @@
import React, { Component } from "react";
import React from "react";

export const SearchButton = ({ onClick, children }) => (
<div>
<button onClick={onClick}>{children}</button>
<div className="search-btn-container">
<button className="search-btn" onClick={onClick}>
{children}
</button>
</div>
);

Expand Down
2 changes: 1 addition & 1 deletion Web-App/src/components/searchBar/index.js
Expand Up @@ -5,7 +5,7 @@ import SearchButton from "./SearchButton";
export default class SearchBar extends Component {
render() {
return (
<div>
<div className="search-container">
<SearchBox />
<SearchButton>Submit</SearchButton>
</div>
Expand Down
3 changes: 2 additions & 1 deletion Web-App/src/index.js
Expand Up @@ -3,8 +3,9 @@ import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';
import { BrowserRouter as Router } from "react-router-dom";

ReactDOM.render(<App />, document.getElementById('root'));
ReactDOM.render(<Router basename={process.env.PUBLIC_URL}><App /></Router>, document.getElementById('root'));

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
Expand Down
4 changes: 4 additions & 0 deletions Web-App/src/scss/App.scss
@@ -1 +1,5 @@
@import "partials/variables";
@import "partials/common";
@import "partials/search";
@import "partials/map";
@import "partials/participant";
4 changes: 4 additions & 0 deletions Web-App/src/scss/partials/_variables.scss
Expand Up @@ -5,3 +5,7 @@ $black: #000000;
$grey-light: #f0f0f0;
$grey: #7f7f7f;
$grey-dark: $grey / 1.2;

$san-serif: sans-serif;

$box-shadow: 0px 0px 15px 0px rgba(0, 0, 0, 0.3);

0 comments on commit b2a7d39

Please sign in to comment.