Skip to content
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
16 changes: 16 additions & 0 deletions septa-fare-calculator/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## Developer Notes
Hello and thank you for the oppurtunity to take this challenge! I look forward to discussing it!
I limited myself to 2.5 hours, so I have a small list of improvements I would make.

1.) I used the fastest method to start react, using the quick-start tool vite. I did not do any cleanup from that, so that would be a priority. For example, my main component is still called App.jsx. That should be better named to FareCalulator.
2.) There are no tests. There should definetly be AT LEAST basic tests for functionallity. Namely checking that the fare caclulation is correct, and for any errors if values are unexpected.
3.) I used a fairly simple method to go through the array and create the options. This could be much more robust, and for longer arrays, more efficient. For example I filter the entire array every time any element in the form changes. That's fine for 5 entries, but would be inefficient for bigger arrays.
4.) This component could be made to handle any type of data thrown at it, but currently makes some assumptions of the data passed to it.
5.) More components broken out instead of placing them in the parent.
6.) Small usibility things, like making it responsive, disabling fields, providing more explination.
7.) I chose to use normal SCSS/CSS, but I would consider styled-components.
8.) Design wise I tried to match the image exactly, but it is very tall and it would be nice to see it all on one screen.
9.) Browser compatibility, I mostly used Chrome and did not look further.

# SEPTA Rail Fare Calculator Challenge

Hello, hopeful Think Company development team member!
Expand Down Expand Up @@ -31,3 +45,5 @@ When you take regional rail in and out of the city, the fare price is affected b
* [Think Company Development Standards](https://standards.thinkcompany.dev/)
* [SEPTA Fares](http://www.septa.org/fares/ticket/index.html)
* [SEPTA Logo (SVG)](https://commons.wikimedia.org/wiki/File:SEPTA.svg)


Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions septa-fare-calculator/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions septa-fare-calculator/septa-fare-calculator/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
],
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
settings: { react: { version: '18.2' } },
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': 'warn',
},
}
24 changes: 24 additions & 0 deletions septa-fare-calculator/septa-fare-calculator/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
35 changes: 35 additions & 0 deletions septa-fare-calculator/septa-fare-calculator/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
transition: filter 300ms;
}
.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.react:hover {
filter: drop-shadow(0 0 2em #61dafbaa);
}

@keyframes logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

@media (prefers-reduced-motion: no-preference) {
a:nth-of-type(2) .logo {
animation: logo-spin infinite 20s linear;
}
}

.card {
padding: 2em;
}

.read-the-docs {
color: #888;
}
1 change: 1 addition & 0 deletions septa-fare-calculator/septa-fare-calculator/App.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions septa-fare-calculator/septa-fare-calculator/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
Loading