254 lines
14 KiB
TypeScript
254 lines
14 KiB
TypeScript
/* Metro module 13376; source: modules/activity_privacy/native/BaseUpsellActionSheet.tsx; dependencies: [31, 27, 1867, 33, 4073, 697, 4501, 566, 6819, 13374, 1244, 4573, 8863, 11835, 4080, 3857, 6275, 4578, 2] */
|
|
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
|
|
import GuildStore from '../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
|
|
import ActionSheetActionCreators from '../../action_sheet/native/ActionSheetActionCreators.tsx'; /* Metro dependency 4080 */
|
|
import GuildIcon from '../../guild/native/GuildIcon.tsx'; /* Metro dependency 6819 */
|
|
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 FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as CircleCheckIconModule from '../../../design/components/Icon/native/redesign/generated/CircleCheckIcon.tsx'; /* Metro dependency 4073 */
|
|
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 BottomSheetNativeModule from '../../../design/components/Sheet/native/BottomSheet.native.tsx'; /* Metro dependency 6275 */
|
|
import * as GuildIconModule from '../../guild/native/GuildIcon.tsx'; /* Metro dependency 6819 */
|
|
import * as GuildIconPileNativeModule from '../../../design/components/Pile/native/GuildIconPile.native.tsx'; /* Metro dependency 8863 */
|
|
import * as ActivityPrivacyUpsellUtilsModule from '../ActivityPrivacyUpsellUtils.tsx'; /* Metro dependency 13374 */
|
|
|
|
function _fun101848(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#101848, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13566:6, offset: 0x0222155c, size: 658 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactNativeModule;
|
|
const env0_4 = value.Pressable;
|
|
const env0_5 = value.View;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_7 = value.jsx;
|
|
const env0_8 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object = {};
|
|
const object2 = {};
|
|
let PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
|
|
object2.paddingVertical = PX_24;
|
|
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
|
|
object2.paddingHorizontal = PX_24;
|
|
object.container = object2;
|
|
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object.title = {marginBottom: PX_8};
|
|
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
|
|
object.description = {marginBottom: PX_24};
|
|
const object5 = {};
|
|
const BACKGROUND_MOD_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_SUBTLE;
|
|
object5.backgroundColor = BACKGROUND_MOD_SUBTLE;
|
|
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md;
|
|
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object5.padding = PX_16;
|
|
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
|
|
object5.marginBottom = PX_24;
|
|
object5.flexDirection = 'row';
|
|
object5.alignItems = 'center';
|
|
object5.justifyContent = 'space-between';
|
|
object.card = object5;
|
|
const PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object.cardInfo = {flex: 1, marginRight: PX_12};
|
|
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object.statusRow = {'flexDirection': 'row', 'alignItems': 'center', 'marginTop': null, 'paddingBottom': 2,
|
|
marginTop: PX_4};
|
|
object.guildSummary = {flexShrink: 1};
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object.chevron = {marginLeft: PX_8};
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object.buttonsContainer = {gap: PX_8};
|
|
const env0_10 = Reflect.apply(createStyles, value, [object]);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/activity_privacy/native/BaseUpsellActionSheet.tsx');
|
|
exports.default = BaseUpsellActionSheet;
|
|
function StoreGuildIcon({guildId}) { // fn#101849, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13566:988, offset: 0x022217ee, size: 128 bytes, params: 2, frame: 18
|
|
const guild = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore], function() {
|
|
return GuildStore.getGuild(guildId);
|
|
});
|
|
const GuildIconSizes = (GuildIconModule).GuildIconSizes;
|
|
const XSMALL = GuildIconSizes.XSMALL;
|
|
return ((Component) => <Component guild={guild} size={XSMALL} />)(GuildIcon);
|
|
}
|
|
|
|
function GuildCard({guildIds, direction, onPress}) { // fn#101851, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13566:1146, offset: 0x0222186e, size: 1103 bytes, params: 2, frame: 42
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const styles = useStyles();
|
|
const value3 = ReactModule.useMemo(_fun101852, [guildIds]);
|
|
const guild = (FluxModule).useStateFromStores([GuildStore], _fun101853);
|
|
const ChangeDirection = (ActivityPrivacyUpsellUtilsModule).ChangeDirection;
|
|
let RESTRICTING = ChangeDirection.RESTRICTING;
|
|
const r23 = direction === RESTRICTING ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.e6Kpa7) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t.cy4G4y);
|
|
const r27 = guild?.name ?? '';
|
|
let r24 = guild != null && value3.length > 1;
|
|
const r14 = value3.length === 4 ? value3 : value3.slice(0, 3);
|
|
const value10 = (FluxModule).useStateFromStoresArray([GuildStore], _fun101854,
|
|
[r14]);
|
|
const r1 = onPress != null ? Pressable : View;
|
|
const Text = (TextModule).Text;
|
|
let format = intl.format;
|
|
const text = (
|
|
<Text variant="text-md/semibold" color="text-strong">
|
|
{Reflect.apply(format, intl, [(require(1244) /* metro dependency 1244: indexNative */).t['0fkj8J'],
|
|
{count: guildIds.length}])}
|
|
</Text>
|
|
);
|
|
RESTRICTING = ChangeDirection.RESTRICTING;
|
|
const text2 = (
|
|
<Text variant="text-sm/medium" color={direction !== RESTRICTING ? 'text-muted' : 'text-feedback-positive'}>
|
|
{r23}
|
|
</Text>
|
|
);
|
|
format = intl.format;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
r24 = r24 ? t['8ZLbvR'] : t['+NoTYm'];
|
|
const items4 = [
|
|
<View style={styles.cardInfo}>
|
|
{text}
|
|
<View style={styles.statusRow}>
|
|
{text2}
|
|
<Text
|
|
variant="text-sm/medium"
|
|
color="text-muted"
|
|
lineClamp={1}
|
|
style={styles.guildSummary}
|
|
>
|
|
{Reflect.apply(format, intl, [r24, {guildName: r27}])}
|
|
</Text>
|
|
</View>
|
|
</View>,
|
|
];
|
|
const GuildIconPile = (GuildIconPileNativeModule).GuildIconPile;
|
|
const GuildIconSizes = (GuildIconModule).GuildIconSizes;
|
|
const XSMALL = GuildIconSizes.XSMALL;
|
|
items4[1] = (
|
|
<GuildIconPile
|
|
size={XSMALL}
|
|
names={value10}
|
|
totalCount={value3.length}
|
|
>
|
|
{r14.map(_fun101856)}
|
|
</GuildIconPile>
|
|
);
|
|
items4[2] = onPress != null && <View style={styles.chevron}>{((ChevronLargeRightIcon) => <ChevronLargeRightIcon color={(importDefault(697) /* metro dependency 697: native */).colors.TEXT_SUBTLE} size="xs" />)((require(11835) /* metro dependency 11835: ChevronLargeRightIcon */).ChevronLargeRightIcon)}</View>;
|
|
return ((Component) => <Component style={styles.card} onPress={onPress}>{items4}</Component>)(r1);
|
|
function _fun101852() { // fn#101852, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13566:1226, offset: 0x02221cbd, size: 45 bytes, params: 1, frame: 11
|
|
let value = environment.__proto__;
|
|
value = require(13374) /* metro dependency 13374: ActivityPrivacyUpsellUtils */;
|
|
return value.sortGuildIdsByFrecency(guildIds);
|
|
}
|
|
|
|
function _fun101853() { // fn#101853, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13566:1304, offset: 0x02221cea, size: 33 bytes, params: 1, frame: 12
|
|
return GuildStore.getGuild(env0_1[0]);
|
|
}
|
|
|
|
function _fun101854() { // fn#101854, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13566:1579, offset: 0x02221d0b, size: 28 bytes, params: 1, frame: 11
|
|
return env0_2.map(_fun101855);
|
|
function _fun101855(a0) { // fn#101855, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13566:1590, offset: 0x02221d27, size: 53 bytes, params: 2, frame: 12
|
|
const value = environment.__proto__.__proto__;
|
|
return GuildStore.getGuild(a0)?.name ?? '';
|
|
}
|
|
|
|
}
|
|
|
|
function _fun101856(a0) { // fn#101856, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13566:2361, offset: 0x02221d5c, size: 31 bytes, params: 2, frame: 15
|
|
return <StoreGuildIcon guildId={a0} key={a0} />;
|
|
}
|
|
|
|
}
|
|
|
|
function renderSuccessIcon() { // fn#101857, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13566:194, offset: 0x02221d7b, size: 109 bytes, params: 1, frame: 17
|
|
const CircleCheckIcon = (CircleCheckIconModule).CircleCheckIcon;
|
|
const STATUS_POSITIVE = (Native).colors.STATUS_POSITIVE;
|
|
const WHITE = (Native).colors.WHITE;
|
|
return (
|
|
<CircleCheckIcon
|
|
size="sm"
|
|
color={STATUS_POSITIVE}
|
|
secondaryColor={WHITE}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function BaseUpsellActionSheet({direction, affectedGuildIds, title, subtitle, confirmText, toastContent, onConfirm, onCardPress}) { // fn#101858, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13566:2625, offset: 0x02221de8, size: 558 bytes, params: 2, frame: 33
|
|
const styles = useStyles();
|
|
const value2 = ReactModule.useCallback(function() {
|
|
onConfirm();
|
|
importDefault(dependencyMap[14]).hideActionSheet();
|
|
importDefault(dependencyMap[15]).open({key: 'ACTIVITY_PRIVACY_UPSELL_TOAST', content: toastContent,
|
|
icon: renderSuccessIcon});
|
|
}, [onConfirm, toastContent]);
|
|
const value3 = ReactModule.useCallback(_fun101860, []);
|
|
const BottomSheet = (BottomSheetNativeModule).BottomSheet;
|
|
const Text = (TextModule).Text;
|
|
const items2 = [
|
|
<Text
|
|
style={styles.title}
|
|
accessibilityRole="header"
|
|
variant="heading-xl/bold"
|
|
color="text-strong"
|
|
>
|
|
{title}
|
|
</Text>,
|
|
];
|
|
items2[1] = (
|
|
<Text
|
|
style={styles.description}
|
|
variant="text-md/medium"
|
|
color="text-default"
|
|
>
|
|
{subtitle}
|
|
</Text>
|
|
);
|
|
items2[2] = (
|
|
<GuildCard
|
|
guildIds={affectedGuildIds}
|
|
direction={direction}
|
|
onPress={onCardPress}
|
|
/>
|
|
);
|
|
const Button = (ButtonNativeModule).Button;
|
|
const button = (
|
|
<Button
|
|
variant="primary"
|
|
size="md"
|
|
text={confirmText}
|
|
onPress={value2}
|
|
/>
|
|
);
|
|
const intl = (IndexNativeModule).intl;
|
|
const string = intl.string;
|
|
const X1rGEm = (IndexNativeModule).t.X1rGEm;
|
|
items2[3] = (
|
|
<View style={styles.buttonsContainer}>
|
|
{button}
|
|
<Button
|
|
variant="secondary"
|
|
size="md"
|
|
text={Reflect.apply(string, intl, [X1rGEm])}
|
|
onPress={value3}
|
|
/>
|
|
</View>
|
|
);
|
|
return (
|
|
<BottomSheet startExpanded>
|
|
<View style={styles.container}>
|
|
{items2}
|
|
</View>
|
|
</BottomSheet>
|
|
);
|
|
function _fun101860() { // fn#101860, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13566:2939, offset: 0x02222079, size: 37 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
(ActionSheetActionCreators).hideActionSheet();
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun101848, 13376, [31, 27, 1867, 33, 4073, 697, 4501, 566, 6819, 13374, 1244, 4573, 8863, 11835, 4080,
|
|
3857, 6275, 4578,
|
|
2]) /* metro module 13376, dependencies: [31, 27, 1867, 33, 4073, 697, 4501, 566, 6819, 13374, 1244, 4573, 8863, 11835, 4080, 3857, 6275, 4578, 2] */;
|