Skip to content

Commit

Permalink
Add skeleton loaders on operator page
Browse files Browse the repository at this point in the history
  • Loading branch information
DemogorGod committed Sep 27, 2023
1 parent a4cfd9c commit d6226ea
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
35 changes: 29 additions & 6 deletions apps/web/src/pages/operators/Operator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ import useUser from '@/composables/user'
import useOperators from '@/composables/operators'
import { UserWithAccountsAndOperators} from '@casimir/types'
const { exportFile } = useFiles()
const { convertString } = useFormat()
const { user, } = useUser()
const { user, loadingSessionLogin } = useUser()
// Form inputs
const selectedWallet = ref({address: '', wallet_provider: ''})
Expand Down Expand Up @@ -103,7 +102,7 @@ onMounted(async () => {
}
})
const {initializeComposable, nonregisteredOperators, registeredOperators, registerOperatorWithCasimir } = useOperators()
const {initializeComposable, nonregisteredOperators, registeredOperators, registerOperatorWithCasimir, loadingInitializeOperators } = useOperators()
watch(user, async () => {
if (user.value) {
Expand Down Expand Up @@ -253,15 +252,27 @@ async function submitRegisterOperatorForm() {
<template>
<div class="px-[60px] 800s:px-[5%] pt-[51px]">
<div class="flex items-start gap-[20px] justify-between flex-wrap mb-[30px]">
<h6 class="title">
<h6 class="title relative">
<div
v-show="loadingSessionLogin || loadingInitializeOperators"
class="absolute top-0 left-0 w-full h-full z-[2] rounded-[3px] overflow-hidden"
>
<div class="skeleton_box" />
</div>
Operators
</h6>

<button
class="flex items-center gap-[8px] export_button hover:text-blue_3 hover:border-blue_3 h-[38px]"
class="flex items-center gap-[8px] export_button hover:text-blue_3 hover:border-blue_3 h-[38px] relative"
:disabled="!user?.accounts"
@click="openAddOperatorModal = true"
>
<div
v-show="loadingSessionLogin || loadingInitializeOperators"
class="absolute top-0 left-0 w-full h-full z-[2] rounded-[3px] overflow-hidden"
>
<div class="skeleton_box" />
</div>
<vue-feather
type="plus"
class="icon w-[17px] h-min"
Expand All @@ -273,9 +284,15 @@ async function submitRegisterOperatorForm() {
<div
v-if="!user?.address"
class="card_container w-full px-[32px] py-[31px]
text-grey_4 flex items-center justify-center"
text-grey_4 flex items-center justify-center relative"
style="min-height: calc(100vh - 420px);"
>
<div
v-show="loadingSessionLogin || loadingInitializeOperators"
class="absolute top-0 left-0 w-full h-full z-[2] rounded-[3px] overflow-hidden"
>
<div class="skeleton_box" />
</div>
<div class="border rounded-[3px] border-grey_1 border-dashed p-[10%] text-center">
<button
class="text-primary underline"
Expand All @@ -291,6 +308,12 @@ async function submitRegisterOperatorForm() {
class="card_container w-full px-[32px] py-[31px] text-black whitespace-nowrap relative"
style="min-height: calc(100vh - 320px); height: 500px;"
>
<div
v-show="loadingSessionLogin || loadingInitializeOperators"
class="absolute top-0 left-0 w-full h-full z-[2] rounded-[3px] overflow-hidden"
>
<div class="skeleton_box" />
</div>
<!-- Form -->
<div
v-if="openAddOperatorModal"
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/pages/overview/Overview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import BreakdownTable from './components/BreakdownTable.vue'
import useUser from '@/composables/user'
import useBreakdownMetrics from '@/composables/breakdownMetrics'
import useAnalytics from '@/composables/analytics'
import userOperators from '@/composables/operators'
import useOperators from '@/composables/operators'
const {loadingSessionLogin} = useUser()
const {loadingInitializeBreakdownMetrics} = useBreakdownMetrics()
const {loadingInitializeAnalytics} = useAnalytics()
const {loadingInitializeOperators} = userOperators()
const {loadingInitializeOperators} = useOperators()
</script>

<template>
Expand Down

0 comments on commit d6226ea

Please sign in to comment.