Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Launch day cleanup #3

Open
wants to merge 42 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
0940ed9
fix: added to list of compatible browsers to get map visible on prod
Dec 7, 2023
987c0b8
fix: added key to displayInstructions props and fixed className attri…
Dec 7, 2023
a73870d
refactor: added env package and moved api key to seperate file
Dec 7, 2023
2ff6443
Merge pull request #1 from hackf/debug
haleytibbitts Feb 7, 2024
13891fd
chore: removed hard coded access tokens, moved to variables in env file
haleytibbitts Feb 7, 2024
1507e57
fix: linting errors
haleytibbitts Feb 7, 2024
cda5e27
chore: removed stray console logs
haleytibbitts Feb 7, 2024
ab36e36
fix: conflicting corDispatches, add destination button type
haleytibbitts Feb 9, 2024
e349aa9
fix: added proximity to search api call to give priority to windsor l…
haleytibbitts Feb 9, 2024
6fc2f40
fix: previous selection cleared on click
haleytibbitts Feb 13, 2024
c8dc791
Merge pull request #2 from hackf/debug
dsartori Feb 14, 2024
3667947
style: fixed menu and sidebar styling for tablet
haleytibbitts Mar 4, 2024
15a6557
style: added pointer cursors to buttons
haleytibbitts Mar 4, 2024
9e14628
feat: sidebar component redirects users to submit route if unsubmitted
haleytibbitts Mar 4, 2024
b5ab818
feat: made route metadata visible on desktop
haleytibbitts Mar 4, 2024
4dc580f
fix: route metadata displaying properly on desktop
haleytibbitts Mar 5, 2024
d7cb8de
fix: mobile submit error and route metadata
haleytibbitts Mar 5, 2024
a7124b9
fix: back and exit buttons functional
haleytibbitts Mar 5, 2024
3e1c1d0
style: footer
haleytibbitts May 8, 2024
361a0f9
feat: add destination on mobile
haleytibbitts May 14, 2024
a84a2f8
feat: printable instructions on desktop
haleytibbitts May 21, 2024
b15ed14
chore: removed errant console logs
haleytibbitts May 21, 2024
1ed3982
refactor: adjusted sidebar overflow scroll and print formatting
haleytibbitts May 21, 2024
66b2cf2
feat: bounding box including detroit, search results return closest l…
haleytibbitts Jun 5, 2024
a8aa168
refactor: new bounds including pelee island
haleytibbitts Jun 6, 2024
3bb63a0
style: sidebar sidescroll fixed
haleytibbitts Jun 10, 2024
61c6047
chore: changed default favicon and webpage metadata
haleytibbitts Jun 10, 2024
2566de6
refactor: removed detroit search results temporarily
haleytibbitts Aug 19, 2024
e53bff9
Merge pull request #3 from hackf/debug
dsartori Aug 21, 2024
334ffd0
Update App.scss
dsartori Aug 28, 2024
8193d3f
hotfix for mobile safari
dsartori Aug 28, 2024
1a1a225
custom routing
dsartori Sep 6, 2024
3d128ae
null commit
dsartori Sep 16, 2024
70ffe32
Merge branch 'main' into doug
dsartori Sep 16, 2024
3f082d6
Merge pull request #4 from hackf/doug
dsartori Sep 16, 2024
54a63d0
fix: state update on load error
haleytibbitts Sep 17, 2024
c1d841e
fix: layer duplication
haleytibbitts Sep 17, 2024
d0ba8c8
fix: mobileForm added back into menu
haleytibbitts Sep 18, 2024
c2ff84d
Merge pull request #5 from hackf/debug
dsartori Sep 18, 2024
dcf65ee
check specific property we're going to access
dsartori Sep 18, 2024
889db24
merge
dsartori Sep 19, 2024
76e80e1
Merge branch 'main' into launch-day
dsartori Sep 19, 2024
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,860 changes: 4,745 additions & 115 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
"production": [
">0.2%",
"not dead",
"not op_mini all"
"not op_mini all",
"not safari < 10",
"not chrome < 51",
"not android < 5",
"not ie < 12"
],
"development": [
"last 1 chrome version",
Expand All @@ -28,6 +32,7 @@
},
"dependencies": {
"@syncfusion/ej2-react-dropdowns": "^22.1.37",
"dotenv": "^16.3.1",
"expo-location": "^16.3.0",
"mapbox-gl": "^2.15.0",
"react": "^18.2.0",
Expand All @@ -36,6 +41,7 @@
"react-router-dom": "^6.14.1",
"react-scripts": "^5.0.1",
"react-select": "^5.7.3",
"react-to-print": "^2.15.1",
"react-widgets": "^5.8.4",
"sass": "^1.63.6",
"web-vitals": "^3.3.2"
Expand Down
Binary file modified public/favicon.ico
Binary file not shown.
7 changes: 5 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Web site created using create-react-app" />
<meta
name="description"
content="Cycling app for for the Windsor-Essex region, Pelee Island, and the Detroit riverside."
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
Expand All @@ -21,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>Windsor Essex Cycling</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
Binary file modified public/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 7 additions & 12 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useReducer, useState } from 'react';
import React, { useState } from 'react';
import mapboxgl from 'mapbox-gl';
import { MdClose } from 'react-icons/md';

