Skip to content

Commit

Permalink
refactor: remove icons as list params
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrikBird committed Jan 20, 2024
1 parent 79dea8a commit c0ee4a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
18 changes: 1 addition & 17 deletions components/content/CustomList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,6 @@ const props = defineProps<{
items: string[]
icon: string
}>()
const iconIsEmoji = computed(() => {
// https://unicode.org/Public/emoji/13.1/emoji-sequences.txt
const regex = /[\u{1F600}-\u{1F64F}|\u{1F300}-\u{1F5FF}|\u{1F680}-\u{1F6FF}|\u{1F1E0}-\u{1F1FF}|\u{2600}-\u{26FF}|\u{2700}-\u{27BF}]/gu
return regex.test(props.icon)
})
const iconWithPrefix = computed(() => {
if (props.icon.startsWith('i-'))
return props.icon
return `i-${props.icon}`
})
</script>

<template>
Expand All @@ -25,12 +12,9 @@ const iconWithPrefix = computed(() => {
class="flex items-center gap2"
>
<span
:class="iconWithPrefix"
class="flex items-center"
>
<template v-if="iconIsEmoji">
{{ props.icon }}
</template>
{{ props.icon }}
</span>
{{ item }}
</li>
Expand Down
6 changes: 3 additions & 3 deletions content/travel/6.still-alive.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ unseren Standard-Filtern nach Unterkünften:
::CustomList
---
items: ['<25 Euro/Nacht', 'Bewertung 8+', 'Doppelbett', 'Privates Bad']
icon: "i-fluent-emoji-high-contrast:sleeping-face"
icon: "😴"
---
::

Expand Down Expand Up @@ -126,7 +126,7 @@ nächstes gehen. Das Spiel beginnt von vorne:
::CustomList
---
items: ['<25 Euro/Nacht', 'Bewertung 8+', 'Doppelbett', 'Privates Bad']
icon: "i-fluent-emoji-high-contrast:sleeping-face"
icon: "😴"
---
::
...
Expand Down Expand Up @@ -238,7 +238,7 @@ Singapur hätte ich fast vergessen:
::CustomList
---
items: ['Stadt', 'heiß', 'teuer', 'künstlich', 'crazy Flughafen']
icon: "i-emojione-monotone:flag-for-singapore"
icon: "🇸🇬"
---
::

Expand Down

0 comments on commit c0ee4a2

Please sign in to comment.