mirror of
https://github.com/ArthurDanjou/arthome.git
synced 2026-01-14 12:14:33 +01:00
Add icons to search query
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
import { IconsCollection } from './types/types'
|
||||||
|
|
||||||
export default defineNuxtConfig({
|
export default defineNuxtConfig({
|
||||||
future: { compatibilityVersion: 4 },
|
future: { compatibilityVersion: 4 },
|
||||||
|
|
||||||
@@ -43,7 +45,7 @@ export default defineNuxtConfig({
|
|||||||
|
|
||||||
// Nuxt Icon
|
// Nuxt Icon
|
||||||
icon: {
|
icon: {
|
||||||
serverBundle: ['ph', 'heroicons', 'vscode-icons', 'simple-icons'],
|
serverBundle: IconsCollection,
|
||||||
},
|
},
|
||||||
|
|
||||||
// Nuxt Color Mode
|
// Nuxt Color Mode
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
|
import { IconsCollection } from '~~/types/types'
|
||||||
|
|
||||||
export default defineEventHandler(async (event) => {
|
export default defineEventHandler(async (event) => {
|
||||||
const collections = ['ph', 'heroicons']
|
|
||||||
const { query } = getQuery(event)
|
const { query } = getQuery(event)
|
||||||
|
|
||||||
const response = await $fetch('https://api.iconify.design/search', {
|
const response = await $fetch('https://api.iconify.design/search', {
|
||||||
params: {
|
params: {
|
||||||
query,
|
query,
|
||||||
prefixes: collections.join(','),
|
prefixes: IconsCollection.join(','),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,13 @@ export const COLORS = ['gray', 'slate', 'zinc', 'neutral', 'stone', 'red', 'oran
|
|||||||
|
|
||||||
export const Subscription = ['free', 'paid'] as const
|
export const Subscription = ['free', 'paid'] as const
|
||||||
|
|
||||||
|
export const IconsCollection = [
|
||||||
|
'ph',
|
||||||
|
'heroicons',
|
||||||
|
'vscode-icons',
|
||||||
|
'simple-icons',
|
||||||
|
] as const
|
||||||
|
|
||||||
// Category
|
// Category
|
||||||
export const CreateCategorySchema = z.object({
|
export const CreateCategorySchema = z.object({
|
||||||
name: z.string().min(4).max(20),
|
name: z.string().min(4).max(20),
|
||||||
|
|||||||
Reference in New Issue
Block a user