Compare commits

..

1 Commits

Author SHA1 Message Date
Tim
4802c78156 refactor: switch notification icons to iconpark 2025-09-06 13:50:39 +08:00
3 changed files with 32 additions and 33 deletions

View File

@@ -24,7 +24,7 @@
</template>
<template #option="{ option }">
<div class="search-option-item">
<component :is="iconMap[option.type]" class="result-icon" />
<i :class="['result-icon', iconMap[option.type]]"></i>
<div class="result-body">
<div class="result-main" v-html="highlight(option.text)"></div>
<div v-if="option.subText" class="result-sub" v-html="highlight(option.subText)"></div>
@@ -83,12 +83,11 @@ const highlight = (text) => {
}
const iconMap = {
user: 'UserIcon',
post: 'FileText',
post_title: 'FileText',
comment: 'CommentIcon',
category: 'Inbox',
tag: 'TagOne',
user: 'fas fa-user',
post: 'fas fa-file-alt',
comment: 'fas fa-comment',
category: 'fas fa-folder',
tag: 'fas fa-hashtag',
}
watch(selected, (val) => {

View File

@@ -10,14 +10,14 @@
<template #option="{ option }">
<div class="option-container">
<div class="option-main">
<template v-if="option.smallIcon || option.icon">
<template v-if="option.icon">
<BaseImage
v-if="isImageIcon(option.smallIcon || option.icon)"
:src="option.smallIcon || option.icon"
v-if="isImageIcon(option.icon)"
:src="option.icon"
class="option-icon"
:alt="option.name"
/>
<component v-else :is="option.smallIcon || option.icon" class="option-icon" />
<i v-else :class="['option-icon', option.icon]"></i>
</template>
<span>{{ option.name }}</span>
<span class="option-count" v-if="option.count > 0"> x {{ option.count }}</span>

View File

@@ -9,28 +9,28 @@ export const notificationState = reactive({
})
const iconMap = {
POST_VIEWED: 'fas fa-eye',
COMMENT_REPLY: 'fas fa-reply',
POST_REVIEWED: 'fas fa-shield-alt',
POST_REVIEW_REQUEST: 'fas fa-gavel',
POST_UPDATED: 'fas fa-comment-dots',
USER_ACTIVITY: 'fas fa-user',
FOLLOWED_POST: 'fas fa-feather-alt',
USER_FOLLOWED: 'fas fa-user-plus',
USER_UNFOLLOWED: 'fas fa-user-minus',
POST_SUBSCRIBED: 'fas fa-bookmark',
POST_UNSUBSCRIBED: 'fas fa-bookmark',
REGISTER_REQUEST: 'fas fa-user-clock',
ACTIVITY_REDEEM: 'fas fa-coffee',
POINT_REDEEM: 'fas fa-gift',
LOTTERY_WIN: 'fas fa-trophy',
LOTTERY_DRAW: 'fas fa-bullhorn',
POLL_VOTE: 'fas fa-square-poll-vertical',
POLL_RESULT_OWNER: 'fas fa-flag-checkered',
POLL_RESULT_PARTICIPANT: 'fas fa-flag-checkered',
MENTION: 'fas fa-at',
POST_DELETED: 'fas fa-trash',
POST_FEATURED: 'fas fa-star',
POST_VIEWED: 'HistoryIcon',
COMMENT_REPLY: 'MessageOne',
POST_REVIEWED: 'CheckCorrect',
POST_REVIEW_REQUEST: 'FileText',
POST_UPDATED: 'Edit',
USER_ACTIVITY: 'UserIcon',
FOLLOWED_POST: 'Pin',
USER_FOLLOWED: 'AddUser',
USER_UNFOLLOWED: 'ReduceUser',
POST_SUBSCRIBED: 'Bookmark',
POST_UNSUBSCRIBED: 'Bookmark',
REGISTER_REQUEST: 'AlarmClock',
ACTIVITY_REDEEM: 'PaperMoneyTwo',
POINT_REDEEM: 'Gift',
LOTTERY_WIN: 'MedalOne',
LOTTERY_DRAW: 'Fireworks',
POLL_VOTE: 'ChartHistogram',
POLL_RESULT_OWNER: 'RankingList',
POLL_RESULT_PARTICIPANT: 'ChartLine',
MENTION: 'HashtagKey',
POST_DELETED: 'ClearIcon',
POST_FEATURED: 'Star',
}
export async function fetchUnreadCount() {