Skip to content

Commit

Permalink
fix: fix passing extraneous props to component (#921)
Browse files Browse the repository at this point in the history
* fix: fix passing extraneous props to component

* fix: remove extra div
  • Loading branch information
wa0x6e authored Oct 24, 2024
1 parent 9b3e06e commit 1b269b6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 24 deletions.
44 changes: 21 additions & 23 deletions apps/ui/src/components/ProposalVote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,29 +56,27 @@ const isEditable = computed(() => {

<template>
<slot v-if="currentVote && !editMode" name="voted" :vote="currentVote">
<div v-bind="$attrs">
<UiButton
class="!h-[48px] text-left w-full flex items-center rounded-lg space-x-2"
:disabled="!isEditable"
@click="$emit('enterEditMode')"
<UiButton
class="!h-[48px] text-left w-full flex items-center rounded-lg space-x-2"
:disabled="!isEditable"
@click="$emit('enterEditMode')"
>
<div
v-if="proposal.privacy"
class="flex space-x-2 items-center grow truncate"
:class="{ 'text-skin-text': !isEditable }"
>
<div
v-if="proposal.privacy"
class="flex space-x-2 items-center grow truncate"
:class="{ 'text-skin-text': !isEditable }"
>
<IH-lock-closed class="size-[16px] shrink-0" />
<span class="truncate">Encrypted choice</span>
</div>
<div
v-else
class="grow truncate"
:class="{ 'text-skin-text': !isEditable }"
v-text="getChoiceText(proposal.choices, currentVote.choice)"
/>
<IH-pencil v-if="isEditable" class="shrink-0" />
</UiButton>
</div>
<IH-lock-closed class="size-[16px] shrink-0" />
<span class="truncate">Encrypted choice</span>
</div>
<div
v-else
class="grow truncate"
:class="{ 'text-skin-text': !isEditable }"
v-text="getChoiceText(proposal.choices, currentVote.choice)"
/>
<IH-pencil v-if="isEditable" class="shrink-0" />
</UiButton>
</slot>
<slot
v-else-if="
Expand Down Expand Up @@ -112,7 +110,7 @@ const isEditable = computed(() => {
<slot v-else-if="isInvalidNetwork" name="wrong-safe-network">
Safe's network should be same as space's network
</slot>
<div v-else v-bind="$attrs">
<div v-else>
<slot />
</div>
</template>
3 changes: 2 additions & 1 deletion apps/ui/src/components/ProposalsListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const handleVoteClick = (choice: Choice) => {
class="flex-auto mr-4 w-0"
/>
<div class="hidden md:block">
<ProposalVote :proposal="proposal" class="py-2">
<ProposalVote :proposal="proposal">
<template #wrong-safe-network><div /></template>
<template #unsupported><div /></template>
<template #waiting><div /></template>
Expand All @@ -56,6 +56,7 @@ const handleVoteClick = (choice: Choice) => {
<ProposalVoteBasic
v-if="proposal.type === 'basic'"
:size="40"
class="py-2"
@vote="handleVoteClick"
/>
</ProposalVote>
Expand Down

0 comments on commit 1b269b6

Please sign in to comment.