decord/source/modules/client_themes/native/useActiveTheme.tsx
github-actions cd74c1f217 chore: update source for alpha 345.5
Skipped 1 file(s) >100MB (GitHub limit): source/__vendor/09xxx/9667_m.js (378 MB)
2026-09-05 10:56:28 +00:00

61 lines
2.2 KiB
TypeScript

// Module ID: 7874
// Function ID: 7875
// Name: useActiveThemeType
// Dependencies: [1185, 4379, 1228, 1186, 504, 4416, 2]
// Exports: useIsClientThemeOrCustomThemeActive, useIsCustomThemeActive
// Module 7874 (useActiveThemeType)
import initialize from "initialize" /* 504 */;
import getGuildIdFromNavigationStateDefault from "getGuildIdFromNavigationState" /* 4416 */;
import closure_3 from "CHANNEL_SIDEBAR_WIDTH" /* 1185 */;
import closure_4 from "reset" /* 4379 */;
import closure_5 from "reset" /* 1228 */;
import SystemThemeState from "SystemThemeState" /* 1186 */;
require = arg1;
function useActiveThemeType() {
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];
let type;
const stateFromStores2 = initialize.useStateFromStores(items2, () => useSystemTheme.useSystemTheme);
if (tmp3 != null) {
type = tmp3.type;
}
if ("custom" === type) {
let DEFAULT = constants2.CUSTOM;
} else {
let type1;
if (tmp3 != null) {
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;
}
({ SystemThemeState: closure_6, ActiveThemeType: error } = SystemThemeState);
const result = require("set").fileFinishedImporting("modules/client_themes/native/useActiveTheme.tsx");
export const useIsCustomThemeActive = function useIsCustomThemeActive() {
return useActiveThemeType() === constants2.CUSTOM;
};
export const useIsClientThemeOrCustomThemeActive = function useIsClientThemeOrCustomThemeActive() {
const tmp = useActiveThemeType();
return tmp === constants2.CLIENT || tmp === constants2.CUSTOM;
};
export { useActiveThemeType };