feat: totally hide strict filters (#948)

This commit is contained in:
Ayo Ayco 2023-01-23 20:33:21 +01:00 committed by GitHub
parent 1a7ae6f0ef
commit a08f56676d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 82 additions and 33 deletions

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
const props = defineProps<{ enabled?: boolean; filter?: boolean }>()
const props = defineProps<{ enabled?: boolean; filter?: boolean; isDM?: boolean }>()
const showContent = ref(!props.enabled)
const toggleContent = useToggle(showContent)
@ -14,8 +14,8 @@ watchEffect(() => {
<div class="content-rich" p="x-4 b-2.5" text-center text-secondary w-full border="~ base" border-0 border-b-dotted border-b-3 mt-2>
<slot name="spoiler" />
</div>
<div flex="~ gap-1 center" w-full mt="-4.5">
<button btn-text px-2 py-1 bg-base flex="~ center gap-2" :class="showContent ? '' : 'filter-saturate-0 hover:filter-saturate-100'" @click="toggleContent()">
<div flex="~ gap-1 center" w-full :mb="isDM && !showContent ? '4' : ''" mt="-4.5">
<button btn-text px-2 py-1 :bg="isDM ? 'transparent' : 'base'" flex="~ center gap-2" :class="showContent ? '' : 'filter-saturate-0 hover:filter-saturate-100'" @click="toggleContent()">
<div v-if="showContent" i-ri:eye-line />
<div v-else i-ri:eye-close-line />
{{ showContent ? $t('status.spoiler_show_less') : $t(filter ? 'status.filter_show_anyway' : 'status.spoiler_show_more') }}