Skip to content

Commit

Permalink
Merge pull request #8 from williamquintas/development
Browse files Browse the repository at this point in the history
v1.0.0
  • Loading branch information
williamquintas authored May 17, 2022
2 parents f237753 + f95f1a2 commit 5721b28
Show file tree
Hide file tree
Showing 39 changed files with 9,820 additions and 28,042 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
REACT_APP_GOOGLE_API_KEY = "string"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
# misc
.DS_Store
.env.local
.env.development
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

27,874 changes: 0 additions & 27,874 deletions package-lock.json

This file was deleted.

24 changes: 14 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,28 @@
"version": "0.1.0",
"private": false,
"dependencies": {
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.2.0",
"@testing-library/user-event": "^13.5.0",
"@emotion/react": "^11.9.0",
"@emotion/styled": "^11.8.1",
"@googlemaps/react-wrapper": "^1.1.33",
"@mui/icons-material": "^5.6.2",
"@mui/material": "^5.7.0",
"@types/google.maps": "^3.48.8",
"@types/node": "^17.0.32",
"@types/react": "^18.0.9",
"@types/react-dom": "^18.0.3",
"papaparse": "^5.3.2",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-router-dom": "6",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
"typescript": "^4.6.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"start": "react-scripts start"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
"react-app"
]
},
"browserslist": {
Expand Down
Binary file modified public/favicon.ico
Binary file not shown.
17 changes: 1 addition & 16 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,7 @@
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
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>Paths viewer</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
Binary file removed public/logo192.png
Binary file not shown.
Binary file removed public/logo512.png
Binary file not shown.
25 changes: 0 additions & 25 deletions public/manifest.json

This file was deleted.

3 changes: 0 additions & 3 deletions public/robots.txt

This file was deleted.

38 changes: 0 additions & 38 deletions src/App.css

This file was deleted.

25 changes: 0 additions & 25 deletions src/App.js

This file was deleted.

8 changes: 0 additions & 8 deletions src/App.test.js

This file was deleted.

49 changes: 49 additions & 0 deletions src/components/App/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { Box } from "@mui/material";
import { FunctionComponent, useState } from "react";
import { Navigate, Route, Routes } from "react-router-dom";
import FilesSelectionPage from "../../pages/FilesSelection/FilesSelection";
import MapViewerPage from "../../pages/MapViewer/MapViewer";
import Footer from "../Footer/Footer";
import Header from "../Header/Header";

export interface ICoordinatesData {
date?: string;
time?: string;
id?: string;
line?: string;
latitude?: string;
longitude?: string;
speed?: string;
}
export interface IFile {
filename: string;
color: string;
data?: ICoordinatesData[];
}

const App: FunctionComponent = () => {
const [files, setFiles] = useState<IFile[]>([]);

return (
<Box
sx={{
display: "flex",
flexDirection: "column",
minHeight: "100vh",
}}
>
<Header />
<Routes>
<Route
path="/"
element={<FilesSelectionPage files={files} setFiles={setFiles} />}
/>
<Route path="/map" element={<MapViewerPage files={files} />} />
<Route path="*" element={<Navigate to="/" />} />
</Routes>
<Footer />
</Box>
);
};

export default App;
18 changes: 18 additions & 0 deletions src/components/ColorPicker/ColorPicker.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.color-picker {
margin-left: 8px;
}

.color-picker div {
display: flex !important;
}

label#color-picker-label {
padding-left: 10px;
}

.color-circle {
width: 12px;
height: 12px;
border-radius: 6px;
margin-right: 8px;
}
68 changes: 68 additions & 0 deletions src/components/ColorPicker/ColorPicker.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import {
FormControl,
InputLabel,
MenuItem,
Select,
SelectChangeEvent,
} from "@mui/material";
import { FunctionComponent } from "react";
import "./ColorPicker.css";

export const Colors = {
Gray: "#212529",
Red: "#c92a2a",
Pink: "#a61e4d",
Grape: "#862e9c",
Violet: "#5f3dc4",
Indigo: "#364fc7",
Blue: "#1864ab",
Cyan: "#0b7285",
Teal: "#087f5b",
Green: "#2b8a3e",
Lime: "#5c940d",
Yellow: "#e67700",
Orange: "#d9480f",
};

interface ColorPickerProps {
selectedColor: string;
onChangeColor: (evt: SelectChangeEvent) => void;
}

const ColorPicker: FunctionComponent<ColorPickerProps> = ({
selectedColor,
onChangeColor,
}) => {
return (
<FormControl sx={{ m: 1, minWidth: 120 }}>
<InputLabel id="color-picker-label">Color</InputLabel>
<Select
size="small"
labelId="color-picker-label"
className="color-picker"
label="Color"
value={selectedColor}
onChange={onChangeColor}
>
{Object.keys(Colors).map((color) => (
<MenuItem
key={color}
value={Colors[color]}
sx={{
color: Colors[color],
}}
>
<div
className="color-circle"
style={{
backgroundColor: Colors[color],
}}
></div>
{color}
</MenuItem>
))}
</Select>
</FormControl>
);
};
export default ColorPicker;
50 changes: 50 additions & 0 deletions src/components/CoordinatesList/CoordinatesList.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { Circle, ExpandLess, ExpandMore } from "@mui/icons-material";
import {
Collapse,
Container,
List,
ListItemButton,
ListItemIcon,
ListItemText,
} from "@mui/material";
import { Fragment, FunctionComponent, useState } from "react";
import { IFile } from "../App/App";

interface CoordinatesListProps {
file: IFile;
}
const CoordinatesList: FunctionComponent<CoordinatesListProps> = ({ file }) => {
const [open, setOpen] = useState<boolean>(false);
const { filename, data, color } = file;

return (
<Fragment>
<ListItemButton
onClick={() => {
setOpen(!open);
}}
sx={{ backgroundColor: "#f1f3f5" }}
>
<ListItemIcon sx={{ minWidth: 0, mr: 2, color }}>
<Circle fontSize="small" />
</ListItemIcon>
<ListItemText primary={filename} />
{open ? <ExpandLess /> : <ExpandMore />}
</ListItemButton>
<Collapse in={open} timeout="auto" unmountOnExit>
<Container sx={{ maxHeight: 200, overflow: "auto" }}>
<List component="div" disablePadding>
{data?.map((row, index) => (
<ListItemText
key={`coordinate-${index}`}
primary={`${row.latitude}, ${row.longitude}`}
/>
))}
</List>
</Container>
</Collapse>
</Fragment>
);
};

export default CoordinatesList;
3 changes: 3 additions & 0 deletions src/components/FileUploadButton/FileUploadButton.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
input {
display: none;
}
Loading

0 comments on commit 5721b28

Please sign in to comment.