I think it'd be nice to support custom components for the PricingSlot price & title (possibly elsewhere too, these seem like the most important to be customisable to me).
I started working on this, I'll publish the branch to my fork soon (I want to test it more & write an example, possibly tests too).
Would you be open to this ?
Here's how it currently looks like:
<PricingSlot
priceText="$ 200"
priceAccessor={customPrice}
>
const customPrice = ({ className, text }) => {
return (
<li className={className}>
<span>Starting at</span>
<span>{text}</span>
</li>
)
}
The className & text props are "tags" & this.props.priceText respectively. Not sure we should pass them to custom components, but then again why not ? And I've made pretty much the same thing for the title, allowing for custom title component.
Thoughts ?
I think it'd be nice to support custom components for the
PricingSlotprice & title (possibly elsewhere too, these seem like the most important to be customisable to me).I started working on this, I'll publish the branch to my fork soon (I want to test it more & write an example, possibly tests too).
Would you be open to this ?
Here's how it currently looks like:
The
className&textprops are"tags"&this.props.priceTextrespectively. Not sure we should pass them to custom components, but then again why not ? And I've made pretty much the same thing for the title, allowing for custom title component.Thoughts ?