this repo has no description

Merge pull request #161 from moonlight-mod/cyn/to-the-top

moonbase: Move to the top by default

Changed files
+24 -6
packages
core-extensions
src
moonbase
webpackModules
+10 -2
packages/core-extensions/src/moonbase/manifest.json
···
"advice": "reload",
"displayName": "Split into sections",
"description": "Show the Moonbase tabs as separate sections",
-
"type": "boolean"
+
"type": "boolean",
+
"default": false
+
},
+
"oldLocation": {
+
"advice": "reload",
+
"displayName": "Put Moonbase back at the bottom",
+
"type": "boolean",
+
"default": false
},
"saveFilter": {
"advice": "none",
"displayName": "Persist filter",
"description": "Save extension filter in config",
-
"type": "boolean"
+
"type": "boolean",
+
"default": false
},
"updateChecking": {
"advice": "none",
+14 -4
packages/core-extensions/src/moonbase/webpackModules/settings.tsx
···
}
};
+
const oldLocation = MoonbaseSettingsStore.getExtensionConfigRaw<boolean>("moonbase", "oldLocation", false);
+
const position = oldLocation ? -2 : -9999;
+
function addSection(id: string, name: string, element: React.FunctionComponent) {
-
settings.addSection(`moonbase-${id}`, name, element, null, -2, notice);
+
settings.addSection(`moonbase-${id}`, name, element, null, position, notice);
}
// FIXME: move to component types
···
{crumb.label}
</Text>
);
+
}
+
+
if (!oldLocation) {
+
settings.addDivider(position);
}
if (MoonbaseSettingsStore.getExtensionConfigRaw<boolean>("moonbase", "sections", false)) {
-
settings.addHeader("Moonbase", -2);
+
if (oldLocation) settings.addHeader("Moonbase", position);
-
for (const page of pages) {
+
const _pages = oldLocation ? pages : pages.reverse();
+
for (const page of _pages) {
addSection(page.id, page.name, () => {
const breadcrumbs = [
{ id: "moonbase", label: "Moonbase" },
···
);
});
}
+
+
if (!oldLocation) settings.addHeader("Moonbase", position);
} else {
-
settings.addSection("moonbase", "Moonbase", Moonbase, null, -2, notice);
+
settings.addSection("moonbase", "Moonbase", Moonbase, null, position, notice);
settings.addSectionMenuItems(
"moonbase",