From 0727428716c5408633357ab8d9ffcd320cbda8ce Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 24 Apr 2023 19:30:23 +1200 Subject: [PATCH] Renamed Loader to Spinner, added theming and localization --- resources/js/app.js | 10 +-- resources/js/components/Loader.vue | 77 ------------------- resources/js/components/OtpDisplayer.vue | 4 +- resources/js/components/Spinner.vue | 96 ++++++++++++++++++++++++ resources/js/views/Accounts.vue | 10 +-- resources/lang/en/commons.php | 3 +- resources/sass/app.scss | 33 +++++++- 7 files changed, 142 insertions(+), 91 deletions(-) delete mode 100644 resources/js/components/Loader.vue create mode 100644 resources/js/components/Spinner.vue diff --git a/resources/js/app.js b/resources/js/app.js index 9b20aae5..50165ac9 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -21,7 +21,7 @@ const app = new Vue({ isDemoApp: window.isDemoApp, isTestingApp: window.isTestingApp, prefersDarkScheme: window.matchMedia('(prefers-color-scheme: dark)').matches, - loaderActive: false + spinnerActive: false }, computed: { @@ -47,12 +47,12 @@ const app = new Vue({ this.prefersDarkScheme = matches }, - showLoader() { - this.loaderActive = true + showSpinner() { + this.spinnerActive = true }, - hideLoader() { - this.loaderActive = false + hideSpinner() { + this.spinnerActive = false } }, i18n, diff --git a/resources/js/components/Loader.vue b/resources/js/components/Loader.vue deleted file mode 100644 index 359a3969..00000000 --- a/resources/js/components/Loader.vue +++ /dev/null @@ -1,77 +0,0 @@ - - - - - diff --git a/resources/js/components/OtpDisplayer.vue b/resources/js/components/OtpDisplayer.vue index abcc328e..cc7db4f3 100644 --- a/resources/js/components/OtpDisplayer.vue +++ b/resources/js/components/OtpDisplayer.vue @@ -173,10 +173,10 @@ this.clearOTP() } finally { - this.$root.hideLoader(); + this.$root.hideSpinner(); } } else { - this.$root.hideLoader(); + this.$root.hideSpinner(); } }, diff --git a/resources/js/components/Spinner.vue b/resources/js/components/Spinner.vue new file mode 100644 index 00000000..82b50999 --- /dev/null +++ b/resources/js/components/Spinner.vue @@ -0,0 +1,96 @@ + + + + + diff --git a/resources/js/views/Accounts.vue b/resources/js/views/Accounts.vue index 7a5a2f9c..164b5c4b 100644 --- a/resources/js/views/Accounts.vue +++ b/resources/js/views/Accounts.vue @@ -1,7 +1,7 @@