1
0
Fork 0

Merge pull request #4944 from freesewing/joost

fix(shared): Take units into account for displaying sets. Fixes #4939
This commit is contained in:
Joost De Cock 2023-09-12 14:23:29 +02:00 committed by GitHub
commit 3debcc853e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -106,7 +106,11 @@ export const NewSet = () => {
} }
export const MeasieVal = ({ val, m, imperial }) => export const MeasieVal = ({ val, m, imperial }) =>
isDegreeMeasurement(m) ? <span>{val}°</span> : <span>{formatMm(val, imperial)}</span> isDegreeMeasurement(m) ? (
<span>{val}°</span>
) : (
<span dangerouslySetInnerHTML={{ __html: formatMm(val, imperial) }}></span>
)
export const MsetCard = ({ export const MsetCard = ({
set, set,
@ -399,7 +403,7 @@ export const Mset = ({ id, publicOnly = false }) => {
<h2>{t('measies')}</h2> <h2>{t('measies')}</h2>
{Object.entries(mset.measies).map(([m, val]) => {Object.entries(mset.measies).map(([m, val]) =>
val > 0 ? ( val > 0 ? (
<DisplayRow title={<MeasieVal m={m} val={val} />} key={m}> <DisplayRow title={<MeasieVal {...{ m, val, imperial: mset.imperial }} />} key={m}>
<span className="font-medium">{t(m)}</span> <span className="font-medium">{t(m)}</span>
</DisplayRow> </DisplayRow>
) : null ) : null