fix(dashboard): truncate price cell titles (#9715)

Before:
![Screenshot 2024-10-22 at 17 14 56](https://github.com/user-attachments/assets/7ec74e70-c69f-4346-b15a-665fed27e688)

After
![Screenshot 2024-10-22 at 17 26 15](https://github.com/user-attachments/assets/b353c40b-7451-4bdf-9459-1494c18c7531)


Co-authored-by: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com>
This commit is contained in:
Frane Polić
2024-11-04 12:01:00 +01:00
committed by GitHub
parent ab90900d40
commit 61cb97da26
3 changed files with 17 additions and 8 deletions

View File

@@ -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>
),