refactor: Simplify/cleanup officer data approach #37
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.