Skip to content

Commit

Permalink
Merge pull request #61 from ymaheshwari1/feat/timeZone
Browse files Browse the repository at this point in the history
Implemented: spinner to be displayed when fetching of timeZones is in progress
  • Loading branch information
ymaheshwari1 authored Feb 1, 2024
2 parents b486fe8 + 068fbf0 commit f974ff7
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/components/TimezoneModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@
</ion-header>

<ion-content class="ion-padding">
<!-- Empty state -->
<div class="empty-state" v-if="filteredTimeZones.length === 0">
<p>{{ $t("No time zone found")}}</p>
<div class="empty-state" v-if="isLoading">
<ion-item lines="none">
<ion-spinner name="crescent" slot="start" />
{{ "Fetching time zones" }}
</ion-item>
</div>
<div class="empty-state" v-else-if="!filteredTimeZones.length">
<p>{{ "No time zone found" }}</p>
</div>

<!-- Timezones -->
Expand Down Expand Up @@ -52,6 +57,7 @@ import {
IonRadio,
IonList,
IonSearchbar,
IonSpinner,
IonTitle,
IonToolbar,
modalController,
Expand All @@ -68,6 +74,7 @@ let queryString = ref("")
let filteredTimeZones = ref([])
let timeZones = ref([])
let timeZoneId = ref("")
let isLoading = ref(true)
onBeforeMount(() => {
getAvailableTimeZones();
Expand Down Expand Up @@ -99,6 +106,7 @@ function getAvailableTimeZones() {
});
findTimeZone();
}
isLoading.value = false;
})
}
Expand Down

0 comments on commit f974ff7

Please sign in to comment.