Skip to content

Commit 51b4bc5

Browse files
committed
feat: update Modal component styles and enhance PluginHub with tag visibility toggle
1 parent 7974dc7 commit 51b4bc5

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

frontend/src/components/Modal/index.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ provide('submit', handleSubmit)
137137
<Icon
138138
:class="{ maximize: isMaximize }"
139139
icon="arrowDown"
140-
class="origin-center duration-200"
140+
class="maximize-normal origin-center duration-200"
141141
/>
142142
</Button>
143143
</div>
@@ -190,8 +190,10 @@ provide('submit', handleSubmit)
190190
background-color: var(--modal-bg);
191191
}
192192
}
193-
194-
.maximize {
193+
.maximize-normal {
195194
transform: rotate(-180deg);
196195
}
196+
.maximize {
197+
transform: rotate(0deg);
198+
}
197199
</style>

frontend/src/views/PluginsView/components/PluginHub.vue

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { computed, ref } from 'vue'
33
import { useI18n } from 'vue-i18n'
44
5+
import { useBool } from '@/hooks'
56
import { usePluginsStore } from '@/stores'
67
import { deepClone, message, sleep } from '@/utils'
78
@@ -11,6 +12,7 @@ const keywords = ref('')
1112
const { t } = useI18n()
1213
const pluginsStore = usePluginsStore()
1314
15+
const [tagsVisible, toggleTagsVisible] = useBool(false)
1416
const tags = ref<Set<string>>(new Set())
1517
1618
const allTags = computed(() => {
@@ -27,6 +29,10 @@ const allTags = computed(() => {
2729
2830
const onTagClose = (tag: string) => tags.value.delete(tag)
2931
32+
const toggleChecked = (tag: string) => {
33+
tags.value.has(tag) ? tags.value.delete(tag) : tags.value.add(tag)
34+
}
35+
3036
const filteredPlugins = computed(() => {
3137
const allPlugins = pluginsStore.pluginHub
3238
const keyword = keywords.value.trim()
@@ -80,6 +86,12 @@ if (pluginsStore.pluginHub.length === 0) {
8086
</div>
8187
<div v-else class="flex flex-col h-full">
8288
<div class="flex items-center gap-8">
89+
<Button
90+
@click="toggleTagsVisible"
91+
icon="settings3"
92+
size="small"
93+
:icon-color="tagsVisible ? 'var(--primary-color)' : ''"
94+
/>
8395
<Input
8496
v-model="keywords"
8597
:border="false"
@@ -106,10 +118,10 @@ if (pluginsStore.pluginHub.length === 0) {
106118
{{ t('plugins.update') }}
107119
</Button>
108120
</div>
109-
<div class="flex flex-wrap gap-2 mt-8">
121+
<div v-if="tagsVisible" class="flex flex-wrap gap-2 mt-8">
110122
<Tag
111123
v-for="tag in allTags"
112-
@click="tags.add(tag.name)"
124+
@click="toggleChecked(tag.name)"
113125
:color="tags.has(tag.name) ? 'primary' : 'default'"
114126
:key="tag.name"
115127
class="cursor-pointer"
@@ -120,7 +132,7 @@ if (pluginsStore.pluginHub.length === 0) {
120132

121133
<Empty v-if="filteredPlugins.length === 0" />
122134

123-
<div class="overflow-y-auto grid grid-cols-3 text-12 gap-8 mt-8">
135+
<div class="overflow-y-auto grid grid-cols-3 text-12 gap-8 mt-8 pb-16 pr-8">
124136
<Card v-for="plugin in filteredPlugins" :key="plugin.id" :title="plugin.name">
125137
<div class="flex flex-col h-full">
126138
<div v-tips="plugin.description" class="flex-1 line-clamp-2">

0 commit comments

Comments
 (0)