feat: disabled boost button (#2326)

This commit is contained in:
lazzzis 2023-08-11 04:56:47 -07:00 committed by GitHub
parent a4d34323ed
commit 2267db11c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -9,6 +9,7 @@ const { as = 'button', command, disabled, content, icon } = defineProps<{
color: string
icon: string
activeIcon?: string
inactiveIcon?: string
hover: string
elkGroupHover: string
active?: boolean
@ -54,7 +55,7 @@ useCommand({
:hover=" !disabled ? hover : undefined"
focus:outline-none
:focus-visible="hover"
:class="active ? color : 'text-secondary'"
:class="active ? color : (disabled ? 'op25 pointer-events-none' : 'text-secondary')"
:aria-label="content"
:disabled="disabled"
>
@ -67,7 +68,7 @@ useCommand({
'group-focus-visible:ring': '2 current',
}"
>
<div :class="active && activeIcon ? activeIcon : icon" />
<div :class="active && activeIcon ? activeIcon : (disabled ? inactiveIcon : icon)" />
</div>
</CommonTooltip>

View file

@ -60,6 +60,7 @@ function reply() {
color="text-green" hover="text-green" elk-group-hover="bg-green/10"
icon="i-ri:repeat-line"
active-icon="i-ri:repeat-fill"
inactive-icon="i-tabler:repeat-off"
:active="!!status.reblogged"
:disabled="isLoading.reblogged || !canReblog"
:command="command"