import Map from './components/map/map.component';
import Sidebar from './components/sidebar/sidebar.component';
Expand All @@ -13,13 +12,9 @@ import StopsContext from './providers/stops/stops.context.jsx';
import MobileContext from './providers/mobile/mobile.context.jsx';
import { RouteProvider } from './providers/route/route.context.jsx';

import { mapboxReducer } from './providers/mapbox/mapbox.reducer';
import { coordinatesReducer } from './providers/coordinates/coordinates.reducer';
import { graphhopperReducer } from './providers/graphhopper/graphhopper.reducer';

import './App.scss';

mapboxgl.accessToken = 'pk.eyJ1IjoiZWphc25rYXJvIiwiYSI6ImNsYndjOTduajBiY2QzbnFueGY0d3E4anQifQ.yjV2mQdGzjjNuCwKZz-e-Q';
mapboxgl.accessToken = process.env.REACT_APP_MAPBOX_ACCESS_TOKEN;

function App() {
const defaultCor = {
Expand Down Expand Up @@ -73,9 +68,9 @@ function App() {
return (
<div className="app">
<GraphhopperContext.Provider value={graphProviderState}>
<Sidebar />
<div className="main">
<CoordinatesContext.Provider value={corProviderState}>
<CoordinatesContext.Provider value={corProviderState}>
<Sidebar />
<div className="main">
<MapContext.Provider value={mapProviderState}>
<RouteProvider>
<Map />
Expand All @@ -86,8 +81,8 @@ function App() {
</StopsContext.Provider>
</RouteProvider>
</MapContext.Provider>
</CoordinatesContext.Provider>
</div>
</div>
</CoordinatesContext.Provider>
</GraphhopperContext.Provider>
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions src/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

.main {
width: 100%;
height: 100vh;
height: 95dvh;
grid-column: 1/3;
grid-row: 1/2;

Expand All @@ -19,7 +19,7 @@
}

.app {
height: 100vh;
height: 100dvh;
display: grid;

grid-template-columns: 1fr 350px 50px;
Expand Down
13 changes: 8 additions & 5 deletions src/components/button/button.component.jsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
import { useState } from 'react';
import { useStopsContext } from '../../providers/stops/stops.context.jsx';
import { useCoordinatesContext } from '../../providers/coordinates/coordinates.context';

import { Input } from '../input/input.component';

import './button.styles.scss';

export const Add = () => {
export const Add = ({ mobile }) => {
const { stopsState, stopsDispatch } = useStopsContext();

function addStop() {
stopsDispatch([
...stopsState,
<Input label={`Stop ${stopsState.length + 1}`} id={`Stop ${stopsState.length + 1}`} />,
<Input
label={`Stop ${stopsState.length + 1}`}
id={`Stop ${stopsState.length + 1}`}
placeholder={mobile ? `Stop ${stopsState.length + 1}` : null}
type={mobile ? 'mobile' : null}
/>,
]);
console.log(stopsState);
}

return (
Expand All @@ -23,7 +26,7 @@ export const Add = () => {
<p>+ Add Destination</p>
</div>
<div className="add__button">
<Input label="Add" />
<Input label="Add" type="mobile" />
</div>
</div>
);
Expand Down
2 changes: 2 additions & 0 deletions src/components/button/button.styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
display: grid;
grid-template-rows: 1fr;
grid-template-columns: 1fr;
margin-bottom: 10px;

&__button {
grid-row: 1 / 2;
Expand All @@ -18,6 +19,7 @@
grid-row: 1 / 2;
grid-column: 1 / 2;
z-index: 2;
cursor: pointer;

display: grid;
justify-items: center;
Expand Down
1 change: 0 additions & 1 deletion src/components/card/card.component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { BsArrowUp } from 'react-icons/bs';
import './card.styles.scss';

const Card = ({ distance, direction, mobile }) => {
console.log(mobile);
const display_distance = x => {
if (x === undefined) {
return <></>;
Expand Down
29 changes: 18 additions & 11 deletions src/components/dashboard/dashboard.component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import './dashboard.styles.scss';
const Dashboard = () => {
const { mapState } = useMapContext();
const { mobileState, mobileDispatch } = useMobileContext();
const { graphState } = useGraphhopperContext();
const { graphState, graphDispatch } = useGraphhopperContext();
const { route } = useRoute();
const { corState, corDispatch } = useCoordinatesContext();
const { stopsDispatch } = useStopsContext();
Expand All @@ -35,8 +35,10 @@ const Dashboard = () => {
e.preventDefault();

// handleExit(e, mapState, mobileDispatch, corDispatch, stopsDispatch, corState);
handleExit(e, mapState, mobileDispatch, corDispatch, stopsDispatch, corState);
removeMarker(mapState);
handleExit(e, mapState, mobileDispatch, corDispatch, stopsDispatch, corState, graphDispatch);
if (mobileState === 'route') {
removeMarker(mapState);
}
}

if (graphState) {
Expand All @@ -48,23 +50,28 @@ const Dashboard = () => {
graphState.paths[0].points.coordinates[route.point_index - 1][1],
graphState.paths[0].points.coordinates[route.point_index - 1][0]
);

const distance =
route.distance - graphState.paths[0].instructions[route.instruction_index].distance + instruction_distance_left;
mobileState === 'route'
? route.distance -
graphState.paths[0].instructions[route.instruction_index].distance +
instruction_distance_left
: graphState.paths[0].distance;

const time =
route.time -
(1 -
(instruction_distance_left / graphState.paths[0].instructions[route.instruction_index].distance) *
graphState.paths[0].instructions[route.instruction_index].time);
mobileState === 'route'
? route.time -
(1 -
(instruction_distance_left / graphState.paths[0].instructions[route.instruction_index].distance) *
graphState.paths[0].instructions[route.instruction_index].time)
: graphState.paths[0].time;

const today = new Date();
today.setHours(today.getHours() + round_time(time)[0] * 1);
today.setMinutes(today.getMinutes() + round_time(time)[2] * 1);

console.log(route);

return (
<div className={mobileState === 'route' ? 'dashboard' : 'hidden'}>
<div className="dashboard">
<div className="dashboard__exit">
<CgClose className="dashboard__icon" />
<div className="dashboard__button" onClick={handleClick} />
Expand Down
10 changes: 3 additions & 7 deletions src/components/dashboard/dashboard.styles.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
@import '../../mixins';

.dashboard {
display: none;

@include respond(phone) {
display: grid;
grid-template-columns: 2fr 8fr;
grid-column-gap: 1rem;
}
display: grid;
grid-template-columns: 2fr 8fr;
grid-column-gap: 1rem;

grid-row: 9 / 10;
grid-column: 1 / 9;
Expand Down
Loading