Compare commits

..

1 Commits

Author SHA1 Message Date
Tim 8c554465f6 refactor: replace font awesome with iconpark in search dropdown 2025-09-06 11:48:22 +08:00
4 changed files with 31 additions and 34 deletions
+1 -5
View File
@@ -7,11 +7,7 @@
@click="item.iconClick && item.iconClick()" @click="item.iconClick && item.iconClick()"
> >
<BaseImage v-if="item.src" :src="item.src" class="timeline-img" alt="timeline item" /> <BaseImage v-if="item.src" :src="item.src" class="timeline-img" alt="timeline item" />
<component <i v-else-if="item.icon" :class="item.icon"></i>
v-else-if="item.icon && (typeof item.icon !== 'string' || !item.icon.includes(' '))"
:is="item.icon"
:size="20"
/>
<BaseImage v-else-if="item.emoji" :src="item.emoji" class="timeline-emoji" alt="emoji" /> <BaseImage v-else-if="item.emoji" :src="item.emoji" class="timeline-emoji" alt="emoji" />
</div> </div>
<div class="timeline-content"> <div class="timeline-content">
+7 -6
View File
@@ -24,7 +24,7 @@
</template> </template>
<template #option="{ option }"> <template #option="{ option }">
<div class="search-option-item"> <div class="search-option-item">
<i :class="['result-icon', iconMap[option.type]]"></i> <component :is="iconMap[option.type]" class="result-icon" />
<div class="result-body"> <div class="result-body">
<div class="result-main" v-html="highlight(option.text)"></div> <div class="result-main" v-html="highlight(option.text)"></div>
<div v-if="option.subText" class="result-sub" v-html="highlight(option.subText)"></div> <div v-if="option.subText" class="result-sub" v-html="highlight(option.subText)"></div>
@@ -83,11 +83,12 @@ const highlight = (text) => {
} }
const iconMap = { const iconMap = {
user: 'fas fa-user', user: 'UserIcon',
post: 'fas fa-file-alt', post: 'FileText',
comment: 'fas fa-comment', post_title: 'FileText',
category: 'fas fa-folder', comment: 'CommentIcon',
tag: 'fas fa-hashtag', category: 'Inbox',
tag: 'TagOne',
} }
watch(selected, (val) => { watch(selected, (val) => {
+22 -22
View File
@@ -9,28 +9,28 @@ export const notificationState = reactive({
}) })
const iconMap = { const iconMap = {
POST_VIEWED: 'HistoryIcon', POST_VIEWED: 'fas fa-eye',
COMMENT_REPLY: 'MessageOne', COMMENT_REPLY: 'fas fa-reply',
POST_REVIEWED: 'CheckCorrect', POST_REVIEWED: 'fas fa-shield-alt',
POST_REVIEW_REQUEST: 'FileText', POST_REVIEW_REQUEST: 'fas fa-gavel',
POST_UPDATED: 'Edit', POST_UPDATED: 'fas fa-comment-dots',
USER_ACTIVITY: 'UserIcon', USER_ACTIVITY: 'fas fa-user',
FOLLOWED_POST: 'Pin', FOLLOWED_POST: 'fas fa-feather-alt',
USER_FOLLOWED: 'AddUser', USER_FOLLOWED: 'fas fa-user-plus',
USER_UNFOLLOWED: 'ReduceUser', USER_UNFOLLOWED: 'fas fa-user-minus',
POST_SUBSCRIBED: 'Bookmark', POST_SUBSCRIBED: 'fas fa-bookmark',
POST_UNSUBSCRIBED: 'Bookmark', POST_UNSUBSCRIBED: 'fas fa-bookmark',
REGISTER_REQUEST: 'AlarmClock', REGISTER_REQUEST: 'fas fa-user-clock',
ACTIVITY_REDEEM: 'PaperMoneyTwo', ACTIVITY_REDEEM: 'fas fa-coffee',
POINT_REDEEM: 'Gift', POINT_REDEEM: 'fas fa-gift',
LOTTERY_WIN: 'MedalOne', LOTTERY_WIN: 'fas fa-trophy',
LOTTERY_DRAW: 'Fireworks', LOTTERY_DRAW: 'fas fa-bullhorn',
POLL_VOTE: 'ChartHistogram', POLL_VOTE: 'fas fa-square-poll-vertical',
POLL_RESULT_OWNER: 'RankingList', POLL_RESULT_OWNER: 'fas fa-flag-checkered',
POLL_RESULT_PARTICIPANT: 'ChartLine', POLL_RESULT_PARTICIPANT: 'fas fa-flag-checkered',
MENTION: 'HashtagKey', MENTION: 'fas fa-at',
POST_DELETED: 'ClearIcon', POST_DELETED: 'fas fa-trash',
POST_FEATURED: 'Star', POST_FEATURED: 'fas fa-star',
} }
export async function fetchUnreadCount() { export async function fetchUnreadCount() {
+1 -1
View File
@@ -23,7 +23,7 @@ export default (apiBaseUrl, websiteBaseUrl) => {
return ( return (
body.map((item) => ({ body.map((item) => ({
value: `[🔗${item.title}](${websiteBaseUrl}/posts/${item.id})`, value: `[🔗${item.title}](${websiteBaseUrl}/posts/${item.id})`,
html: `<div><link-icon /> ${item.title}</div>`, html: `<div><i class="fas fa-link"></i> ${item.title}</div>`,
})) ?? [] })) ?? []
) )
} else { } else {