fix(dashboard): truncate price cell titles (#9715)
Before:  After  Co-authored-by: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com>
This commit is contained in:
1 parent
ab90900d40
commit
61cb97da26
3 files changed
+17
-8
No files matched your search
@@ -20,7 +20,9 @@ export const IncludesTaxTooltip = ({
|
|||||||
: t("general.excludesTaxTooltip")
|
: t("general.excludesTaxTooltip")
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<BuildingTax className={clx({ "text-ui-fg-muted": !includesTax })} />
|
<BuildingTax
|
||||||
|
className={clx("shrink-0", { "text-ui-fg-muted": !includesTax })}
|
||||||
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
+14
-6
@@ -45,6 +45,10 @@ export const createDataGridPriceColumns = <
|
|||||||
(p) => p.attribute === "currency_code" && p.value === currency
|
(p) => p.attribute === "currency_code" && p.value === currency
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const translatedCurrencyName = t("fields.priceTemplate", {
|
||||||
|
regionOrCurrency: currency.toUpperCase(),
|
||||||
|
})
|
||||||
|
|
||||||
return columnHelper.column({
|
return columnHelper.column({
|
||||||
id: `currency_prices.${currency}`,
|
id: `currency_prices.${currency}`,
|
||||||
name: t("fields.priceTemplate", {
|
name: t("fields.priceTemplate", {
|
||||||
@@ -62,9 +66,9 @@ export const createDataGridPriceColumns = <
|
|||||||
type: "number",
|
type: "number",
|
||||||
header: () => (
|
header: () => (
|
||||||
<div className="flex w-full items-center justify-between gap-3">
|
<div className="flex w-full items-center justify-between gap-3">
|
||||||
{t("fields.priceTemplate", {
|
<span className="truncate" title={translatedCurrencyName}>
|
||||||
regionOrCurrency: currency.toUpperCase(),
|
{translatedCurrencyName}
|
||||||
})}
|
</span>
|
||||||
<IncludesTaxTooltip includesTax={preference?.is_tax_inclusive} />
|
<IncludesTaxTooltip includesTax={preference?.is_tax_inclusive} />
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@@ -82,6 +86,10 @@ export const createDataGridPriceColumns = <
|
|||||||
(p) => p.attribute === "region_id" && p.value === region.id
|
(p) => p.attribute === "region_id" && p.value === region.id
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const translatedRegionName = t("fields.priceTemplate", {
|
||||||
|
regionOrCurrency: region.name,
|
||||||
|
})
|
||||||
|
|
||||||
return columnHelper.column({
|
return columnHelper.column({
|
||||||
id: `region_prices.${region.id}`,
|
id: `region_prices.${region.id}`,
|
||||||
name: t("fields.priceTemplate", {
|
name: t("fields.priceTemplate", {
|
||||||
@@ -99,9 +107,9 @@ export const createDataGridPriceColumns = <
|
|||||||
type: "number",
|
type: "number",
|
||||||
header: () => (
|
header: () => (
|
||||||
<div className="flex w-full items-center justify-between gap-3">
|
<div className="flex w-full items-center justify-between gap-3">
|
||||||
{t("fields.priceTemplate", {
|
<span className="truncate" title={translatedRegionName}>
|
||||||
regionOrCurrency: region.name,
|
{translatedRegionName}
|
||||||
})}
|
</span>
|
||||||
<IncludesTaxTooltip includesTax={preference?.is_tax_inclusive} />
|
<IncludesTaxTooltip includesTax={preference?.is_tax_inclusive} />
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
|
|||||||
-1
@@ -64,7 +64,6 @@ export const EditRegionForm = ({
|
|||||||
currency_code: values.currency_code.toLowerCase(),
|
currency_code: values.currency_code.toLowerCase(),
|
||||||
payment_providers: values.payment_providers,
|
payment_providers: values.payment_providers,
|
||||||
is_tax_inclusive: values.is_tax_inclusive,
|
is_tax_inclusive: values.is_tax_inclusive,
|
||||||
automatic_taxes: values.automatic_taxes,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
|
|||||||
Reference in new issue
Block a user