Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Result Component #66

Open
VulpesVulpes825 opened this issue Nov 5, 2021 · 8 comments
Open

Improve Result Component #66

VulpesVulpes825 opened this issue Nov 5, 2021 · 8 comments
Labels
good first issue Good for newcomers

Comments

@VulpesVulpes825
Copy link
Collaborator

VulpesVulpes825 commented Nov 5, 2021

The improved Result component should use React Hooks and include following parameters:

  • status parameter that take success | error | info | warning
  • title parameter to dispaly a title under the icon on Result page
  • intro parameter to display additional information for explanation.

Antd Result Component is a good example.

@VulpesVulpes825 VulpesVulpes825 added the good first issue Good for newcomers label Nov 5, 2021
@uhtna
Copy link

uhtna commented Nov 15, 2021

How would I call the Result function within Survey.jsx? I don't exactly understand what the current return Result section does. I want to start testing my Result.jsx but don't know if what is currently in Survey.jsx actually interacts with the parameters in Result.jsx at all.

image

@VulpesVulpes825
Copy link
Collaborator Author

VulpesVulpes825 commented Nov 15, 2021

@uhtna Please check here for more about Suspense. In short, suspense enable code splitting, so we only load Result component when we need it, which is at the end.

@uhtna
Copy link

uhtna commented Nov 15, 2021

Ok I see. How can I test my updated Result.jsx file? I tried to implement some stuff to output results based on the parameters you requested but don't understand where or how to call the function.

@VulpesVulpes825
Copy link
Collaborator Author

VulpesVulpes825 commented Nov 15, 2021

@uhtna Easiest way, add a new route in App.jsx with additional route like this:
<Route path='/result' component={<Result status={warning}/>} />
Then access localhost:3000/result

@uhtna
Copy link

uhtna commented Nov 17, 2021

I'm recieving an error when adding the route.
image
image
image
image
image
image
image

@VulpesVulpes825
Copy link
Collaborator Author

VulpesVulpes825 commented Nov 17, 2021

@uhtna Have you imported Result?
P.S You can create a PR now with whatever you have written, and push further changes to the some branch you create PR for auto update.

@uhtna
Copy link

uhtna commented Nov 18, 2021

How would I import it?
image
I took this from Survey.jsx and added it to App.jsx

@VulpesVulpes825
Copy link
Collaborator Author

@uhtna Check the React manual for detail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
2 participants