export type SidePanelState = SidePanelItem[];
-export const sidePanelReducer = (state: SidePanelState = sidePanelData, action: SidePanelAction) => {
+export const sidePanelReducer = (state: SidePanelState = sidePanelItems, action: SidePanelAction) => {
return sidePanelActions.match(action, {
TOGGLE_SIDE_PANEL_ITEM_OPEN: itemId =>
state.map(it => ({...it, open: itemId === it.id && it.open === false})),
});
};
-export enum SidePanelIdentifiers {
+export enum SidePanelId {
PROJECTS = "Projects",
SHARED_WITH_ME = "SharedWithMe",
WORKFLOWS = "Workflows",
TRASH = "Trash"
}
-export const sidePanelData = [
+export const sidePanelItems = [
{
- id: SidePanelIdentifiers.PROJECTS,
+ id: SidePanelId.PROJECTS,
name: "Projects",
url: "/projects",
icon: ProjectsIcon,
}
},
{
- id: SidePanelIdentifiers.SHARED_WITH_ME,
+ id: SidePanelId.SHARED_WITH_ME,
name: "Shared with me",
url: "/shared",
icon: ShareMeIcon,
}
},
{
- id: SidePanelIdentifiers.WORKFLOWS,
+ id: SidePanelId.WORKFLOWS,
name: "Workflows",
url: "/workflows",
icon: WorkflowIcon,
}
},
{
- id: SidePanelIdentifiers.RECENT_OPEN,
+ id: SidePanelId.RECENT_OPEN,
name: "Recent open",
url: "/recent",
icon: RecentIcon,
}
},
{
- id: SidePanelIdentifiers.FAVORITES,
+ id: SidePanelId.FAVORITES,
name: "Favorites",
url: "/favorites",
icon: FavoriteIcon,
}
},
{
- id: SidePanelIdentifiers.TRASH,
+ id: SidePanelId.TRASH,
name: "Trash",
url: "/trash",
icon: TrashIcon,