|
1 | 1 | <template> |
2 | 2 | <!-- eslint-disable max-len --> |
3 | 3 | <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"> |
5 | 8 | <div class="w-full md:hidden h-1 bg-white-matcha"></div> |
6 | 9 | <div class="md:border-b profile-card text-wrap p-16 md:py-8 flex flex-col w-full md:rounded-t-md"> |
7 | 10 | <div class="mx-auto overflow-hidden w-48 h-48 md:w-24 md:h-24 rounded-full"> |
|
26 | 29 | <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> |
27 | 30 | </div> |
28 | 31 | </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"> |
30 | 33 | <SectionHeader v-bind:name="'account'" v-on:click.native="closeSetting()"></SectionHeader> |
31 | 34 | <AccountInput |
32 | 35 | v-bind:name="'First Name'" |
|
49 | 52 | v-bind:type="'password'" |
50 | 53 | v-bind:currentValuePassed="''"></AccountInput> |
51 | 54 | </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"> |
53 | 56 | <div class="px-8 w-full"> |
54 | 57 | <SectionHeader class="mx-auto" v-bind:name="'profile'" v-on:click.native="closeSetting()"></SectionHeader> |
55 | 58 | </div> |
@@ -157,6 +160,7 @@ export default { |
157 | 160 | error: null, |
158 | 161 | }, |
159 | 162 | locationUpdateSuccess: false, |
| 163 | + settingsFetched: false, |
160 | 164 | }), |
161 | 165 | computed: { |
162 | 166 | getShow() { |
@@ -288,6 +292,7 @@ export default { |
288 | 292 | } |
289 | 293 | const userViewsReceivedRequest = await this.$http.get('/history/viewed/me'); |
290 | 294 | this.userViewsReceived = userViewsReceivedRequest.data.viewed_me.length; |
| 295 | + this.settingsFetched = true; |
291 | 296 | }, |
292 | 297 | }; |
293 | 298 | </script> |
|
0 commit comments