Skip to content

Commit

Permalink
fix: improve MetaDetail layout (#2558)
Browse files Browse the repository at this point in the history
  • Loading branch information
flagrede authored Nov 26, 2024
1 parent efa3d8f commit 67da47f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const MetaDetailBaseValue: React.FC<Props> = ({
return (
<>
{formattedValue && (
<Body size={bodySize} sx={sxToArray(sx)} className="break-all">
<Body size={bodySize} sx={sxToArray(sx)} className="break-words">
{formattedValue}
</Body>
)}
Expand All @@ -63,7 +63,7 @@ const MetaDetailBaseValue: React.FC<Props> = ({
size={bodySize}
styleLinks={false}
sx={sxToArray(sx)}
className="break-all"
className="break-words"
>
<LinkWithArrow
href={value['schema:url']}
Expand Down
22 changes: 13 additions & 9 deletions web-marketplace/src/components/molecules/MetaDetail/MetaDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,19 @@ const MetaDetail: React.FC<Props> = ({
{customContent ? (
<>{customContent}</>
) : isArray ? (
value.map((v, i) => (
<MetaDetailBaseValue
key={i}
value={v}
rdfType={rdfType}
bodySize={bodySize}
sx={{ pb: value.length > 1 ? 2 : 0 }}
/>
))
value.map((v, i) => {
const isLast = i === value.length - 1;

return (
<MetaDetailBaseValue
key={i}
value={v}
rdfType={rdfType}
bodySize={bodySize}
sx={{ pb: value.length > 1 && !isLast ? 3 : 0 }}
/>
);
})
) : (
<MetaDetailBaseValue
value={value}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ const ComplianceInfo = ({
bodySize="lg"
/>
<MetaDetail label={_(msg`biome`)} value={biomeType} bodySize="lg" />
</Grid>
<Grid container spacing={8}>
<MetaDetail label={_(msg`region`)} value={region} bodySize="lg" />
<MetaDetail
label={_(msg`department`)}
Expand Down

0 comments on commit 67da47f

Please sign in to comment.