-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
477c017
commit 4198777
Showing
2 changed files
with
75 additions
and
1 deletion.
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
64 changes: 64 additions & 0 deletions
64
components/pages/posts/navigation/search/SearchTagCollections.vue
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,64 @@ | ||
<template> | ||
<div class="absolute inset-0 z-50 flex pointer-events-none text-default-text"> | ||
<div class="p-4 m-auto pointer-events-auto material-container"> | ||
<h2 | ||
class="text-lg font-semibold tracking-wide text-center text-gradient-one" | ||
> | ||
Tag Collections | ||
</h2> | ||
|
||
<!-- Tag Collections --> | ||
<div class="mt-4"> | ||
<template v-if="getTagCollections.length"> | ||
<div | ||
v-for="(tagCollection, index) in getTagCollections" | ||
:key="tagCollection.name" | ||
class="flex items-center justify-between" | ||
> | ||
<p class="truncate">{{ tagCollection.name }}</p> | ||
|
||
<p | ||
class="flex-shrink-0 tag text-default-text hover:text-default-text-muted" | ||
@click="addTagCollectionToAddedTags(index)" | ||
> | ||
{{ `${tagCollection.tags.length} tags` }} | ||
</p> | ||
</div> | ||
</template> | ||
|
||
<template v-else> | ||
<div class="text-center"> | ||
<h3>No Tag Collections available</h3> | ||
<nuxt-link to="/premium">Create one?</nuxt-link> | ||
</div> | ||
</template> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { mapGetters, mapActions } from 'vuex' | ||
export default { | ||
name: 'SearchBar', | ||
computed: { | ||
...mapGetters('user', ['getTagCollections']), | ||
}, | ||
methods: { | ||
...mapActions('booru', ['addedTagsManager']), | ||
...mapActions('navigation', ['tagCollectionsNavigationManager']), | ||
addTagCollectionToAddedTags(tagCollectionIndex) { | ||
this.addedTagsManager({ | ||
operation: 'concat', | ||
value: this.getTagCollections[tagCollectionIndex].tags, | ||
}) | ||
this.tagCollectionsNavigationManager({ operation: 'set', value: false }) | ||
}, | ||
}, | ||
} | ||
</script> |