Skip to content

Commit 49c65e0

Browse files
authored
fix: Adjust property components for backwards compatibility (#524)
1 parent 7418833 commit 49c65e0

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

src/components/Prop.tsx

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
11
import { Div, type DivProps } from 'honorable'
22
import styled from 'styled-components'
33

4-
const PropSC = styled.div(({ theme }) => ({
5-
margin: theme.spacing.medium,
4+
const PropSC = styled.div<{ $margin?: string | number }>(
5+
({ $margin, theme }) => ({
6+
margin: $margin ?? theme.spacing.medium,
67

7-
'.prop-title': {
8-
...theme.partials.text.caption,
9-
color: theme.colors['text-xlight'],
10-
marginBottom: theme.spacing.xxsmall,
11-
},
12-
}))
8+
'.prop-title': {
9+
...theme.partials.text.caption,
10+
color: theme.colors['text-xlight'],
11+
marginBottom: theme.spacing.xxsmall,
12+
},
13+
})
14+
)
1315

1416
export default function Prop({
1517
children,
1618
title,
19+
margin,
1720
...props
1821
}: {
1922
title: string
23+
margin?: string | number
2024
} & DivProps) {
2125
return (
22-
<PropSC>
26+
<PropSC $margin={margin}>
2327
<div className="prop-title">{title}</div>
2428
<Div {...props}>{children}</Div>
2529
</PropSC>

src/components/PropsContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default function PropsContainer({
1717
title,
1818
...props
1919
}: {
20-
title: string
20+
title?: string
2121
} & DivProps) {
2222
return (
2323
<PropsContainerSC {...props}>

0 commit comments

Comments
 (0)