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

ui: add progress bar when switching pages #587

Closed
wants to merge 2 commits into from
Closed

Conversation

baurine
Copy link
Collaborator

@baurine baurine commented Jun 1, 2020

resolve #126

What did:

  • Add progress bar in the top of page when switching pages

Just not sure whether this is a good way, because the NProgess is a jQuery-style lib which operates the DOM directly.

And the progress bar color is not very explicit. If we want to change that color, we need to copy the nprogress.css from node_modules and edit it.

Demo:

5

@breezewish
Copy link
Member

How about the solution react-top-loading-bar suggested in #126?

@baurine
Copy link
Collaborator Author

baurine commented Jun 2, 2020

How about the solution react-top-loading-bar suggested in #126?

I glanced at its documents and example project - react-moviews, it seems need to change much code so I didn't try it. I can have a try today and see whether there are some other solutions.

@baurine baurine force-pushed the add-progress-bar branch from c88115a to 97cb46b Compare June 4, 2020 06:18
@baurine
Copy link
Collaborator Author

baurine commented Jun 4, 2020

7

9

New solution by react-top-loading-bar, looks nice.

@baurine baurine marked this pull request as draft June 4, 2020 06:40
<div className={styles.dialogContainer}>
<div className={styles.dialog}>
<TiDBSignInForm registry={registry} />
<Router>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After testing, the TopLoadingBar can't receive the single-spa:before-routing-event event if it isn't wrapped by the Router component.

@baurine baurine marked this pull request as ready for review June 4, 2020 06:54
<div className={styles.dialog}>
<TiDBSignInForm registry={registry} />
<Router>
<TopLoadingBar />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about making it another SingleSPA app that always exists on the page, or simply put it outside everything mounted by SingleSPA. In this way, it can listen SingleSPA global events gracefully without worrying about its own lifecycle.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be a solution, let me have a try.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implement it by this way in PR #661 , much more graceful! will close this PR.

@baurine
Copy link
Collaborator Author

baurine commented Jun 29, 2020

Implement it by PR #661 with new solution, so close this PR.

@baurine baurine closed this Jun 29, 2020
@baurine
Copy link
Collaborator Author

baurine commented Jun 30, 2020

Btw, this branch can be deleted.

@breezewish breezewish deleted the add-progress-bar branch June 30, 2020 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UCP: Show progress when switching frontend page
2 participants