Refactor: Remove Excessive Data and Simplify States in GeneratorComponent #45
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.
More details about these changes are outlined in Redesign/Refactor: Simplify data passed into GeneratorComponent.js from GeneratorList.js.
This pull request refactors the
data/GeneratorList
to remove excessive data and simplify our states inGeneratorComponent
. The following changes have been made:h1
property in the objects of the data has been removed, and thetitle
property has been updated to be used as theh1
tag in line 41 ofGeneratorComponent.js
.Card.Text
component's initial state is now conditionally rendered based on thedataLoaded
and response states using a ternary operator.description2
is now being used{description2}
instead of descriptoin.response1
,response2
, andresponse3
properties in the data objects have been removed, and new states have been set for theGeneratorComponent.js
to display appropriate messages using thetitle
prop.These changes have been thoroughly tested, and everything works as expected.