189 lines
12 KiB
TypeScript
189 lines
12 KiB
TypeScript
/* Metro module 14772; source: modules/notification_center/native/NotificationCenterPermissionNudge.tsx; dependencies: [57, 31, 27, 661, 1376, 11873, 33, 4501, 697, 683, 10629, 4573, 1244, 4578, 11874, 5278, 5312, 14773, 7013, 1365, 2] */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import AnalyticsUtils from '../../../utils/AnalyticsUtils.tsx'; /* Metro dependency 683 */
|
|
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
|
|
import NotificationCenterPermissionNudgeExperiment from './NotificationCenterPermissionNudgeExperiment.tsx'; /* Metro dependency 14773 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as DismissibleContentConstantsModule from '../../dismissible_content/DismissibleContentConstants.tsx'; /* Metro dependency 1376 */
|
|
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as ButtonNativeModule from '../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
|
|
import * as PressablesModule from '../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */
|
|
import * as XSmallIconModule from '../../../design/components/Icon/native/redesign/generated/XSmallIcon.tsx'; /* Metro dependency 5312 */
|
|
import * as UseSelectedDismissibleContentModule from '../../dismissible_content/hooks/useSelectedDismissibleContent.tsx'; /* Metro dependency 7013 */
|
|
import * as BellSlashIconModule from '../../../design/components/Icon/native/redesign/generated/BellSlashIcon.tsx'; /* Metro dependency 10629 */
|
|
import * as NotificationPermissionUtilModule from '../../nuf/native/NotificationPermissionUtil.tsx'; /* Metro dependency 11874 */
|
|
|
|
function _fun111501(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#111501, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14969:6, offset: 0x023a4b4f, size: 597 bytes, params: 8, frame: 24
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
const env0_4 = value.useCallback;
|
|
const env0_5 = value.useEffect;
|
|
value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_7 = value.AnalyticEvents;
|
|
const env0_8 = value.NOOP;
|
|
value = require(11873) /* metro dependency 11873: NotificationPermissionConstants */;
|
|
const env0_10 = value.EventActionType;
|
|
const env0_11 = value.EventActionLocation;
|
|
const env0_12 = value.NotificationNudgeAnalyticsAction;
|
|
const env0_13 = value.NotificationNudgeSurface;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_14 = value.jsx;
|
|
const env0_15 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object = {};
|
|
const object2 = {'flexDirection': 'row', 'paddingLeft': 24, 'paddingRight': null, 'paddingVertical': null,
|
|
'backgroundColor': null, 'alignItems': 'flex-start', 'borderBottomWidth': 1};
|
|
let PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object2.paddingRight = PX_12;
|
|
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object2.paddingVertical = PX_16;
|
|
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
|
|
object2.backgroundColor = BACKGROUND_BASE_LOW;
|
|
const BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
|
|
object2.borderColor = BORDER_SUBTLE;
|
|
object2.gap = 16;
|
|
object.container = object2;
|
|
object.contentContainer = {flex: 1};
|
|
const object4 = {'width': 48, 'height': 48, 'borderRadius': null, 'backgroundColor': null, 'alignItems': 'center',
|
|
'justifyContent': 'center'};
|
|
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
|
|
const BACKGROUND_MOD_STRONG = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_STRONG;
|
|
object4.backgroundColor = BACKGROUND_MOD_STRONG;
|
|
object.iconContainer = object4;
|
|
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object.ctaButton = {alignSelf: 'flex-start', marginTop: PX_12};
|
|
const env0_16 = Reflect.apply(createStyles, value, [object]);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/notification_center/native/NotificationCenterPermissionNudge.tsx');
|
|
exports.default = NotificationCenterPermissionNudge;
|
|
function NotificationCenterBannerImpl({onDismiss}) { // fn#111502, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14969:922, offset: 0x023a4da4, size: 740 bytes, params: 2, frame: 32
|
|
const styles = useStyles();
|
|
useEffect(function() {
|
|
var defaultImport = importDefault(dependencyMap[9]);
|
|
var CONTEXTUAL_REMINDER_ACTION = AnalyticEvents.CONTEXTUAL_REMINDER_ACTION;
|
|
defaultImport.track(CONTEXTUAL_REMINDER_ACTION, {action: NotificationNudgeAnalyticsAction.IMPRESSION,
|
|
prompt_type: NotificationNudgeSurface.NOTIFICATION_CENTER_BANNER});
|
|
}, []);
|
|
const BellSlashIcon = (BellSlashIconModule).BellSlashIcon;
|
|
const ICON_STRONG = (Native).colors.ICON_STRONG;
|
|
const items3 = [
|
|
<View style={styles.iconContainer}>
|
|
<BellSlashIcon size="md" color={ICON_STRONG} />
|
|
</View>,
|
|
];
|
|
const Text = (TextModule).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
let string = intl.string;
|
|
const G6YBna = (require(1244) /* metro dependency 1244: indexNative */).t.G6YBna;
|
|
const items2 = [
|
|
<Text variant="text-md/semibold" color="text-default">
|
|
{Reflect.apply(string, intl, [G6YBna])}
|
|
</Text>,
|
|
];
|
|
const PX_4 = (Native).space.PX_4;
|
|
items2[1] = (
|
|
<Text
|
|
variant="text-md/medium"
|
|
color="text-muted"
|
|
style={{marginTop: PX_4}}
|
|
>
|
|
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['9CoPDE'])}
|
|
</Text>
|
|
);
|
|
const Button = (ButtonNativeModule).Button;
|
|
items2[2] = (
|
|
<View style={styles.ctaButton}>
|
|
<Button
|
|
variant="primary"
|
|
size="md"
|
|
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.a4bgO0)}
|
|
onPress={onPress_111504}
|
|
/>
|
|
</View>
|
|
);
|
|
items3[1] = (
|
|
<View style={styles.contentContainer}>
|
|
{items2}
|
|
</View>
|
|
);
|
|
const PressableHighlight = (PressablesModule).PressableHighlight;
|
|
string = intl.string;
|
|
const WAI6xu = (require(1244) /* metro dependency 1244: indexNative */).t.WAI6xu;
|
|
const XSmallIcon = (XSmallIconModule).XSmallIcon;
|
|
items3[2] = (
|
|
<PressableHighlight
|
|
onPress={function() {
|
|
var defaultImport = importDefault(dependencyMap[9]);
|
|
var CONTEXTUAL_REMINDER_ACTION = AnalyticEvents.CONTEXTUAL_REMINDER_ACTION;
|
|
defaultImport.track(CONTEXTUAL_REMINDER_ACTION, {action: NotificationNudgeAnalyticsAction.DISMISS,
|
|
prompt_type: NotificationNudgeSurface.NOTIFICATION_CENTER_BANNER});
|
|
onDismiss();
|
|
}}
|
|
hitSlop={8}
|
|
accessibilityRole="button"
|
|
accessibilityLabel={Reflect.apply(string, intl, [WAI6xu])}
|
|
>
|
|
<XSmallIcon size="sm" color="icon-strong" />
|
|
</PressableHighlight>
|
|
);
|
|
return (
|
|
<View style={styles.container}>
|
|
{items3}
|
|
</View>
|
|
);
|
|
function NotificationCenterBannerImplOnPress() { // fn#111504, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14969:1695, owner: NotificationCenterBannerImpl.onPress, offset: 0x023a50d7, size: 132 bytes, params: 1, frame: 18
|
|
const requestPushNotificationPermission = NotificationPermissionUtilModule.requestPushNotificationPermission;
|
|
const ALLOW_TO_REQUEST = EventActionType.ALLOW_TO_REQUEST;
|
|
const NOTIFICATION_CENTER = EventActionLocation.NOTIFICATION_CENTER;
|
|
Reflect.apply(requestPushNotificationPermission, NotificationPermissionUtilModule, [ALLOW_TO_REQUEST,
|
|
NOTIFICATION_CENTER, NOOP]);
|
|
const defaultImport = AnalyticsUtils;
|
|
const track = defaultImport.track;
|
|
const CONTEXTUAL_REMINDER_ACTION = AnalyticEvents.CONTEXTUAL_REMINDER_ACTION;
|
|
const ACCEPT = NotificationNudgeAnalyticsAction.ACCEPT;
|
|
const NOTIFICATION_CENTER_BANNER = NotificationNudgeSurface.NOTIFICATION_CENTER_BANNER;
|
|
Reflect.apply(track, defaultImport, [CONTEXTUAL_REMINDER_ACTION, {action: ACCEPT,
|
|
prompt_type: NOTIFICATION_CENTER_BANNER}]);
|
|
}
|
|
|
|
}
|
|
|
|
function NotificationCenterPermissionNudge() { // fn#111506, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14969:2333, offset: 0x023a51b5, size: 276 bytes, params: 1, frame: 19
|
|
const defaultImport = NotificationCenterPermissionNudgeExperiment;
|
|
const useConfig = defaultImport.useConfig;
|
|
const enabled = Reflect.apply(useConfig, defaultImport, [{location: 'NotificationCenterPermissionNudge'}]).enabled;
|
|
const value2 = (NotificationPermissionUtilModule).useCanSeePushNotificationNudge();
|
|
const useSelectedTimeRecurringDismissibleContent = UseSelectedDismissibleContentModule.useSelectedTimeRecurringDismissibleContent;
|
|
const value3 = null;
|
|
let NOTIFICATION_NUDGE_NOTIFICATION_CENTER_BANNER = enabled && value2 ? (require(1365) /* metro dependency 1365: dismissible_content */).DismissibleContent.NOTIFICATION_NUDGE_NOTIFICATION_CENTER_BANNER : value3;
|
|
const value5 = Module00057(Reflect.apply(useSelectedTimeRecurringDismissibleContent, UseSelectedDismissibleContentModule,
|
|
[NOTIFICATION_NUDGE_NOTIFICATION_CENTER_BANNER, {cooldownDurationMs: 604800000}]), 2);
|
|
const property = value5[0];
|
|
const value6 = useCallback(_fun111507, [value5[1]]);
|
|
const DismissibleContent = (require(1365) /* metro dependency 1365: dismissible_content */).DismissibleContent;
|
|
NOTIFICATION_NUDGE_NOTIFICATION_CENTER_BANNER = DismissibleContent.NOTIFICATION_NUDGE_NOTIFICATION_CENTER_BANNER;
|
|
return (
|
|
property !== NOTIFICATION_NUDGE_NOTIFICATION_CENTER_BANNER
|
|
? value3
|
|
: (
|
|
<NotificationCenterBannerImpl onDismiss={value6} />
|
|
)
|
|
);
|
|
function _fun111507() { // fn#111507, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14969:2698, offset: 0x023a52c9, size: 29 bytes, params: 1, frame: 11
|
|
const binding = env0_0;
|
|
const USER_DISMISS = ContentDismissActionType.USER_DISMISS;
|
|
return binding(USER_DISMISS);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun111501, 14772, [57, 31, 27, 661, 1376, 11873, 33, 4501, 697, 683, 10629, 4573, 1244, 4578, 11874,
|
|
5278, 5312, 14773, 7013, 1365,
|
|
2]) /* metro module 14772, dependencies: [57, 31, 27, 661, 1376, 11873, 33, 4501, 697, 683, 10629, 4573, 1244, 4578, 11874, 5278, 5312, 14773, 7013, 1365, 2] */;
|