This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,48 @@
// Metro module 16312 (f16313).
import SavedMessagesStore from "../SavedMessagesStore";
import ForLaterExperiment from "../ForLaterExperiment";
import Dispatcher from "../../../Dispatcher";
import Durations from "../../../utils/Durations";
import AutomaticLifecycleManager from "../../../lib/AutomaticLifecycleManager";
let c11730_3;
const scheduleNextNotification = function scheduleNextNotification() {
if (ForLaterExperiment.getConfig({
location: "MessageRemindersNotificationManager"
}).enabled) {
if (c11730_3 != null) {
clearTimeout(c11730_3);
}
const savedMessage = SavedMessagesStore.getMessageReminders().find((item) => item.saveData.dueAt != null && item.saveData.dueAt > new Date());
if ((savedMessage == null ? void 0 : savedMessage.saveData?.dueAt) != null) {
const r35 = Date.now() + Durations.Millis.WEEK;
if (!(savedMessage.saveData.dueAt.getTime() > r35)) {
c11730_3 = setTimeout(() => {
if (ForLaterExperiment.getConfig({
location: "MessageRemindersNotificationManager"
}).enabled) {
Dispatcher.dispatch({
type: "MESSAGE_REMINDER_DUE",
savedMessage
});
scheduleNextNotification();
}
}, savedMessage.saveData.dueAt.getTime() - Date.now());
}
} else {
c11730_3 = null;
}
}
};
c11730_3 = null;
class MessageRemindersNotificationManager extends AutomaticLifecycleManager {
actions = {
SAVED_MESSAGES_UPDATE: () => this.handleUpdates(),
SAVED_MESSAGE_CREATE: () => this.handleUpdates(),
SAVED_MESSAGE_DELETE: () => this.handleUpdates()
};
handleUpdates = () => {
scheduleNextNotification();
};
}
const messageRemindersNotificationManager = new MessageRemindersNotificationManager();
export default messageRemindersNotificationManager;
@@ -0,0 +1,38 @@
// Metro module 9946 (f9947).
import Module3771 from "../../../_bundle/Module3771";
import { intl, t } from "../../../intl/index.native";
const r15 = [{
getDueAt: () => Module3771().add(30, "minutes").toDate(),
getLabel: () => intl.string(t["OV8l/H"])
}, {
getDueAt: () => Module3771().add(1, "hour").toDate(),
getLabel: () => intl.string(t["zf0R+0"])
}, {
getDueAt: () => Module3771().add(4, "hour").toDate(),
getLabel: () => intl.string(t["5gztZN"])
}, {
getDueAt: () => {
const r13 = Module3771().startOf("day").add(9, "hours");
return Module3771().hour() >= 9 ? r13.add(1, "day").toDate() : r13.toDate();
},
getLabel: () => Module3771().hour() >= 9 ? intl.string(t["7MKr2P"]) : intl.string(t.FnFI3m)
}, {
getDueAt: () => {
let r13;
L4: {
const r12 = Module3771().day();
if (r12 !== 0) {
r13 = 8;
if (r12 !== 1) {
break L4;
}
r13 = Module3771().startOf("day").add(9, "hours").isAfter(Module3771()) ? 1 : 8;
} else {
r13 = 1;
}
}
return Module3771().day(r13).startOf("day").add(9, "hours").toDate();
},
getLabel: () => intl.string(t["q+Ls05"])
}];
export { r15 as MESSAGE_REMINDER_DURATION_ITEMS };
@@ -0,0 +1,72 @@
// Metro module 9945 (f9946).
import { useState, useEffect, useMemo } from "react";
import SavedMessagesStore from "../../SavedMessagesStore";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { useStateFromStores } from "../../../../_bundle/Module589";
import Durations from "../../../../utils/Durations";
import { useDueInString, DueInStringTypes } from "../../SavedMessageUtils";
import { BottomSheetTitleHeader } from "../../../../design/components/Sheet/native/BottomSheetTitleHeader.native";
import { intl, t } from "../../../../intl/index.native";
import { PressableOpacity } from "../../../../design/void/Pressables/native/Pressables";
import { ArrowLargeLeftIcon } from "../../../../design/components/Icon/native/redesign/generated/ArrowLargeLeftIcon";
import { MESSAGE_REMINDER_DURATION_ITEMS } from "../MessageRemindersTypes";
import { TableRow } from "../../../../design/components/TableRow/native/TableRow.native";
import ActionSheetActionCreators from "../../../action_sheet/native/ActionSheetActionCreators";
import ModalActionCreators from "../../../../actions/ModalActionCreators";
import { BottomSheet } from "../../../../design/components/Sheet/native/BottomSheet.native";
import { TableRowGroup } from "../../../../design/components/TableRow/native/TableRowGroup.native";
import { CheckmarkLargeIcon } from "../../../../design/components/Icon/native/redesign/generated/CheckmarkLargeIcon";
const useStyles = createStyles({
body: {
paddingHorizontal: Module712.space.PX_16,
gap: Module712.space.PX_24
}
});
export default function MessageReminderDurationActionSheet(props) {
let setState, dueInText;
const { createReminder, removeReminder, channelId, messageId, onBack } = props;
setState = void 0;
dueInText = void 0;
const styles = useStyles();
const stateFromStores = useStateFromStores([SavedMessagesStore], () => SavedMessagesStore.getSavedMessage(channelId, messageId));
let now;
[now, setState] = useState(new Date());
useEffect(() => {
let c26573_0 = setInterval(() => setState(new Date()), Durations.Millis.MINUTE);
return () => {
clearInterval(c26573_0);
};
}, []);
dueInText = useDueInString({
dueAt: stateFromStores == null ? void 0 : stateFromStores.saveData.dueAt,
now,
type: DueInStringTypes.SHORT
}).dueInText;
return <BottomSheet header={useMemo(() => <BottomSheetTitleHeader title={intl.string(t.roMu1H)} subtitle={dueInText} leading={onBack != null && <PressableOpacity accessibilityRole="button" accessibilityLabel={intl.string(t["13/7kX"])} onPress={onBack}>
<ArrowLargeLeftIcon size="md" />
</PressableOpacity>} />, [onBack, dueInText])} bodyStyles={styles.body} startExpanded>
<TableRowGroup hasIcons={false}>
{useMemo(() => {
const r13 = MESSAGE_REMINDER_DURATION_ITEMS.map(({ getDueAt, getLabel }) => <TableRow key={`create-reminder-${getLabel()}`} label={getLabel()} onPress={() => {
createReminder(getDueAt());
ActionSheetActionCreators.hideActionSheet();
}} />);
r13.push(<TableRow key="create-reminder-custom" label={intl.string(t.OLA8Zi)} onPress={() => {
ActionSheetActionCreators.hideActionSheet();
ModalActionCreators.pushLazy(import("./MessageRemindersCustomDurationModal"), {
onClose: ModalActionCreators.pop(),
createReminder
}, "create-reminder-custom", {
presentation: "modal"
});
}} arrow />);
return r13;
}, [createReminder])}
</TableRowGroup>
{removeReminder != null && <TableRow key="remove-reminder" icon={<CheckmarkLargeIcon />} label={intl.string(t.yjGtdJ)} onPress={() => {
ActionSheetActionCreators.hideActionSheet();
removeReminder();
}} start end />}
</BottomSheet>;
};
@@ -0,0 +1,100 @@
// Metro module 9947 (f9948).
import { memo, useState, useCallback } from "react";
import { View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import Module3771 from "../../../../_bundle/Module3771";
import { dismissGlobalKeyboard } from "../../../../utils/native/KeyboardManagerUtils";
import { intl, t } from "../../../../intl/index.native";
import ActionSheetActionCreators from "../../../action_sheet/native/ActionSheetActionCreators";
import { Header } from "../../../../_bundle/Module5150";
import { GenericHeaderTitle } from "../../../main_tabs_v2/native/shared_components/HeaderShared";
import { isIOS } from "../../../../utils/PlatformUtils";
import { getHeaderCloseButton } from "../../../../design/components/Navigator/native/NavigatorHeader.native";
import { PressableOpacity } from "../../../../design/void/Pressables/native/Pressables";
import { Text } from "../../../../design/components/Text/native/Text";
const useStyles = createStyles({
modal: {
flex: 1,
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWER
},
headerContainer: {
paddingHorizontal: Module712.space.PX_16,
paddingTop: Module712.space.PX_8
},
container: {
paddingHorizontal: 16,
paddingTop: 24,
gap: 24
},
formHeader: {
marginBottom: 8
},
inputContainer: {
paddingHorizontal: 16,
paddingVertical: 12,
borderRadius: Module712.radii.lg,
backgroundColor: Module712.colors.INPUT_BACKGROUND_DEFAULT
}
});
const r56 = memo(function({ onClose, createReminder }) {
let state, setState, callback;
state = void 0;
setState = void 0;
callback = void 0;
const handleOpenDatePicker2 = function handleOpenDatePicker(a0) {
dismissGlobalKeyboard();
const title = a0 === "date" ? intl.string(t.pSZKvM) : intl.string(t.GOmEb8);
ActionSheetActionCreators.openLazy(import("../../../../components_native/DatePickerActionSheet"), "DatePicker", {
title,
startDate: state.toDate(),
minimumDate: Module3771().toDate(),
mode: a0,
onSubmit: setState
});
};
const styles = useStyles();
[state, setState] = useState(() => Module3771());
callback = useCallback(() => {
createReminder(state.toDate());
onClose();
}, [createReminder, state, onClose]);
const text2 = state.format("MMM Do YYYY");
const text = state.format("LT");
return <View style={styles.modal}>
<View style={styles.headerContainer}>
<Header title={intl.string(t.VKsXpY)} headerTitle={() => <GenericHeaderTitle title={intl.string(t.VKsXpY)} />} headerTitleAlign="center" headerStatusBarHeight={isIOS() ? 0 : void 0} headerLeft={getHeaderCloseButton(onClose)} headerRight={() => <PressableOpacity accessibilityRole="button" onPress={callback}>
<Text variant="text-md/semibold" color="control-brand-foreground">
{intl.string(t["R3BPH+"])}
</Text>
</PressableOpacity>} />
</View>
<View style={styles.container}>
<View>
<Text style={styles.formHeader} variant="text-sm/semibold" color="text-subtle">
{intl.string(t.pSZKvM)}
</Text>
<PressableOpacity accessibilityRole="button" accessibilityLabel={intl.string(t.pSZKvM)} accessibilityValue={{
text: text2
}} onPress={() => {
handleOpenDatePicker2("date");
}} style={styles.inputContainer}>
<Text variant="text-md/medium">{text2}</Text>
</PressableOpacity>
</View>
<View>
<Text style={styles.formHeader} variant="text-sm/semibold" color="text-subtle">
{intl.string(t.GOmEb8)}
</Text>
<PressableOpacity accessibilityRole="button" accessibilityLabel={intl.string(t.pSZKvM)} accessibilityValue={{
text
}} onPress={() => {
handleOpenDatePicker2("time");
}} style={styles.inputContainer}>
<Text variant="text-md/medium">{text}</Text>
</PressableOpacity>
</View>
</View>
</View>;
});
export default r56;