Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(admin-ui): fix height of Bulk Editor cells to always be 40px #5737

Merged
merged 2 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/chilled-lions-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/admin-ui": patch
---

fix(admin-ui): Fix height of Bulk Editor cells when product has few variants"
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { forwardRef, useEffect, useRef, useState } from "react"
import { ProductVariant } from "@medusajs/client-types"
import AmountField from "react-currency-input-field"
import clsx from "clsx"
import React, { forwardRef, useEffect, useRef, useState } from "react"
import AmountField from "react-currency-input-field"

import { currencies as CURRENCY_MAP } from "../../../../utils/currencies"
import { useAdminRegions } from "medusa-react"
import { currencies as CURRENCY_MAP } from "../../../../utils/currencies"

/**
* Return currency metadata or metadata of region's currency
Expand Down Expand Up @@ -197,7 +197,7 @@ function CurrencyCell(props: CurrencyCellProps) {
<td
onMouseOver={() => onColumnOver(currencyCode || region)}
onMouseDown={onCellMouseDown}
className={clsx("relative cursor-pointer border pr-2 pl-4", {
className={clsx("relative h-10 cursor-pointer border pl-4 pr-2", {
"bg-blue-100": isSelected && !isAnchor,
})}
style={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -677,12 +677,12 @@ function EditPricesTable(props: EditPricesTableProps) {
(e) => e.preventDefault()
}
style={{ fontSize: 13, borderCollapse: "collapse" }}
className="h-full w-full table-auto"
className="w-full table-auto"
>
<thead>
<tr
style={{ height: 42 }}
className="tw-text-medusa-text-subtle h-2 text-left font-normal"
className="tw-text-medusa-text-subtle h-10 text-left font-normal"
>
<th className="h-2 border border-t-0 pl-4 font-medium text-gray-400">
Product
Expand Down Expand Up @@ -734,7 +734,7 @@ function EditPricesTable(props: EditPricesTableProps) {
</tr>
</thead>
<tbody>
<tr style={{ lineHeight: 3, background: "#f9fafb" }}>
<tr style={{ lineHeight: 3, background: "#f9fafb" }} className="">
<td className="border pl-4 pr-4">
<div className="text-black-800 flex items-center gap-2 overflow-hidden">
{props.product.thumbnail && (
Expand Down Expand Up @@ -768,7 +768,7 @@ function EditPricesTable(props: EditPricesTableProps) {
onMouseEnter={() => onMouseRowEnter(variant.id)}
style={{ lineHeight: 3 }}
>
<td className="whitespace-nowrap border pl-10 pr-4 text-gray-600">
<td className="h-10 whitespace-nowrap border pl-10 pr-4 text-gray-600">
{variant.title} {variant.sku && `∙ ${variant.sku}`}
</td>

Expand Down