Skip to content

Commit

Permalink
fix(ui): use loading props from UiButton for the loading state (#534)
Browse files Browse the repository at this point in the history
  • Loading branch information
wa0x6e authored Jul 26, 2024
1 parent 84ca1fb commit dd04ddf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
4 changes: 2 additions & 2 deletions apps/ui/src/components/ButtonFollow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ const loading = computed(
:disabled="loading || isSafeWallet"
class="group"
:class="{ 'hover:border-skin-danger': spaceFollowed }"
:loading="loading"
@click.prevent="followedSpacesStore.toggleSpaceFollow(spaceIdComposite)"
>
<UiLoading v-if="loading" />
<span v-else-if="spaceFollowed" class="inline-block">
<span v-if="spaceFollowed" class="inline-block">
<span class="group-hover:inline hidden text-skin-danger">Unfollow</span>
<span class="group-hover:hidden">Following</span>
</span>
Expand Down
14 changes: 4 additions & 10 deletions apps/ui/src/views/Proposal/Overview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,10 @@ onBeforeUnmount(() => destroyAudio());
<UiButton
class="!p-0 border-0 !h-[auto]"
:disabled="aiSummaryState.loading"
:loading="aiSummaryState.loading"
@click="handleAiSummaryClick"
>
<UiLoading
v-if="aiSummaryState.loading"
class="inline-block !w-[22px] !h-[22px]"
/>
<IH-sparkles
v-else
class="inline-block w-[22px] h-[22px]"
:class="aiSummaryOpen ? 'text-skin-link' : 'text-skin-text'"
/>
Expand All @@ -277,14 +273,12 @@ onBeforeUnmount(() => destroyAudio());
<UiButton
class="!p-0 border-0 !h-[auto]"
:disabled="aiSpeechState.loading"
:loading="aiSpeechState.loading"
@click="handleAiSpeechClick"
>
<UiLoading
v-if="aiSpeechState.loading"
class="inline-block !w-[22px] !h-[22px]"
/>
<UiLoading class="inline-block !w-[22px] !h-[22px]" />
<IH-pause
v-else-if="audioState === 'playing'"
v-if="audioState === 'playing'"
class="inline-block w-[22px] h-[22px] text-skin-link"
/>
<IH-play
Expand Down

0 comments on commit dd04ddf

Please sign in to comment.