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:
@@ -20,7 +20,9 @@ export const IncludesTaxTooltip = ({
|
||||
: t("general.excludesTaxTooltip")
|
||||
}
|
||||
>
|
||||
<BuildingTax className={clx({ "text-ui-fg-muted": !includesTax })} />
|
||||
<BuildingTax
|
||||
className={clx("shrink-0", { "text-ui-fg-muted": !includesTax })}
|
||||
/>
|
||||
</Tooltip>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -45,6 +45,10 @@ export const createDataGridPriceColumns = <
|
||||
(p) => p.attribute === "currency_code" && p.value === currency
|
||||
)
|
||||
|
||||
const translatedCurrencyName = t("fields.priceTemplate", {
|
||||
regionOrCurrency: currency.toUpperCase(),
|
||||
})
|
||||
|
||||
return columnHelper.column({
|
||||
id: `currency_prices.${currency}`,
|
||||
name: t("fields.priceTemplate", {
|
||||
@@ -62,9 +66,9 @@ export const createDataGridPriceColumns = <
|
||||
type: "number",
|
||||
header: () => (
|
||||
<div className="flex w-full items-center justify-between gap-3">
|
||||
{t("fields.priceTemplate", {
|
||||
regionOrCurrency: currency.toUpperCase(),
|
||||
})}
|
||||
<span className="truncate" title={translatedCurrencyName}>
|
||||
{translatedCurrencyName}
|
||||
</span>
|
||||
<IncludesTaxTooltip includesTax={preference?.is_tax_inclusive} />
|
||||
</div>
|
||||
),
|
||||
@@ -82,6 +86,10 @@ export const createDataGridPriceColumns = <
|
||||
(p) => p.attribute === "region_id" && p.value === region.id
|
||||
)
|
||||
|
||||
const translatedRegionName = t("fields.priceTemplate", {
|
||||
regionOrCurrency: region.name,
|
||||
})
|
||||
|
||||
return columnHelper.column({
|
||||
id: `region_prices.${region.id}`,
|
||||
name: t("fields.priceTemplate", {
|
||||
@@ -99,9 +107,9 @@ export const createDataGridPriceColumns = <
|
||||
type: "number",
|
||||
header: () => (
|
||||
<div className="flex w-full items-center justify-between gap-3">
|
||||
{t("fields.priceTemplate", {
|
||||
regionOrCurrency: region.name,
|
||||
})}
|
||||
<span className="truncate" title={translatedRegionName}>
|
||||
{translatedRegionName}
|
||||
</span>
|
||||
<IncludesTaxTooltip includesTax={preference?.is_tax_inclusive} />
|
||||
</div>
|
||||
),
|
||||
|
||||
@@ -64,7 +64,6 @@ export const EditRegionForm = ({
|
||||
currency_code: values.currency_code.toLowerCase(),
|
||||
payment_providers: values.payment_providers,
|
||||
is_tax_inclusive: values.is_tax_inclusive,
|
||||
automatic_taxes: values.automatic_taxes,
|
||||
},
|
||||
{
|
||||
onSuccess: () => {
|
||||
|
||||
Reference in New Issue
Block a user