Add progress bar to top of page for nicer loading indicator styles
This commit is contained in:
parent
708c15eba8
commit
d3a06e1ca8
12 changed files with 133 additions and 34 deletions
30
resources/scripts/state/progress.ts
Normal file
30
resources/scripts/state/progress.ts
Normal file
|
@ -0,0 +1,30 @@
|
|||
import { action, Action } from 'easy-peasy';
|
||||
|
||||
export interface ProgressStore {
|
||||
continuous: boolean;
|
||||
progress?: number;
|
||||
|
||||
startContinuous: Action<ProgressStore>;
|
||||
setProgress: Action<ProgressStore, number | undefined>;
|
||||
setComplete: Action<ProgressStore>;
|
||||
}
|
||||
|
||||
const progress: ProgressStore = {
|
||||
continuous: false,
|
||||
progress: undefined,
|
||||
|
||||
startContinuous: action(state => {
|
||||
state.continuous = true;
|
||||
}),
|
||||
|
||||
setProgress: action((state, payload) => {
|
||||
state.progress = payload;
|
||||
}),
|
||||
|
||||
setComplete: action(state => {
|
||||
state.progress = 100;
|
||||
state.continuous = false;
|
||||
}),
|
||||
};
|
||||
|
||||
export default progress;
|
Reference in a new issue