feat: replace all emoji/unicode icons with thin-stroke SVG icons
Adds AppIcon.vue component with Lucide-style 24x24 viewBox icons (inbox, sent, drafts, trash, spam, archive, folder, chevron, settings, plus, flag, attachment, envelope, refresh). All components updated to use AppIcon instead of HTML entities and emoji glyphs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
ccdec7f9c1
commit
d3966ba788
9 changed files with 172 additions and 49 deletions
110
src/renderer/src/components/AppIcon.vue
Normal file
110
src/renderer/src/components/AppIcon.vue
Normal file
|
|
@ -0,0 +1,110 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
export type IconName =
|
||||||
|
| 'inbox'
|
||||||
|
| 'sent'
|
||||||
|
| 'drafts'
|
||||||
|
| 'trash'
|
||||||
|
| 'spam'
|
||||||
|
| 'archive'
|
||||||
|
| 'folder'
|
||||||
|
| 'chevron-right'
|
||||||
|
| 'settings'
|
||||||
|
| 'plus'
|
||||||
|
| 'flag'
|
||||||
|
| 'attachment'
|
||||||
|
| 'envelope'
|
||||||
|
| 'refresh'
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
name: IconName
|
||||||
|
size?: number
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const size = props.size ?? 16
|
||||||
|
|
||||||
|
// All paths use 24×24 viewBox, stroke="currentColor",
|
||||||
|
// stroke-width="2", stroke-linecap="round", stroke-linejoin="round", fill="none"
|
||||||
|
const paths: Record<IconName, string> = {
|
||||||
|
inbox: `
|
||||||
|
<polyline points="22 13 16 13 14 16 10 16 8 13 2 13"/>
|
||||||
|
<path d="M5.45 5.11 2 13v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-7.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"/>
|
||||||
|
`,
|
||||||
|
sent: `
|
||||||
|
<line x1="22" y1="2" x2="11" y2="13"/>
|
||||||
|
<polygon points="22 2 15 22 11 13 2 9 22 2"/>
|
||||||
|
`,
|
||||||
|
drafts: `
|
||||||
|
<path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/>
|
||||||
|
<path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/>
|
||||||
|
`,
|
||||||
|
trash: `
|
||||||
|
<polyline points="3 6 5 6 21 6"/>
|
||||||
|
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/>
|
||||||
|
<line x1="10" y1="11" x2="10" y2="17"/>
|
||||||
|
<line x1="14" y1="11" x2="14" y2="17"/>
|
||||||
|
`,
|
||||||
|
spam: `
|
||||||
|
<path d="M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/>
|
||||||
|
<line x1="12" y1="9" x2="12" y2="13"/>
|
||||||
|
<line x1="12" y1="17" x2="12.01" y2="17"/>
|
||||||
|
`,
|
||||||
|
archive: `
|
||||||
|
<polyline points="21 8 21 21 3 21 3 8"/>
|
||||||
|
<rect x="1" y="3" width="22" height="5"/>
|
||||||
|
<line x1="10" y1="12" x2="14" y2="12"/>
|
||||||
|
`,
|
||||||
|
folder: `
|
||||||
|
<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/>
|
||||||
|
`,
|
||||||
|
'chevron-right': `
|
||||||
|
<polyline points="9 18 15 12 9 6"/>
|
||||||
|
`,
|
||||||
|
settings: `
|
||||||
|
<path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/>
|
||||||
|
<circle cx="12" cy="12" r="3"/>
|
||||||
|
`,
|
||||||
|
plus: `
|
||||||
|
<line x1="12" y1="5" x2="12" y2="19"/>
|
||||||
|
<line x1="5" y1="12" x2="19" y2="12"/>
|
||||||
|
`,
|
||||||
|
flag: `
|
||||||
|
<path d="M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z"/>
|
||||||
|
<line x1="4" y1="22" x2="4" y2="15"/>
|
||||||
|
`,
|
||||||
|
attachment: `
|
||||||
|
<path d="m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"/>
|
||||||
|
`,
|
||||||
|
envelope: `
|
||||||
|
<path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/>
|
||||||
|
<polyline points="22,6 12,13 2,6"/>
|
||||||
|
`,
|
||||||
|
refresh: `
|
||||||
|
<polyline points="23 4 23 10 17 10"/>
|
||||||
|
<path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/>
|
||||||
|
`,
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<svg
|
||||||
|
:width="size"
|
||||||
|
:height="size"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="1.75"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
class="app-icon"
|
||||||
|
aria-hidden="true"
|
||||||
|
v-html="paths[name]"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.app-icon {
|
||||||
|
display: inline-block;
|
||||||
|
flex-shrink: 0;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -6,6 +6,7 @@ import FolderTree from '../sidebar/FolderTree.vue'
|
||||||
import MessageList from '../messages/MessageList.vue'
|
import MessageList from '../messages/MessageList.vue'
|
||||||
import MessagePreview from '../preview/MessagePreview.vue'
|
import MessagePreview from '../preview/MessagePreview.vue'
|
||||||
import AddAccountDialog from '../accounts/AddAccountDialog.vue'
|
import AddAccountDialog from '../accounts/AddAccountDialog.vue'
|
||||||
|
import AppIcon from '../AppIcon.vue'
|
||||||
import { useAccountsStore } from '../../stores/accounts.store'
|
import { useAccountsStore } from '../../stores/accounts.store'
|
||||||
|
|
||||||
const accountsStore = useAccountsStore()
|
const accountsStore = useAccountsStore()
|
||||||
|
|
@ -84,7 +85,9 @@ function stopResize(): void {
|
||||||
<!-- Пустое состояние: нет аккаунтов -->
|
<!-- Пустое состояние: нет аккаунтов -->
|
||||||
<div v-if="accountsStore.accounts.length === 0 && !accountsStore.loading && !showAddAccount" class="empty-state">
|
<div v-if="accountsStore.accounts.length === 0 && !accountsStore.loading && !showAddAccount" class="empty-state">
|
||||||
<div class="empty-content">
|
<div class="empty-content">
|
||||||
<div class="empty-icon">✉</div>
|
<div class="empty-icon">
|
||||||
|
<AppIcon name="envelope" :size="52" />
|
||||||
|
</div>
|
||||||
<h2>Добро пожаловать в Vue Mail</h2>
|
<h2>Добро пожаловать в Vue Mail</h2>
|
||||||
<p>Добавьте почтовый аккаунт для начала работы</p>
|
<p>Добавьте почтовый аккаунт для начала работы</p>
|
||||||
<button class="add-btn" @click="onAddAccount">
|
<button class="add-btn" @click="onAddAccount">
|
||||||
|
|
@ -208,10 +211,9 @@ function stopResize(): void {
|
||||||
}
|
}
|
||||||
|
|
||||||
.empty-icon {
|
.empty-icon {
|
||||||
font-size: 52px;
|
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
opacity: 0.25;
|
opacity: 0.22;
|
||||||
filter: grayscale(1);
|
color: var(--text-muted);
|
||||||
}
|
}
|
||||||
|
|
||||||
.empty-content h2 {
|
.empty-content h2 {
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import { useFoldersStore } from '../../stores/folders.store'
|
||||||
import { useAccountsStore } from '../../stores/accounts.store'
|
import { useAccountsStore } from '../../stores/accounts.store'
|
||||||
import { useSettingsStore, type SwipeAction } from '../../stores/settings.store'
|
import { useSettingsStore, type SwipeAction } from '../../stores/settings.store'
|
||||||
import MessageListItem from './MessageListItem.vue'
|
import MessageListItem from './MessageListItem.vue'
|
||||||
|
import AppIcon from '../AppIcon.vue'
|
||||||
|
|
||||||
const messagesStore = useMessagesStore()
|
const messagesStore = useMessagesStore()
|
||||||
const foldersStore = useFoldersStore()
|
const foldersStore = useFoldersStore()
|
||||||
|
|
@ -91,7 +92,7 @@ async function handleSwipeAction(action: SwipeAction, messageId: string): Promis
|
||||||
title="Обновить"
|
title="Обновить"
|
||||||
@click="refresh"
|
@click="refresh"
|
||||||
>
|
>
|
||||||
↻
|
<AppIcon name="refresh" :size="14" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -100,13 +101,13 @@ async function handleSwipeAction(action: SwipeAction, messageId: string): Promis
|
||||||
<div v-if="selectMode && hasSelected" class="bulk-actions">
|
<div v-if="selectMode && hasSelected" class="bulk-actions">
|
||||||
<span class="bulk-count">Выбрано: {{ messagesStore.selectedIds.size }}</span>
|
<span class="bulk-count">Выбрано: {{ messagesStore.selectedIds.size }}</span>
|
||||||
<button class="bulk-btn" @click="messagesStore.markSelectedAsRead()">
|
<button class="bulk-btn" @click="messagesStore.markSelectedAsRead()">
|
||||||
✓ Прочитать
|
<AppIcon name="envelope" :size="11" /> Прочитать
|
||||||
</button>
|
</button>
|
||||||
<button class="bulk-btn" @click="messagesStore.flagSelected()">
|
<button class="bulk-btn" @click="messagesStore.flagSelected()">
|
||||||
⚑ Флажок
|
<AppIcon name="flag" :size="11" /> Флажок
|
||||||
</button>
|
</button>
|
||||||
<button class="bulk-btn danger" @click="messagesStore.deleteSelected()">
|
<button class="bulk-btn danger" @click="messagesStore.deleteSelected()">
|
||||||
🗑 Удалить
|
<AppIcon name="trash" :size="11" /> Удалить
|
||||||
</button>
|
</button>
|
||||||
<button class="bulk-btn" @click="exitSelectMode">Отмена</button>
|
<button class="bulk-btn" @click="exitSelectMode">Отмена</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import { ref, computed, onMounted, onUnmounted } from 'vue'
|
||||||
import type { MessageEnvelope } from '@shared/types/message'
|
import type { MessageEnvelope } from '@shared/types/message'
|
||||||
import { formatMessageDate } from '../../utils/date'
|
import { formatMessageDate } from '../../utils/date'
|
||||||
import { SWIPE_ACTION_INFO, type SwipeAction } from '../../stores/settings.store'
|
import { SWIPE_ACTION_INFO, type SwipeAction } from '../../stores/settings.store'
|
||||||
|
import AppIcon from '../AppIcon.vue'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
message: MessageEnvelope
|
message: MessageEnvelope
|
||||||
|
|
@ -237,7 +238,9 @@ onUnmounted(() => {
|
||||||
class="action-bg action-left"
|
class="action-bg action-left"
|
||||||
:style="{ background: leftColor, opacity: progress }"
|
:style="{ background: leftColor, opacity: progress }"
|
||||||
>
|
>
|
||||||
<span class="action-icon" :class="{ confirmed }">{{ leftIcon }}</span>
|
<span class="action-icon" :class="{ confirmed }">
|
||||||
|
<AppIcon v-if="leftIcon" :name="(leftIcon as any)" :size="18" />
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Reveal: right side (swipe-left action) -->
|
<!-- Reveal: right side (swipe-left action) -->
|
||||||
|
|
@ -246,7 +249,9 @@ onUnmounted(() => {
|
||||||
class="action-bg action-right"
|
class="action-bg action-right"
|
||||||
:style="{ background: rightColor, opacity: progress }"
|
:style="{ background: rightColor, opacity: progress }"
|
||||||
>
|
>
|
||||||
<span class="action-icon" :class="{ confirmed }">{{ rightIcon }}</span>
|
<span class="action-icon" :class="{ confirmed }">
|
||||||
|
<AppIcon v-if="rightIcon" :name="(rightIcon as any)" :size="18" />
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Message row — pointer handlers here, NO @click handler -->
|
<!-- Message row — pointer handlers here, NO @click handler -->
|
||||||
|
|
@ -292,8 +297,8 @@ onUnmounted(() => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="message-indicators">
|
<div class="message-indicators">
|
||||||
<span v-if="isFlagged" class="flag-icon">⚑</span>
|
<AppIcon v-if="isFlagged" name="flag" :size="12" class="flag-icon" />
|
||||||
<span v-if="message.hasAttachments" class="attachment-icon">📎</span>
|
<AppIcon v-if="message.hasAttachments" name="attachment" :size="12" class="attachment-icon" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -317,7 +322,13 @@ onUnmounted(() => {
|
||||||
.action-left { justify-content: flex-start; padding-left: 18px; }
|
.action-left { justify-content: flex-start; padding-left: 18px; }
|
||||||
.action-right { justify-content: flex-end; padding-right: 18px; }
|
.action-right { justify-content: flex-end; padding-right: 18px; }
|
||||||
|
|
||||||
.action-icon { font-size: 17px; transition: transform 0.15s ease; }
|
.action-icon {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
color: #fff;
|
||||||
|
transition: transform 0.15s ease;
|
||||||
|
}
|
||||||
.action-icon.confirmed { transform: scale(1.3); }
|
.action-icon.confirmed { transform: scale(1.3); }
|
||||||
|
|
||||||
.message-item {
|
.message-item {
|
||||||
|
|
@ -413,6 +424,6 @@ onUnmounted(() => {
|
||||||
align-items: center; gap: 4px;
|
align-items: center; gap: 4px;
|
||||||
flex-shrink: 0; padding-top: 2px;
|
flex-shrink: 0; padding-top: 2px;
|
||||||
}
|
}
|
||||||
.flag-icon { font-size: 12px; color: var(--warning); }
|
.flag-icon { color: var(--warning); }
|
||||||
.attachment-icon { font-size: 12px; color: var(--text-muted); }
|
.attachment-icon { color: var(--text-muted); }
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
import type { MessageEnvelope } from '@shared/types/message'
|
import type { MessageEnvelope } from '@shared/types/message'
|
||||||
import { formatFullDate } from '../../utils/date'
|
import { formatFullDate } from '../../utils/date'
|
||||||
|
import AppIcon from '../AppIcon.vue'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
message: MessageEnvelope
|
message: MessageEnvelope
|
||||||
|
|
@ -46,10 +47,10 @@ const dateDisplay = computed(() => formatFullDate(props.message.date))
|
||||||
</div>
|
</div>
|
||||||
<div class="header-badges">
|
<div class="header-badges">
|
||||||
<span v-if="message.hasAttachments" class="badge">
|
<span v-if="message.hasAttachments" class="badge">
|
||||||
📎 Вложения
|
<AppIcon name="attachment" :size="11" /> Вложения
|
||||||
</span>
|
</span>
|
||||||
<span v-if="message.flags.flagged" class="badge flagged">
|
<span v-if="message.flags.flagged" class="badge flagged">
|
||||||
⚑ Отмечено
|
<AppIcon name="flag" :size="11" /> Отмечено
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import { computed } from 'vue'
|
||||||
import { useMessagesStore } from '../../stores/messages.store'
|
import { useMessagesStore } from '../../stores/messages.store'
|
||||||
import MessageHeader from './MessageHeader.vue'
|
import MessageHeader from './MessageHeader.vue'
|
||||||
import MessageBody from './MessageBody.vue'
|
import MessageBody from './MessageBody.vue'
|
||||||
|
import AppIcon from '../AppIcon.vue'
|
||||||
|
|
||||||
const messagesStore = useMessagesStore()
|
const messagesStore = useMessagesStore()
|
||||||
|
|
||||||
|
|
@ -14,7 +15,9 @@ const selectedMessage = computed(() =>
|
||||||
<template>
|
<template>
|
||||||
<div class="message-preview">
|
<div class="message-preview">
|
||||||
<div v-if="!selectedMessage" class="no-selection">
|
<div v-if="!selectedMessage" class="no-selection">
|
||||||
<div class="no-selection-icon">✉</div>
|
<div class="no-selection-icon">
|
||||||
|
<AppIcon name="envelope" :size="48" />
|
||||||
|
</div>
|
||||||
<span>Выберите письмо для чтения</span>
|
<span>Выберите письмо для чтения</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -52,9 +55,8 @@ const selectedMessage = computed(() =>
|
||||||
}
|
}
|
||||||
|
|
||||||
.no-selection-icon {
|
.no-selection-icon {
|
||||||
font-size: 48px;
|
|
||||||
opacity: 0.18;
|
opacity: 0.18;
|
||||||
filter: grayscale(1);
|
color: var(--text-muted);
|
||||||
}
|
}
|
||||||
|
|
||||||
.loading-body {
|
.loading-body {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useAccountsStore } from '../../stores/accounts.store'
|
import { useAccountsStore } from '../../stores/accounts.store'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
|
import AppIcon from '../AppIcon.vue'
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
addAccount: []
|
addAccount: []
|
||||||
|
|
@ -40,11 +41,11 @@ function getAccountColor(index: number): string {
|
||||||
<div class="spacer" />
|
<div class="spacer" />
|
||||||
|
|
||||||
<button class="account-btn add-btn" title="Добавить аккаунт" @click="emit('addAccount')">
|
<button class="account-btn add-btn" title="Добавить аккаунт" @click="emit('addAccount')">
|
||||||
<span class="add-icon">+</span>
|
<AppIcon name="plus" :size="16" class="add-icon" />
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button class="account-btn settings-btn" title="Настройки" @click="router.push('/settings')">
|
<button class="account-btn settings-btn" title="Настройки" @click="router.push('/settings')">
|
||||||
<span class="settings-icon">⚙</span>
|
<AppIcon name="settings" :size="15" class="settings-icon" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -104,16 +105,10 @@ function getAccountColor(index: number): string {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.add-icon {
|
.add-icon,
|
||||||
font-size: 20px;
|
|
||||||
color: var(--text-muted);
|
|
||||||
font-weight: 300;
|
|
||||||
line-height: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.settings-icon {
|
.settings-icon {
|
||||||
font-size: 15px;
|
|
||||||
color: var(--text-muted);
|
color: var(--text-muted);
|
||||||
|
transition: color var(--transition-fast);
|
||||||
}
|
}
|
||||||
|
|
||||||
.add-btn:hover .add-icon,
|
.add-btn:hover .add-icon,
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ import { ref, computed } from 'vue'
|
||||||
import type { Folder } from '@shared/types/folder'
|
import type { Folder } from '@shared/types/folder'
|
||||||
import { SpecialFolderRole } from '@shared/types/folder'
|
import { SpecialFolderRole } from '@shared/types/folder'
|
||||||
import { useFoldersStore } from '../../stores/folders.store'
|
import { useFoldersStore } from '../../stores/folders.store'
|
||||||
|
import AppIcon from '../AppIcon.vue'
|
||||||
|
import type { IconName } from '../AppIcon.vue'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
folder: Folder
|
folder: Folder
|
||||||
|
|
@ -15,15 +17,15 @@ const expanded = ref(true)
|
||||||
const isActive = computed(() => foldersStore.activeFolderId === props.folder.id)
|
const isActive = computed(() => foldersStore.activeFolderId === props.folder.id)
|
||||||
const hasChildren = computed(() => props.folder.children.length > 0)
|
const hasChildren = computed(() => props.folder.children.length > 0)
|
||||||
|
|
||||||
const folderIcon = computed(() => {
|
const folderIcon = computed((): IconName => {
|
||||||
switch (props.folder.role) {
|
switch (props.folder.role) {
|
||||||
case SpecialFolderRole.Inbox: return '📥'
|
case SpecialFolderRole.Inbox: return 'inbox'
|
||||||
case SpecialFolderRole.Sent: return '📤'
|
case SpecialFolderRole.Sent: return 'sent'
|
||||||
case SpecialFolderRole.Drafts: return '📝'
|
case SpecialFolderRole.Drafts: return 'drafts'
|
||||||
case SpecialFolderRole.Trash: return '🗑'
|
case SpecialFolderRole.Trash: return 'trash'
|
||||||
case SpecialFolderRole.Spam: return '⚠'
|
case SpecialFolderRole.Spam: return 'spam'
|
||||||
case SpecialFolderRole.Archive: return '🗃'
|
case SpecialFolderRole.Archive: return 'archive'
|
||||||
default: return '📁'
|
default: return 'folder'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -48,13 +50,14 @@ function toggleExpand(event: Event): void {
|
||||||
<button
|
<button
|
||||||
v-if="hasChildren"
|
v-if="hasChildren"
|
||||||
class="expand-btn"
|
class="expand-btn"
|
||||||
|
:class="{ rotated: expanded }"
|
||||||
@click="toggleExpand"
|
@click="toggleExpand"
|
||||||
>
|
>
|
||||||
<span :class="{ rotated: expanded }">▸</span>
|
<AppIcon name="chevron-right" :size="12" />
|
||||||
</button>
|
</button>
|
||||||
<span v-else class="expand-spacer" />
|
<span v-else class="expand-spacer" />
|
||||||
|
|
||||||
<span class="folder-icon" v-html="folderIcon" />
|
<AppIcon :name="folderIcon" :size="14" class="folder-icon" />
|
||||||
<span class="folder-name truncate">{{ folder.name }}</span>
|
<span class="folder-name truncate">{{ folder.name }}</span>
|
||||||
<span v-if="folder.unreadCount > 0" class="unread-badge">
|
<span v-if="folder.unreadCount > 0" class="unread-badge">
|
||||||
{{ folder.unreadCount }}
|
{{ folder.unreadCount }}
|
||||||
|
|
@ -120,14 +123,12 @@ function toggleExpand(event: Event): void {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
font-size: 10px;
|
|
||||||
color: var(--text-muted);
|
color: var(--text-muted);
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
transition: transform var(--transition-fast);
|
transition: transform var(--transition-fast);
|
||||||
}
|
}
|
||||||
|
|
||||||
.expand-btn span.rotated {
|
.expand-btn.rotated {
|
||||||
display: inline-block;
|
|
||||||
transform: rotate(90deg);
|
transform: rotate(90deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -137,10 +138,10 @@ function toggleExpand(event: Event): void {
|
||||||
}
|
}
|
||||||
|
|
||||||
.folder-icon {
|
.folder-icon {
|
||||||
font-size: 14px;
|
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
width: 18px;
|
width: 18px;
|
||||||
text-align: center;
|
color: var(--text-muted);
|
||||||
|
opacity: 0.75;
|
||||||
}
|
}
|
||||||
|
|
||||||
.folder-name {
|
.folder-name {
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,9 @@ export const SWIPE_ACTION_LABELS: Record<SwipeAction, string> = {
|
||||||
}
|
}
|
||||||
|
|
||||||
export const SWIPE_ACTION_INFO: Record<SwipeAction, { icon: string; color: string }> = {
|
export const SWIPE_ACTION_INFO: Record<SwipeAction, { icon: string; color: string }> = {
|
||||||
delete: { icon: '🗑', color: 'var(--danger)' },
|
delete: { icon: 'trash', color: 'var(--danger)' },
|
||||||
toggleRead: { icon: '✉', color: 'var(--accent)' },
|
toggleRead: { icon: 'envelope', color: 'var(--accent)' },
|
||||||
toggleFlag: { icon: '⚑', color: 'var(--warning)' },
|
toggleFlag: { icon: 'flag', color: 'var(--warning)' },
|
||||||
none: { icon: '', color: 'transparent' }
|
none: { icon: '', color: 'transparent' }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue