diff --git a/apps/player/src/components/CashBalanceChip.vue b/apps/player/src/components/CashBalanceChip.vue index b048b63..4951456 100644 --- a/apps/player/src/components/CashBalanceChip.vue +++ b/apps/player/src/components/CashBalanceChip.vue @@ -2,17 +2,26 @@ import { ref, onMounted, onUnmounted, computed } from 'vue'; import { useRouter } from 'vue-router'; import { useI18n } from 'vue-i18n'; +import { playerAvatarUrl, randomAvatarKey } from '@thebet365/shared'; +import { useAuthStore } from '../stores/auth'; import { formatMoney } from '../utils/localeDisplay'; import { usePlayerProfile } from '../composables/usePlayerProfile'; const { locale, t } = useI18n(); -const { profileRaw, refreshProfile } = usePlayerProfile(); +const { profileRaw, refreshProfile, avatarUrl } = usePlayerProfile(); +const auth = useAuthStore(); const router = useRouter(); const open = ref(false); const root = ref(null); const wallet = computed(() => profileRaw.value?.wallet ?? null); +const displayAvatarUrl = computed(() => { + if (avatarUrl.value) return avatarUrl.value; + const seed = auth.user?.username; + return seed ? playerAvatarUrl(randomAvatarKey(seed)) : null; +}); + function amountValue(value: unknown): number { if (value == null) return 0; if (typeof value === 'number') return Number.isFinite(value) ? value : 0; @@ -74,7 +83,11 @@ onUnmounted(() => { {{ t('wallet.cash_balance') }} {{ available }} - + + + + +
@@ -110,9 +123,9 @@ onUnmounted(() => { .cash-chip { display: flex; align-items: center; - gap: 4px; + gap: 10px; height: 36px; - padding: 0 10px; + padding: 0 6px 0 10px; min-width: 0; cursor: pointer; border: 1px solid var(--border); @@ -149,15 +162,25 @@ onUnmounted(() => { font-variant-numeric: tabular-nums; } -.chevron { - font-size: 10px; - color: var(--text-muted); - transition: transform 0.2s; - margin-left: 0; +/* Integrated Avatar Styling */ +.chip-avatar-wrap { + width: 24px; + height: 24px; + border-radius: 50%; + overflow: hidden; + display: flex; + align-items: center; + justify-content: center; + border: 1px solid var(--border-gold-soft); + flex-shrink: 0; + background: var(--bg-body); } -.chevron.open { - transform: rotate(180deg); +.chip-avatar-img { + width: 100%; + height: 100%; + object-fit: cover; + object-position: top; } .cash-panel { diff --git a/apps/player/src/components/MessageListPanel.vue b/apps/player/src/components/MessageListPanel.vue index 657ca6c..6ecf269 100644 --- a/apps/player/src/components/MessageListPanel.vue +++ b/apps/player/src/components/MessageListPanel.vue @@ -122,7 +122,6 @@ onActivated(tryLoad); :class="{ unread: !item.isRead }" >