ResponsiveWebapp refactor #337
Merged
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.
This PR is built on top of #332. This PR refactors the ResponsiveWebapp and example.js files a bit to streamline the example.js file and include more component slots as needed. Since this is perhaps a bit more involved than what #332 set out to do, it may be more appropriate to set the base branch to
dev, but since this PR arose from seeing how #332 was presented, it is proposed to be incorporated into #332 for now.Here is a summary of the changed items:
ResponsiveWebapp
The component has been refactored so that the
desktopViewandmobileVieware no longer required props. The logic for these props that was in example.js has mostly been moved in here with some components being obtained from the context API as needed.example.js
This is refactored so that the ResponsiveWebapp is only called with the
componentsprop. Thecomponentsprop has had additional components added to it that are then used elsewhere.Mobile components refactor
The props that were passed through to the MobileMain component have been removed in favor of using the context API. This affected a few components as should be seen. The
results-screen.jsfile's render function was really big, so I made some sub-renderers to make things a little easier to manage.create-otp-reducer
There was an unneeded second argument in the
getInitialStatesince the argument for that was always present in the first argument. Therefore, I removed the second argument.