Commit 05dbade9b0

05dbade9b05e065f3e13c9ef472d3a9873f09249

parent: 29069d7af4

Unsigned

Duck <57977673+woducku@users.noreply.github.com> · 2026-05-09 08:27 UTC

Feedback icon fix

Layout: unified · split

docs/.vitepress/theme/components/Feedback.vue +9 −5
@@ -168,14 +168,18 @@ const toggleCard = () => (isCardShown.value = !isCardShown.value)
168 class="bg-bg border-$vp-c-default-soft hover:border-primary mt-2 select-none rounded border-2 border-solid font-bold transition-all duration-250 rounded-lg text-[14px] font-500 leading-normal m-0 px-3 py-1.5 text-center align-middle whitespace-nowrap" 168 class="bg-bg border-$vp-c-default-soft hover:border-primary mt-2 select-none rounded border-2 border-solid font-bold transition-all duration-250 rounded-lg text-[14px] font-500 leading-normal m-0 px-3 py-1.5 text-center align-middle whitespace-nowrap"
169 @click="handleSubmit(item.value)" 169 @click="handleSubmit(item.value)"
170 > 170 >
171 <span>{{ item.label }}</span> 171 <span :class="[item.icon, 'mr-1 inline-block align-middle']" />
172 <span class="align-middle">{{ item.label }}</span>
172 </button> 173 </button>
173 </div> 174 </div>
174 </div> 175 </div>
175 <div v-else-if="feedback.type && !success"> 176 <div v-else-if="feedback.type && !success">
176 <div class="mb-2"> 177 <div class="mb-2">
177 <p class="desc">{{ helpfulDescription }}</p> 178 <p class="desc">{{ helpfulDescription }}</p>
178 <span class="text-[22px] font-bold">{{ getFeedbackOption(feedback.type)?.label }}</span> 179 <span class="text-[22px] font-bold flex items-center gap-2">
180 <span :class="getFeedbackOption(feedback.type)?.icon" />
181 {{ getFeedbackOption(feedback.type)?.label }}
182 </span>
179 </div> 183 </div>
180 184
181 <div v-if="feedback.type === 'submit'" class="mb-2 text-sm"> 185 <div v-if="feedback.type === 'submit'" class="mb-2 text-sm">
@@ -282,15 +286,15 @@ const toggleCard = () => (isCardShown.value = !isCardShown.value)
282 class="bg-$vp-c-default-soft text-primary border-$vp-c-default-soft inline-flex h-7 items-center justify-center whitespace-nowrap rounded-md border-2 border-solid px-1.5 py-3.5 text-sm font-medium transition-all duration-300 sm:h-6" 286 class="bg-$vp-c-default-soft text-primary border-$vp-c-default-soft inline-flex h-7 items-center justify-center whitespace-nowrap rounded-md border-2 border-solid px-1.5 py-3.5 text-sm font-medium transition-all duration-300 sm:h-6"
283 @click="feedback.type = undefined" 287 @click="feedback.type = undefined"
284 > 288 >
285 <span class="i-lucide:panel-left-close">close</span> 289 <span class="i-lucide:arrow-left-from-line">close</span>
286 </button> 290 </button>
287 <button 291 <button
288 type="submit" 292 type="submit"
289 class="border border-div rounded-lg transition-colors duration-250 inline-block text-14px font-500 leading-1.5 px-3 py-3 text-center align-middle whitespace-nowrap disabled:opacity-50 text-text-2 bg-swarm-100 dark:bg-swarm-700 border-swarm-800 dark:border-swarm-700 disabled:bg-swarm-100 dark:disabled:bg-swarm-900 hover:border-swarm-900 dark:hover:border-swarm-800 hover:bg-swarm-200 dark:hover:bg-swarm-800" 293 style="background-color: #438afe; border-color: #438afe;" class="border rounded-lg transition-colors duration-250 inline-flex items-center gap-1 text-14px font-500 leading-1.5 px-3 py-1.5 text-center align-middle whitespace-nowrap disabled:opacity-50 text-white hover:brightness-110 disabled:opacity-50"
290 :disabled="isDisabled" 294 :disabled="isDisabled"
291 @click="handleSubmit()" 295 @click="handleSubmit()"
292 > 296 >
293 Send Feedback 📩 297 Send Feedback <span class="i-lucide:mail-check" />
294 </button> 298 </button>
295 </div> 299 </div>
296 </div> 300 </div>
docs/.vitepress/types/Feedback.ts +17 −7
@@ -24,31 +24,41 @@ export const FeedbackSchema = z.object({
24 24
25export interface Option { 25export interface Option {
26 label: string 26 label: string
27 icon: string
27 value: FeedbackType['type'] 28 value: FeedbackType['type']
28} 29}
29 30
30export const feedbackOptions: Option[] = [ 31export const feedbackOptions: Option[] = [
31 { 32 {
32 label: '➕ Submit link', 33 label: 'Submit link',
34 icon: 'i-lucide:circle-plus',
33 value: 'submit' 35 value: 'submit'
34 }, 36 },
35 { 37 {
36 label: '❗ Update link', 38 label: 'Update link',
39 icon: 'i-lucide:circle-alert',
37 value: 'update' 40 value: 'update'
38 }, 41 },
39 { 42 {
40 label: '❌ Report bad / dead link', 43 label: 'Report bad / dead link',
44 icon: 'i-lucide:circle-x',
41 value: 'report' 45 value: 'report'
42 }, 46 },
43 { 47 {
44 label: '💡 Suggest edit', 48 label: 'Suggest edit',
49 icon: 'i-lucide:lightbulb',
45 value: 'suggestion' 50 value: 'suggestion'
46 }, 51 },
47 { 52 {
48 label: '❤ Love the wiki', 53 label: 'Love the wiki',
54 icon: 'i-lucide:heart',
49 value: 'appreciation' 55 value: 'appreciation'
50 }, 56 },
51 { label: '💬 Something else', value: 'other' } 57 {
58 label: 'Something else',
59 icon: 'i-lucide:message-circle',
60 value: 'other'
61 }
52] 62]
53 63
54export function getFeedbackOption( 64export function getFeedbackOption(
@@ -57,4 +67,4 @@ export function getFeedbackOption(
57 return feedbackOptions.find((option) => option.value === value) 67 return feedbackOptions.find((option) => option.value === value)
58} 68}
59 69
60export type FeedbackType = z.infer<typeof FeedbackSchema> 70export type FeedbackType = z.infer<typeof FeedbackSchema>\ No newline at end of file
unocss.config.ts +15 −7
@@ -25,12 +25,20 @@ const customIcons = {
25 // Add more custom icons here as needed 25 // Add more custom icons here as needed
26} 26}
27 27
28const safelist = Object.entries(colors).flatMap(([group, shades]) => 28const safelist = [
29 Object.keys(shades).flatMap((shade) => [ 29 ...Object.entries(colors).flatMap(([group, shades]) =>
30 `text-${group}-${shade}`, 30 Object.keys(shades).flatMap((shade) => [
31 `bg-${group}-${shade}` 31 `text-${group}-${shade}`,
32 ]) 32 `bg-${group}-${shade}`
33) 33 ])
34 ),
35 'i-lucide:circle-plus',
36 'i-lucide:circle-alert',
37 'i-lucide:circle-x',
38 'i-lucide:lightbulb',
39 'i-lucide:heart',
40 'i-lucide:message-circle'
41]
34 42
35export default defineConfig({ 43export default defineConfig({
36 content: { 44 content: {
@@ -99,4 +107,4 @@ export default defineConfig({
99 }) 107 })
100 ], 108 ],
101 transformers: [transformerDirectives()] 109 transformers: [transformerDirectives()]
102}) 110})\ No newline at end of file