decord/source/modules/notifications/settings/native/NotificationSettingsPresets.tsx

147 lines
5.5 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 9984
// Function ID: 9985
2026-07-20 16:05:17 +00:00
// Name: NotificationSettingsPresets
2026-08-25 06:04:03 +00:00
// Dependencies: [19, 17, 21, 1236, 4592, 4340, 9985, 9887, 4380, 712, 9103, 4376, 4815, 9289, 9987, 9981, 2]
2026-07-20 16:05:17 +00:00
// Exports: NotificationSettingsChannelPresets, NotificationSettingsGuildPresets
2026-08-25 06:04:03 +00:00
// Module 9984 (NotificationSettingsPresets)
2026-08-24 06:08:38 +00:00
import ThemesDefault from "Themes" /* 712 */;
import closure_2 from "noop" /* 19 */;
import { View } from "get ActivityIndicator" /* 17 */;
import jsxProd from "jsxProd" /* 21 */;
2026-08-25 06:04:03 +00:00
import createCacheKey from "createCacheKey" /* 4380 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function NotificationSettingsPresets(preset) {
2026-07-23 10:11:24 +00:00
const _require = preset;
2026-07-20 16:05:17 +00:00
let num = 0;
2026-07-23 10:11:24 +00:00
if (preset.preset !== _require(num[4]).Presets.ALL_MESSAGES) {
2026-07-20 16:05:17 +00:00
let num2 = 1;
2026-07-29 08:29:29 +00:00
if (preset.preset !== tmp2(tmp3[4]).Presets.MENTIONS) {
2026-07-20 16:05:17 +00:00
let num3;
2026-07-29 08:29:29 +00:00
if (preset.preset === tmp2(tmp3[4]).Presets.NOTHING) {
2026-07-20 16:05:17 +00:00
num3 = 2;
}
num2 = num3;
}
num = num2;
}
2026-08-24 06:08:38 +00:00
let tmp = callback3();
2026-07-29 08:29:29 +00:00
let obj = {
2026-07-20 16:05:17 +00:00
pageWidth: 0,
2026-07-23 10:11:24 +00:00
onSetActiveIndex(arg0) {
let tmp = 0 === arg0;
2026-07-20 16:05:17 +00:00
if (tmp) {
2026-07-23 10:11:24 +00:00
tmp = preset.preset !== preset(num[4]).Presets.ALL_MESSAGES;
2026-07-20 16:05:17 +00:00
}
if (tmp) {
2026-07-23 10:11:24 +00:00
preset.updatePreset(preset(num[4]).Presets.ALL_MESSAGES);
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let tmp9 = 1 === arg0;
2026-07-20 16:05:17 +00:00
if (tmp9) {
2026-07-23 10:11:24 +00:00
tmp9 = preset.preset !== preset(num[4]).Presets.MENTIONS;
2026-07-20 16:05:17 +00:00
}
if (tmp9) {
2026-07-23 10:11:24 +00:00
preset.updatePreset(preset(num[4]).Presets.MENTIONS);
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let tmp17 = 2 === arg0;
2026-07-20 16:05:17 +00:00
if (tmp17) {
2026-07-23 10:11:24 +00:00
tmp17 = preset.preset !== preset(num[4]).Presets.NOTHING;
2026-07-20 16:05:17 +00:00
}
if (tmp17) {
2026-07-23 10:11:24 +00:00
preset.updatePreset(preset(num[4]).Presets.NOTHING);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
},
items: null,
defaultIndex: null
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
obj = { label: null, id: null, icon: null, page: null };
const intl = tmp2(tmp3[3]).intl;
obj[0] = intl.string(_require(num[3]).t.hZrr6k);
obj[1] = _require(num[4]).Presets.ALL_MESSAGES;
obj[2] = callback(_require(num[5]).CircleCheckIcon, {});
2026-07-20 16:05:17 +00:00
const items = [obj, , ];
2026-08-24 06:08:38 +00:00
obj1 = { label: null, id: null, icon: null, page: null };
2026-07-29 08:29:29 +00:00
const intl2 = tmp2(tmp3[3]).intl;
obj1[0] = intl2.string(_require(num[3]).t.y59NJm);
obj1[1] = _require(num[4]).Presets.MENTIONS;
obj1[2] = callback(_require(num[6]).MagicWandIcon, {});
2026-07-20 16:05:17 +00:00
items[1] = obj1;
2026-07-29 08:29:29 +00:00
const obj2 = { label: null, id: null, icon: null, page: null };
const intl3 = tmp2(tmp3[3]).intl;
obj2[0] = intl3.string(_require(num[3]).t["pGn/bJ"]);
obj2[1] = _require(num[4]).Presets.NOTHING;
obj2[2] = callback(_require(num[7]).BellSlashIcon, {});
2026-07-20 16:05:17 +00:00
items[2] = obj2;
2026-07-29 08:29:29 +00:00
obj[2] = items;
obj[3] = num;
const segmentedControlState = _require(num[10]).useSegmentedControlState(obj);
2026-07-20 16:05:17 +00:00
const items1 = [num, segmentedControlState];
2026-07-23 10:11:24 +00:00
const effect = segmentedControlState.useEffect(() => {
2026-07-29 08:29:29 +00:00
let tmp2 = null == num;
if (!tmp2) {
tmp2 = tmp >= 3;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp2) {
segmentedControlState.setActiveIndex(tmp);
2026-07-20 16:05:17 +00:00
}
}, items1);
2026-07-23 10:11:24 +00:00
if (preset.preset === _require(num[4]).Presets.CUSTOM) {
2026-07-29 08:29:29 +00:00
const obj3 = { style: null, children: null };
obj3[0] = tmp.customContainer;
const obj4 = { style: null, children: null };
obj4[0] = { flex: 1, marginRight: 8 };
const obj5 = { variant: "text-sm/semibold", children: null };
const intl4 = tmp2(tmp3[3]).intl;
obj5[1] = intl4.string(tmp2(tmp3[3]).t["32yow9"]);
const items2 = [tmp4(tmp2(tmp3[11]).Text, obj5), ];
const obj6 = { variant: "text-xs/medium", children: null };
const intl5 = tmp2(tmp3[3]).intl;
obj6[1] = intl5.string(tmp2(tmp3[3]).t.l3doVX);
items2[1] = tmp4(tmp2(tmp3[11]).Text, obj6);
obj4[1] = items2;
2026-07-20 16:05:17 +00:00
const items3 = [callback2(View, obj4), ];
2026-07-29 08:29:29 +00:00
const obj7 = { variant: "secondary", text: null, onPress: null };
const intl6 = tmp2(tmp3[3]).intl;
obj7[1] = intl6.string(tmp2(tmp3[3]).t["ztO+l+"]);
obj7[2] = function onPress() {
2026-07-23 10:11:24 +00:00
preset.updatePreset(preset(num[4]).Presets.MENTIONS);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
items3[1] = tmp4(tmp2(tmp3[12]).Button, obj7);
obj3[1] = items3;
let tmp4Result = callback2(View, obj3);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const obj8 = { variant: "experimental_Large", state: null };
obj8[1] = segmentedControlState;
tmp4Result = tmp4(tmp2(tmp3[13]).SegmentedControl, obj8);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp4Result;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
({ jsx: c4, jsxs: c5 } = jsxProd);
createCacheKey = { customContainer: null };
2026-08-24 06:08:38 +00:00
createCacheKey = { padding: 16, minHeight: 82, display: "flex", flexDirection: "row", alignItems: "center", justifyContent: "center", borderRadius: ThemesDefault.radii.lg + 8, backgroundColor: ThemesDefault.colors.REDESIGN_INPUT_CONTROL_ACTIVE_BG };
2026-07-29 08:29:29 +00:00
createCacheKey[0] = createCacheKey;
2026-08-24 06:08:38 +00:00
let closure_6 = createCacheKey.createStyles(createCacheKey);
const result = require("set").fileFinishedImporting("modules/notifications/settings/native/NotificationSettingsPresets.tsx");
2026-07-20 16:05:17 +00:00
export const NotificationSettingsGuildPresets = function NotificationSettingsGuildPresets(guildId) {
2026-07-23 10:11:24 +00:00
const _require = guildId;
2026-08-24 06:08:38 +00:00
const obj = {
2026-08-25 06:04:03 +00:00
preset: _require(9987).useGuildPresetSettings(guildId.guildId).preset,
2026-08-24 06:08:38 +00:00
updatePreset(arg0) {
return guildId(closure_1_1[14]).updateGuildPreset(guildId.guildId, arg0);
}
2026-07-20 16:05:17 +00:00
};
return callback(NotificationSettingsPresets, obj);
};
export const NotificationSettingsChannelPresets = function NotificationSettingsChannelPresets(channel) {
2026-07-23 10:11:24 +00:00
const _require = channel;
2026-08-24 06:08:38 +00:00
const obj = {
2026-08-25 06:04:03 +00:00
preset: _require(9981).useChannelPresetSettings(channel.channel).preset,
2026-08-24 06:08:38 +00:00
updatePreset(arg0) {
return channel(closure_1_1[15]).updateChannelPreset(channel.channel.guild_id, channel.channel.id, arg0);
}
2026-07-20 16:05:17 +00:00
};
return callback(NotificationSettingsPresets, obj);
};