22import { addCollection , getIcon , Icon , listIcons } from ' @iconify/vue'
33import { createReusableTemplate , useLocalStorage } from ' @vueuse/core'
44import { buildIcon } from ' iconify-icon'
5- import { computed , onMounted , ref , watchEffect } from ' vue'
5+ import nimiqIcons from ' nimiq-icons/icons.json'
6+ import { computed , ref , watchEffect } from ' vue'
67import CodeBlock from ' ./CodeBlock.vue'
78import ShikiBlock from ' ./ShikiBlock.vue'
89
@@ -26,20 +27,17 @@ const timeBuild = ref('')
2627
2728const initialIcon = new URLSearchParams (globalThis .location ?.search ).get (' icon' ) || ' '
2829
29- onMounted (async () => {
30- const json = await fetch (' https://raw.githubusercontent.com/onmax/nimiq-ui/main/packages/nimiq-icons/dist/icons.json' ).then (res => res .json ())
31- addCollection (json )
32- // addCollection({ ...json, icons: Object.entries(json.icons).filter(([key]) => key.startsWith('logos-nimiq-full-white-vertical')).reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {}) })
30+ addCollection (nimiqIcons )
31+ // addCollection({ ...json, icons: Object.entries(json.icons).filter(([key]) => key.startsWith('logos-nimiq-full-white-vertical')).reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {}) })
3332
34- icons .value = listIcons ()
35- variants .value [Variant .Regular ] = listIcons ().filter (icon => icon .startsWith (' nimiq' ) && ! icon .startsWith (` nimiq:${Variant .Large }- ` ) && ! icon .startsWith (` nimiq:${Variant .Logos }- ` ) && ! icon .startsWith (` nimiq:${Variant .Flags }- ` ))
36- variants .value [Variant .Large ] = listIcons ().filter (icon => icon .startsWith (` nimiq:${Variant .Large }- ` ))
37- variants .value [Variant .Logos ] = listIcons ().filter (icon => icon .startsWith (` nimiq:${Variant .Logos }- ` ))
38- variants .value [Variant .Flags ] = listIcons ().filter (icon => icon .startsWith (` nimiq:${Variant .Flags }- ` ))
33+ icons .value = listIcons ()
34+ variants .value [Variant .Regular ] = listIcons ().filter (icon => icon .startsWith (' nimiq' ) && ! icon .startsWith (` nimiq:${Variant .Large }- ` ) && ! icon .startsWith (` nimiq:${Variant .Logos }- ` ) && ! icon .startsWith (` nimiq:${Variant .Flags }- ` ))
35+ variants .value [Variant .Large ] = listIcons ().filter (icon => icon .startsWith (` nimiq:${Variant .Large }- ` ))
36+ variants .value [Variant .Logos ] = listIcons ().filter (icon => icon .startsWith (` nimiq:${Variant .Logos }- ` ))
37+ variants .value [Variant .Flags ] = listIcons ().filter (icon => icon .startsWith (` nimiq:${Variant .Flags }- ` ))
3938
40- lastUpdated .value = new Date (json .lastModified * 1000 )
41- timeBuild .value = new Intl .DateTimeFormat (' en' , { dateStyle: ' short' , timeStyle: ' short' }).format (lastUpdated .value )
42- })
39+ lastUpdated .value = new Date (nimiqIcons .lastModified * 1000 )
40+ timeBuild .value = new Intl .DateTimeFormat (' en' , { dateStyle: ' short' , timeStyle: ' short' }).format (lastUpdated .value )
4341
4442const logosMono = computed (() => variants .value [Variant .Logos ].filter (icon => icon .endsWith (' -mono' )))
4543
0 commit comments