-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite settings patch and add to api
- Loading branch information
Showing
14 changed files
with
255 additions
and
312 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,7 @@ | |
color | ||
toasts | ||
styles | ||
settings | ||
} | ||
utils { | ||
constants | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,47 @@ | ||
// TODO: make settings patches part of the api | ||
import patchPanels from "@core/ui/settings/patches/panels"; | ||
import patchYou from "@core/ui/settings/patches/you"; | ||
import { Strings } from "@core/i18n"; | ||
import { getAssetIDByName } from "@lib/api/assets"; | ||
import { isThemeSupported } from "@lib/api/native/loader"; | ||
import { useProxy } from "@lib/api/storage"; | ||
import { settings } from "@lib/settings"; | ||
import { registerSection } from "@lib/ui/settings"; | ||
import { version } from "bunny-build"; | ||
|
||
export default function initSettings() { | ||
const patches = [ | ||
patchPanels(), | ||
patchYou(), | ||
]; | ||
// @ts-ignore | ||
import PyoncordIcon from "../../../assets/icons/pyon64.png"; | ||
|
||
return () => patches.forEach(p => p?.()); | ||
export default function initSettings() { | ||
registerSection({ | ||
name: "Bunny", | ||
items: [ | ||
{ | ||
key: "BUNNY", | ||
title: () => Strings.BUNNY, | ||
icon: { uri: PyoncordIcon }, | ||
render: () => import("@core/ui/settings/pages/General"), | ||
rawTabsConfig: { | ||
useTrailing: () => `(${version})` | ||
} | ||
}, | ||
{ | ||
key: "BUNNY_PLUGINS", | ||
title: () => Strings.PLUGINS, | ||
icon: getAssetIDByName("ActivitiesIcon"), | ||
render: () => import("@core/ui/settings/pages/Plugins") | ||
}, | ||
{ | ||
key: "BUNNY_THEMES", | ||
title: () => Strings.THEMES, | ||
icon: getAssetIDByName("PaintPaletteIcon"), | ||
render: () => import("@core/ui/settings/pages/Themes"), | ||
usePredicate: () => isThemeSupported() | ||
}, | ||
{ | ||
key: "BUNNY_DEVELOPER", | ||
title: () => Strings.DEVELOPER, | ||
icon: getAssetIDByName("WrenchIcon"), | ||
render: () => import("@core/ui/settings/pages/Developer"), | ||
usePredicate: () => useProxy(settings).developerSettings ?? false | ||
} | ||
] | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.