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)
168168 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"
169169 @click="handleSubmit(item.value)"
170170 >
171 <span>{{ item.label }}</span>
171 <span :class="[item.icon, 'mr-1 inline-block align-middle']" />
172 <span class="align-middle">{{ item.label }}</span>
172173 </button>
173174 </div>
174175 </div>
175176 <div v-else-if="feedback.type && !success">
176177 <div class="mb-2">
177178 <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>
179183 </div>
180184
181185 <div v-if="feedback.type === 'submit'" class="mb-2 text-sm">
@@ -282,15 +286,15 @@ const toggleCard = () => (isCardShown.value = !isCardShown.value)
282286 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"
283287 @click="feedback.type = undefined"
284288 >
285 <span class="i-lucide:panel-left-close">close</span>
289 <span class="i-lucide:arrow-left-from-line">close</span>
286290 </button>
287291 <button
288292 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"
290294 :disabled="isDisabled"
291295 @click="handleSubmit()"
292296 >
293 Send Feedback 📩
297 Send Feedback <span class="i-lucide:mail-check" />
294298 </button>
295299 </div>
296300 </div>
docs/.vitepress/types/Feedback.ts +17 −7
@@ -24,31 +24,41 @@ export const FeedbackSchema = z.object({
2424
2525export interface Option {
2626 label: string
27 icon: string
2728 value: FeedbackType['type']
2829}
2930
3031export const feedbackOptions: Option[] = [
3132 {
32 label: '➕ Submit link',
33 label: 'Submit link',
34 icon: 'i-lucide:circle-plus',
3335 value: 'submit'
3436 },
3537 {
36 label: '❗ Update link',
38 label: 'Update link',
39 icon: 'i-lucide:circle-alert',
3740 value: 'update'
3841 },
3942 {
40 label: '❌ Report bad / dead link',
43 label: 'Report bad / dead link',
44 icon: 'i-lucide:circle-x',
4145 value: 'report'
4246 },
4347 {
44 label: '💡 Suggest edit',
48 label: 'Suggest edit',
49 icon: 'i-lucide:lightbulb',
4550 value: 'suggestion'
4651 },
4752 {
48 label: '❤ Love the wiki',
53 label: 'Love the wiki',
54 icon: 'i-lucide:heart',
4955 value: 'appreciation'
5056 },
51 { label: '💬 Something else', value: 'other' }
57 {
58 label: 'Something else',
59 icon: 'i-lucide:message-circle',
60 value: 'other'
61 }
5262]
5363
5464export function getFeedbackOption(
@@ -57,4 +67,4 @@ export function getFeedbackOption(
5767 return feedbackOptions.find((option) => option.value === value)
5868}
5969
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 = {
2525 // Add more custom icons here as needed
2626}
2727
28const safelist = Object.entries(colors).flatMap(([group, shades]) =>
29 Object.keys(shades).flatMap((shade) => [
30 `text-${group}-${shade}`,
31 `bg-${group}-${shade}`
32 ])
33)
28const safelist = [
29 ...Object.entries(colors).flatMap(([group, shades]) =>
30 Object.keys(shades).flatMap((shade) => [
31 `text-${group}-${shade}`,
32 `bg-${group}-${shade}`
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]
3442
3543export default defineConfig({
3644 content: {
@@ -99,4 +107,4 @@ export default defineConfig({
99107 })
100108 ],
101109 transformers: [transformerDirectives()]
102})
110})
\ No newline at end of file