Port modular price, product, and PWA fixes into boursecu
Sync live quote handling, SSE product images, store hours, file URL normalization, PWA icon cache, TV monitor, about software, SuperAdmin menu gates, price alerts, and related UX from modular while preserving boursecu branding and config constraints. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -2,11 +2,22 @@
|
||||
<div
|
||||
class="dhome-surface dhome-hero-price"
|
||||
:class="{
|
||||
'dhome-hero-price--boursecu-open': displayState === 'open',
|
||||
'dhome-hero-price--boursecu-closed': displayState !== 'open',
|
||||
'dhome-hero-price--boursecu-open': displayState === 'open' || quotePending,
|
||||
'dhome-hero-price--boursecu-closed': displayState !== 'open' && !quotePending,
|
||||
}"
|
||||
>
|
||||
<template v-if="displayState !== 'open'">
|
||||
<div
|
||||
v-if="quotePending"
|
||||
class="flex flex-col items-center gap-2 py-4"
|
||||
aria-busy="true"
|
||||
aria-label="در حال بارگذاری قیمت"
|
||||
>
|
||||
<div class="h-3 w-24 rounded boursecu-price-skeleton animate-pulse" />
|
||||
<div class="h-4 w-32 rounded boursecu-price-skeleton animate-pulse" />
|
||||
<div class="h-8 w-40 rounded boursecu-price-skeleton animate-pulse" />
|
||||
</div>
|
||||
|
||||
<template v-else-if="displayState !== 'open'">
|
||||
<div class="dhome-hero-price__closed">
|
||||
<div class="dhome-hero-price__closed-icon">
|
||||
<BasicIcon
|
||||
@@ -56,12 +67,14 @@ import {
|
||||
STORE_CLOSED_TITLE,
|
||||
getPriceDisplayState,
|
||||
getStoreClosedHint,
|
||||
isHomeQuotePending,
|
||||
} from '@/utils/storeHours'
|
||||
import { formatSignedPercentChange, usePriceWithoutType } from '@/utils/usePrice'
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
const displayState = computed(() => getPriceDisplayState())
|
||||
const quotePending = computed(() => isHomeQuotePending())
|
||||
|
||||
const statusTitle = computed(() =>
|
||||
displayState.value === 'closed' ? STORE_CLOSED_TITLE : NO_QUOTE_MESSAGE
|
||||
@@ -110,6 +123,10 @@ const percentChange = computed(() => {
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
}
|
||||
|
||||
.boursecu-price-skeleton {
|
||||
background: rgba(255, 255, 255, 0.25);
|
||||
}
|
||||
|
||||
.dhome-hero-price__closed {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -36,7 +36,13 @@ const resolvedActions = computed(() => {
|
||||
})
|
||||
|
||||
function handleClick(action: HomeQuickActionItem) {
|
||||
router.push(action.route)
|
||||
if (action.handler) {
|
||||
action.handler()
|
||||
return
|
||||
}
|
||||
if (action.route) {
|
||||
router.push(action.route)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -38,7 +38,13 @@ const resolvedActions = computed(() => {
|
||||
})
|
||||
|
||||
function navigate(action: HomeQuickActionItem) {
|
||||
router.push(action.route)
|
||||
if (action.handler) {
|
||||
action.handler()
|
||||
return
|
||||
}
|
||||
if (action.route) {
|
||||
router.push(action.route)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user