-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Hide flagged proposals (#4104)
* Add proposals filter * Fixes * Fix bugs * Remove redundant util function * Add flagged query * Fixe * Fix text * Fix filter jump * Fix radio * Fixes * Update version * Fix type * Fix funnel size * Fix align
- Loading branch information
Showing
10 changed files
with
159 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<script setup lang="ts"> | ||
const router = useRouter(); | ||
const route = useRoute(); | ||
const titleSearch = computed(() => (route.query.q as string) || ''); | ||
function handleUpdateSearch(e: string) { | ||
router.push({ | ||
query: { ...route.query, q: e || undefined } | ||
}); | ||
} | ||
</script> | ||
|
||
<template> | ||
<div | ||
class="w-full rounded-full border border-skin-border pl-3 pr-0 focus-within:!border-skin-text md:max-w-[420px]" | ||
> | ||
<div class="flex"> | ||
<BaseSearch | ||
:model-value="titleSearch" | ||
:placeholder="$t('searchPlaceholder')" | ||
class="flex-auto pr-2" | ||
@update:model-value="handleUpdateSearch" | ||
/> | ||
<div class="flex items-center border-l" style="height: 44px"> | ||
<SpaceProposalsSearchFilter /> | ||
</div> | ||
</div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
<script setup lang="ts"> | ||
const route = useRoute(); | ||
const router = useRouter(); | ||
const { t } = useI18n(); | ||
const stateFilter = computed(() => (route.query.state as string) || 'all'); | ||
const showOnlyCore = computed(() => (route.query.onlyCore as string) || '0'); | ||
const showFlagged = computed(() => (route.query.showFlagged as string) || '0'); | ||
const stateFilters = computed(() => [ | ||
{ | ||
text: t('proposals.states.all'), | ||
action: 'all', | ||
extras: { selected: stateFilter.value === 'all' } | ||
}, | ||
{ | ||
text: t('proposals.states.active'), | ||
action: 'active', | ||
extras: { selected: stateFilter.value === 'active' } | ||
}, | ||
{ | ||
text: t('proposals.states.pending'), | ||
action: 'pending', | ||
extras: { selected: stateFilter.value === 'pending' } | ||
}, | ||
{ | ||
text: t('proposals.states.closed'), | ||
action: 'closed', | ||
extras: { selected: stateFilter.value === 'closed' } | ||
} | ||
]); | ||
function updateFilters(e: string) { | ||
router.push({ | ||
query: { ...route.query, state: e || undefined } | ||
}); | ||
} | ||
function updateCore(e: boolean) { | ||
router.push({ | ||
query: { ...route.query, onlyCore: e ? '1' : undefined } | ||
}); | ||
} | ||
function updateFlagged(e: boolean) { | ||
router.push({ | ||
query: { ...route.query, showFlagged: e ? '1' : undefined } | ||
}); | ||
} | ||
</script> | ||
|
||
<template> | ||
<BasePopover :focus="false" class="h-full"> | ||
<template #button> | ||
<BaseButtonIcon class="flex h-full w-[54px] justify-center outline-none"> | ||
<i-ho-funnel class="mr-1 text-base text-skin-link" /> | ||
</BaseButtonIcon> | ||
</template> | ||
<template #content> | ||
<div> | ||
<h3 class="-mb-2 mt-3 text-center text-skin-heading">Filters</h3> | ||
<div class="m-4 space-y-3"> | ||
<div class="space-y-2"> | ||
<span class="text-skin-heading"> Proposal status </span> | ||
<TuneRadio | ||
v-for="(state, index) in stateFilters" | ||
:id="JSON.stringify(index)" | ||
:key="state.action" | ||
:value="state.action" | ||
:hint="state.text" | ||
:model-value="stateFilter" | ||
@update:model-value="updateFilters($event as string)" | ||
/> | ||
</div> | ||
<div class="space-y-2"> | ||
<span class="text-skin-heading"> More </span> | ||
<TuneCheckbox | ||
id="onlyCore" | ||
:model-value="showOnlyCore === '1'" | ||
hint="Only core member proposals" | ||
name="onlyCore" | ||
@update:model-value="updateCore($event as boolean)" | ||
/> | ||
<TuneCheckbox | ||
id="showFlagged" | ||
:model-value="showFlagged === '1'" | ||
hint="Show flagged proposals" | ||
name="showFlagged" | ||
@update:model-value="updateFlagged($event as boolean)" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
</BasePopover> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ba0d284
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
snapshot – ./
snapshot-tau.vercel.app
snapshot-snapshot.vercel.app
snapshot-git-develop-snapshot.vercel.app
vercel.snapshot.org
snapshot.org