Closed WillBAnders closed 9 months ago
Wow, that looks a lot cleaner. Really helped remove a lot of unnecessary long repeats of code. I was confused about the difference between officerCardData and officerData so that helps clear things up. Awesome work!
PR split from #35 for review. This has a few changes; may be worth looking at specific commits.
officerData
and the olderofficerCardData
). In general, the approach here is thatofficerData
contains personal information about an officer. Information about positions is only present as part ofpositionData
later on, which references the corresponding officer inofficerData
. This is the primary improvement in this PR.OfficerData
type which is used byOfficerCardProps
rather than usingOfficerCardProps
directly - in general, types for data should be kept separate from any component prop types. This also helps avoids circular dependencies.socialLinksData
field has been replaced bysocials
(just a slightly nicer name) that is map ofsite
tourl
. This greatly simplifies the amount of data that needs to be stored for each officer, as the icon image path can be looked up separately.key
attribute improvements while here.