Closed camdendotlol closed 3 months ago
Since this reuses so much code from RelatedItems, it might be worth refactoring the code into a RelatedSources component and changing both RelatedItems and RelatedWorks to be thin wrappers over that. But I'm not sure how desirable that might be if the three source types are expected to diverge over time.
I think refactoring both components into RelatedSources
(which can also be used for RelatedInstances) is probably the way to go for now. I agreed, we expect the models to diverge at some point in the future, but we're not sure when or even what that will look like. Until then, it will probably be a nicer development experience to only have to make changes to a single component.
For backwards compatibility, let's add a @deprecated
annotation to the RelatedItems component and plan to remove it in the next major release.
Summary
RelatedSources
RelatedItems
component, but made more generic to take asourceType
prop and fetch instances, items, or worksdeprecated
tag toRelatedItems
Notes
onClick
prop from #285 because the prop depends on changes toRelatedItems
that only exist on that branch - whichever PR gets merged second will need to be rebased before merging with the relevant changes made.Screenshot