slate/common/navigation-data.js

70 lines
1.4 KiB
JavaScript
Raw Normal View History

const constructFilesTreeForNavigation = (library) => {
for (let i = 0; i < library.length; i++) {
for (let j = 0; j < library[i].children.length; j++) {
let e = library[i].children[j];
2020-06-19 06:57:57 +03:00
if (e.decorator === "FILE") {
library[i].children[j].pageTitle = "Viewing file";
library[i].children[j].ignore = true;
}
}
}
return library;
};
export const generate = (library) => [
{
id: 1,
2020-06-19 06:57:57 +03:00
name: "Home",
pageTitle: "Welcome back!",
2020-06-19 06:57:57 +03:00
decorator: "HOME",
children: null,
},
{
id: 2,
2020-06-19 06:57:57 +03:00
name: "Wallet",
pageTitle: "Your wallet and addresses",
2020-06-19 06:57:57 +03:00
decorator: "WALLET",
},
...constructFilesTreeForNavigation(library),
{
id: 3,
name: "Slates",
pageTitle: "Your slates",
decorator: "SLATES",
children: [],
},
{
id: 13,
2020-06-19 06:57:57 +03:00
name: "Edit account",
pageTitle: "your account",
decorator: "EDIT_ACCOUNT",
children: null,
ignore: true,
},
{
id: 14,
name: "Filecoin Settings",
pageTitle: "Your hot and cold deal settings.",
2020-06-19 06:57:57 +03:00
decorator: "SETTINGS",
children: null,
ignore: true,
},
{
id: 15,
name: null,
2020-06-19 06:57:57 +03:00
pageTitle: "files",
decorator: "FILE",
children: null,
ignore: true,
},
{
id: 16,
name: "API Key & Tokens",
pageTitle: "you",
decorator: "SETTINGS_DEVELOPER",
children: null,
ignore: true,
},
];