feat(widget): implement the widget of septa rails fare calculator #182
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implement the code challenge of SEPTA Regional Rails Fare Calculator
Tech Stacks:
Code Structure:
src/components
: includes all components with atomic pattern that consist of the project.src/styles
: uses SCSS format to build the nested and structured styles. Created a couple of variables, mixin and functions to reuse in the styles.src/types
: includes the interfaces that used in the project (fetching and manipulating the fare data).src/hooks
: includes the hook to handle the API to fetch the SEPTA fare data.src/libs
: includes the helper functions.Logic of calculating the fare cost:
We have the prices by zone, type and purchase. But specifically, we have the price for anytime with specific trip count.
When user inputs the trips that he/she wants to get the cost, we need to think of the best match of these special price (with enough trips) + normal price (with the rest of trips). Check it out here
Accessibility
Briefly check with the lighthouse of Google Chrome. (100% score of Accessibility)
