Skip to content

Commit

Permalink
wrap rounded cuboid with color wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Slaviiiii committed Aug 5, 2024
1 parent 7d09107 commit 0b49895
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion examples/rounded-cuboid.fixture.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ import { JsCadFixture } from "../lib/components/jscad-fixture"

export default () => (
<JsCadFixture>
<RoundedCuboid size={[15, 10, 10]} roundRadius={1} center={[0, 0, 10]} />
<RoundedCuboid
size={[15, 10, 10]}
roundRadius={1}
color="skyblue"
center={[0, 0, 10]}
/>
</JsCadFixture>
)
3 changes: 2 additions & 1 deletion lib/jscad-fns/rounded-cuboid.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { withColorProp } from "../wrappers/with-color-prop"
import { withOffsetProp } from "../wrappers/with-offset-prop"

export type RoundedCuboidProps = {
Expand All @@ -9,4 +10,4 @@ const RoundedCuboidBase = ({ size, roundRadius }: RoundedCuboidProps) => {
return <roundedCuboid size={size} roundRadius={roundRadius} />
}

export const RoundedCuboid = withOffsetProp(RoundedCuboidBase)
export const RoundedCuboid = withOffsetProp(withColorProp(RoundedCuboidBase))

0 comments on commit 0b49895

Please sign in to comment.