slate/common/navigation-data.js

160 lines
3.1 KiB
JavaScript
Raw Normal View History

import * as Strings from "~/common/strings";
// NOTE(jim):
// Recursion for nested entities (any number).
export const getCurrentById = (targetId) => {
let target = null;
let activeIds = {};
const findById = (state, id) => {
for (let i = 0; i < state.length; i++) {
if (state[i].id === id) {
target = state[i];
activeIds[state[i].id] = true;
}
// if (!target && state[i].children) {
// activeIds[state[i].id] = true;
// findById(state[i].children, id);
// if (!target) {
// activeIds[state[i].id] = false;
// }
// }
}
};
findById(navigation, targetId);
return { target, activeIds };
};
export const navigation = [
{
2020-12-19 08:25:50 +03:00
id: "NAV_DATA",
decorator: "DATA",
name: "Home",
pageTitle: "Welcome back!",
},
{
2020-12-19 08:25:50 +03:00
id: "NAV_ACTIVITY",
decorator: "ACTIVITY",
name: "Activity",
pageTitle: "Welcome back!",
2020-12-19 08:25:50 +03:00
ignore: true,
2021-01-14 09:30:26 +03:00
},
{
id: "NAV_EXPLORE",
decorator: "EXPLORE",
name: "Explore",
pageTitle: "Welcome back!",
ignore: true,
},
{
2020-12-19 08:25:50 +03:00
id: "NAV_SLATES",
decorator: "SLATES",
name: "Slates",
pageTitle: "Slates",
2020-12-18 00:49:39 +03:00
ignore: true,
},
2020-12-18 05:59:41 +03:00
{
2020-12-19 08:25:50 +03:00
id: "NAV_SLATES_FOLLOWING",
2020-12-18 05:59:41 +03:00
decorator: "SLATES_FOLLOWING",
name: "Slates",
pageTitle: "Slates",
ignore: true,
},
2020-12-09 07:22:17 +03:00
{
2020-12-19 08:25:50 +03:00
id: "NAV_DIRECTORY",
2020-12-09 07:22:17 +03:00
decorator: "DIRECTORY",
name: "Directory",
pageTitle: "Your directory",
},
2020-12-18 05:59:41 +03:00
{
2020-12-19 08:25:50 +03:00
id: "NAV_DIRECTORY_FOLLOWERS",
2020-12-18 05:59:41 +03:00
decorator: "DIRECTORY_FOLLOWERS",
name: "Directory",
pageTitle: "Your directory",
ignore: true,
},
{
2020-12-19 08:25:50 +03:00
id: "NAV_SLATE",
decorator: "SLATE",
name: "Slate",
pageTitle: "Slate",
ignore: true,
},
2020-08-25 05:31:42 +03:00
/*
{
id: "V1_NAVIGATION_LOCAL",
decorator: "LOCAL_DATA",
name: "Local",
pageTitle: "Your local data",
children: [],
ignore: false,
},
{
id: "V1_NAVIGATION_NETWORK",
decorator: "NETWORK",
name: "Network",
pageTitle: "The Filecoin Network",
children: null,
},
2020-08-25 05:31:42 +03:00
*/
2020-09-09 20:56:35 +03:00
{
2020-12-19 08:25:50 +03:00
id: "NAV_FILECOIN",
2020-09-09 20:56:35 +03:00
decorator: "FILECOIN",
name: "Filecoin",
2020-09-09 20:56:35 +03:00
pageTitle: "Archive on Filecoin",
2020-09-25 10:08:08 +03:00
filecoin: true,
},
{
2020-12-19 08:25:50 +03:00
id: "NAV_STORAGE_DEAL",
decorator: "STORAGE_DEAL",
name: "Storage Deal",
filecoin: true,
2021-01-21 22:20:13 +03:00
pageTitle: "Make a one-off Filecoin storage deal",
},
{
2020-12-19 08:25:50 +03:00
id: "NAV_API",
decorator: "API",
2020-11-16 00:54:14 +03:00
name: "API",
pageTitle: "Developer API",
2020-09-23 05:39:46 +03:00
},
{
2020-12-19 08:25:50 +03:00
id: "NAV_SETTINGS",
decorator: "SETTINGS",
name: "Profile & Account Settings",
pageTitle: "Your Profile & Account Settings",
ignore: true,
},
{
id: "NAV_PROFILE_FILES",
decorator: "PROFILE_FILES",
name: "Profile",
pageTitle: "Profile",
ignore: true,
},
{
2020-12-19 08:25:50 +03:00
id: "NAV_PROFILE",
decorator: "PROFILE",
name: "Profile",
pageTitle: "Profile",
ignore: true,
},
{
id: "NAV_PROFILE_PEERS",
decorator: "PROFILE_PEERS",
name: "Profile",
pageTitle: "Profile",
ignore: true,
},
{
2020-12-19 08:25:50 +03:00
id: "NAV_FILE",
decorator: "FILE",
name: "File",
pageTitle: "File",
ignore: true,
},
];