-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
maintenanceTickets that do not encompass new features but contribute to the overall quality of the projectTickets that do not encompass new features but contribute to the overall quality of the project
Description
we could simplify the logic that handles populating and renaming the platform lists on CASEI's Explore pages by having the translation of the group name occur within the usePlatformList hook itself. First identified in comments in #574
@alukach: we could simplify this by having the translation of the group name occur within the usePlatformList hook itself to reduce the number of files and functions in this project. Also an implementation like this will allow future consumers of usePlatformList to get the same results as what we are rendering in the ExplorePlatforms components:
const groupByPlatformType = (acc, item) => {
const categoryTranslations = {
Aircraft: "Air-based platforms",
};
const group =
categoryTranslations[item.searchCategory] ?? item.searchCategory ?? "Other";
(acc[group] ??= []).push(item);
return acc;
};
In #574 this was attempted, but I encountered unexpected Render Lifecycle behavior:
- After the first time the page renders, we then have more items pushed into the platform list. It gives correct results on the first render, but then on the second render the Air-based platforms are pushed to include 320 platforms (all platforms).
Metadata
Metadata
Assignees
Labels
maintenanceTickets that do not encompass new features but contribute to the overall quality of the projectTickets that do not encompass new features but contribute to the overall quality of the project