Skip to content

Commit

Permalink
fix(dashboard): Reduce data loaded by product details page (medusajs#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperkristensen authored Nov 10, 2024
1 parent e229bea commit 49f3f0c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const SectionRow = ({ title, value, actions }: SectionRowProps) => {
return (
<div
className={clx(
`text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4`,
`text-ui-fg-subtle grid w-full grid-cols-2 items-center gap-4 px-6 py-4`,
{
"grid-cols-[1fr_1fr_28px]": !!actions,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ const Root = <TData,>({
const showExtraData = showJSON || showMetadata

return (
<div className="flex flex-col gap-y-3">
<div className="flex w-full flex-col gap-y-3">
{before.map((Component, i) => {
return <Component {...widgetProps} key={i} />
})}
<div className="flex flex-col gap-x-4 gap-y-3 xl:flex-row xl:items-start">
<div className="flex w-full flex-col gap-y-3">
<div className="flex w-full flex-col items-start gap-x-4 gap-y-3 xl:grid xl:grid-cols-[minmax(0,_1fr)_440px]">
<div className="flex w-full min-w-0 flex-col gap-y-3">
{main}
{after.map((Component, i) => {
return <Component {...widgetProps} key={i} />
Expand All @@ -87,7 +87,7 @@ const Root = <TData,>({
</div>
)}
</div>
<div className="flex w-full max-w-[100%] flex-col gap-y-3 xl:mt-0 xl:max-w-[440px]">
<div className="flex w-full flex-col gap-y-3 xl:mt-0">
{sideBefore.map((Component, i) => {
return <Component {...widgetProps} key={i} />
})}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import { getLinkedFields } from "../../../extensions"

export const PRODUCT_DETAIL_FIELDS = getLinkedFields("product", "*categories")
export const PRODUCT_DETAIL_FIELDS = getLinkedFields(
"product",
"*categories,-variants"
)

0 comments on commit 49f3f0c

Please sign in to comment.