decord/source/modules/client_themes/native/useActiveTheme.tsx

62 lines
2.2 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 8542
// Function ID: 8543
2026-07-20 16:05:17 +00:00
// Name: useActiveThemeType
2026-08-24 06:08:38 +00:00
// Dependencies: [1304, 4199, 1346, 1305, 589, 4232, 2]
2026-07-20 16:05:17 +00:00
// Exports: useIsClientThemeOrCustomThemeActive, useIsCustomThemeActive
2026-08-24 06:08:38 +00:00
// Module 8542 (useActiveThemeType)
import initialize from "initialize" /* 589 */;
import getGuildIdFromNavigationStateDefault from "getGuildIdFromNavigationState" /* 4232 */;
import closure_3 from "CHANNEL_SIDEBAR_WIDTH" /* 1304 */;
import closure_4 from "isSyncedModeThemesEnabled" /* 4199 */;
import closure_5 from "reset" /* 1346 */;
import SystemThemeState from "SystemThemeState" /* 1305 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-20 16:05:17 +00:00
function useActiveThemeType() {
2026-08-24 06:08:38 +00:00
const items = [closure_5];
const stateFromStores = initialize.useStateFromStores(items, () => closure_5.hasCustomTheme());
const obj = initialize;
const items1 = [closure_4];
const stateFromStores1 = initialize.useStateFromStores(items1, () => null != gradientPreset.gradientPreset);
const tmp3 = getGuildIdFromNavigationStateDefault();
const obj2 = initialize;
const items2 = [closure_3];
2026-07-20 16:05:17 +00:00
let type;
2026-08-24 06:08:38 +00:00
const stateFromStores2 = initialize.useStateFromStores(items2, () => useSystemTheme.useSystemTheme);
2026-07-29 08:29:29 +00:00
if (tmp3 != null) {
2026-07-20 16:05:17 +00:00
type = tmp3.type;
}
if ("custom" === type) {
let DEFAULT = constants2.CUSTOM;
} else {
let type1;
2026-07-29 08:29:29 +00:00
if (tmp3 != null) {
2026-07-20 16:05:17 +00:00
type1 = tmp3.type;
}
if ("preset" === type1) {
DEFAULT = constants2.CLIENT;
} else if (stateFromStores) {
DEFAULT = constants2.CUSTOM;
} else if (stateFromStores1) {
DEFAULT = constants2.CLIENT;
} else if (stateFromStores2 === constants.ON) {
DEFAULT = constants2.SYSTEM;
} else {
DEFAULT = constants2.DEFAULT;
}
}
return DEFAULT;
}
2026-07-29 08:29:29 +00:00
({ SystemThemeState: closure_6, ActiveThemeType: error } = SystemThemeState);
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/client_themes/native/useActiveTheme.tsx");
2026-07-20 16:05:17 +00:00
export const useIsCustomThemeActive = function useIsCustomThemeActive() {
return useActiveThemeType() === constants2.CUSTOM;
};
export const useIsClientThemeOrCustomThemeActive = function useIsClientThemeOrCustomThemeActive() {
const tmp = useActiveThemeType();
2026-07-29 08:29:29 +00:00
return tmp === constants2.CLIENT || tmp === constants2.CUSTOM;
2026-07-20 16:05:17 +00:00
};
export { useActiveThemeType };