Skip to content

Commit 8e19ca1

Browse files
supalarrySeluj78
authored andcommitted
settings loading icon
1 parent 07593f3 commit 8e19ca1

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

frontend/src/views/app/Settings.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<template>
22
<!-- eslint-disable max-len -->
33
<div class="w-full md:w-auto md:mx-16 lg:mx-32 relative md:flex items-start h-auto md:mb-16">
4-
<section class="w-auto md:max-w-xss md:shadow-md md:rounded-md">
4+
<div v-if="!settingsFetched" class="mx-auto flex items-center justify-center mt-32">
5+
<img class="h-36" src="../../assets/loading.svg">
6+
</div>
7+
<section v-if="settingsFetched" class="w-auto md:max-w-xss md:shadow-md md:rounded-md">
58
<div class="w-full md:hidden h-1 bg-white-matcha"></div>
69
<div class="md:border-b profile-card text-wrap p-16 md:py-8 flex flex-col w-full md:rounded-t-md">
710
<div class="mx-auto overflow-hidden w-48 h-48 md:w-24 md:h-24 rounded-full">
@@ -26,7 +29,7 @@
2629
<MenuButton v-on:click.native="showSetting('profile')" v-bind:class="{'md:px-8':true, 'md:bg-purple-200': getShow === 'profile'}" v-bind:text="'Profile'"></MenuButton>
2730
</div>
2831
</section>
29-
<section v-if="getShow === 'account'" class="flex flex-col items-center z-10 absolute bg-white-matcha px-8 md:pb-8 w-full top-0 left-0 h-full md:h-auto md:ml-4 md:relative md:shadow-md md:rounded-md">
32+
<section v-if="getShow === 'account' && settingsFetched" class="flex flex-col items-center z-10 absolute bg-white-matcha px-8 md:pb-8 w-full top-0 left-0 h-full md:h-auto md:ml-4 md:relative md:shadow-md md:rounded-md">
3033
<SectionHeader v-bind:name="'account'" v-on:click.native="closeSetting()"></SectionHeader>
3134
<AccountInput
3235
v-bind:name="'First Name'"
@@ -49,7 +52,7 @@
4952
v-bind:type="'password'"
5053
v-bind:currentValuePassed="''"></AccountInput>
5154
</section>
52-
<section v-if="getShow === 'profile'" class="flex flex-col items-start z-10 absolute bg-white-matcha w-full top-0 left-0 md:ml-4 md:relative md:shadow-md md:rounded-md">
55+
<section v-if="getShow === 'profile' && settingsFetched" class="flex flex-col items-start z-10 absolute bg-white-matcha w-full top-0 left-0 md:ml-4 md:relative md:shadow-md md:rounded-md">
5356
<div class="px-8 w-full">
5457
<SectionHeader class="mx-auto" v-bind:name="'profile'" v-on:click.native="closeSetting()"></SectionHeader>
5558
</div>
@@ -157,6 +160,7 @@ export default {
157160
error: null,
158161
},
159162
locationUpdateSuccess: false,
163+
settingsFetched: false,
160164
}),
161165
computed: {
162166
getShow() {
@@ -288,6 +292,7 @@ export default {
288292
}
289293
const userViewsReceivedRequest = await this.$http.get('/history/viewed/me');
290294
this.userViewsReceived = userViewsReceivedRequest.data.viewed_me.length;
295+
this.settingsFetched = true;
291296
},
292297
};
293298
</script>

0 commit comments

Comments
 (0)