mirror of
https://git.meshkee.com/Meshkee/dashboards.git
synced 2026-08-11 22:30:58 +04:30
Add store-item bulk create, unlimited stock, and contact-for-price UI.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
5eaf7fb046
commit
ad83fc1099
@@ -8,6 +8,17 @@
|
||||
border-radius: 50px;
|
||||
}
|
||||
|
||||
.contactPrice {
|
||||
display: inline-block;
|
||||
padding: 3px 10px;
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
font-family: var(--font-ui);
|
||||
color: var(--text-muted);
|
||||
background: rgba(148, 163, 184, 0.14);
|
||||
border-radius: 50px;
|
||||
}
|
||||
|
||||
.discountWrap {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { useT } from '../i18n/useT'
|
||||
import {
|
||||
calcDiscountPercent,
|
||||
formatIrtPrice,
|
||||
@@ -11,8 +12,14 @@ interface StoreItemPriceProps {
|
||||
}
|
||||
|
||||
export function StoreItemPrice({ price, discountedPrice = null }: StoreItemPriceProps) {
|
||||
const t = useT()
|
||||
|
||||
if (price === null || price === undefined) {
|
||||
return <span className={styles.contactPrice}>{t('storeItems.price.contact')}</span>
|
||||
}
|
||||
|
||||
if (hasStoreItemDiscount(price, discountedPrice)) {
|
||||
const percent = calcDiscountPercent(price!, discountedPrice!)
|
||||
const percent = calcDiscountPercent(price, discountedPrice!)
|
||||
return (
|
||||
<div className={styles.discountWrap}>
|
||||
<span className={styles.originalPrice}>{formatIrtPrice(price)}</span>
|
||||
|
||||
@@ -154,6 +154,7 @@ const en = {
|
||||
'favorites.inStock': '{count} in stock',
|
||||
'favorites.variantOne': '1 variant',
|
||||
'favorites.variantMany': '{count} variants',
|
||||
'storeItems.price.contact': 'Contact for price',
|
||||
|
||||
'title.signIn': 'Sign in',
|
||||
'title.checkout': 'Checkout',
|
||||
@@ -384,6 +385,7 @@ const fa: Record<MessageKey, string> = {
|
||||
'favorites.inStock': '{count} موجود',
|
||||
'favorites.variantOne': '۱ تنوع',
|
||||
'favorites.variantMany': '{count} تنوع',
|
||||
'storeItems.price.contact': 'برای قیمت، تماس بگیرید',
|
||||
|
||||
'title.signIn': 'ورود',
|
||||
'title.checkout': 'تسویهحساب',
|
||||
|
||||
Reference in New Issue
Block a user