192 lines
9.5 KiB
TypeScript
192 lines
9.5 KiB
TypeScript
/* Metro module 12644; source: modules/build_overrides/native/BuildOverrideModal.tsx; dependencies: [31, 27, 10557, 33, 4501, 697, 4048, 4002, 12645, 12646, 566, 10558, 3738, 6618, 4573, 1244, 4578, 5080, 2] */
|
|
import defaultImport3 from '../../../by-id/module-03738.js'; /* Metro dependency 3738 */
|
|
import ModalActionCreators from '../../../actions/ModalActionCreators.tsx'; /* Metro dependency 5080 */
|
|
import BuildOverrideStore from '../BuildOverrideStore.tsx'; /* Metro dependency 10557 */
|
|
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 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 SafeAreaViewModule from '../../../components_native/common/SafeAreaView.tsx'; /* Metro dependency 6618 */
|
|
|
|
function _fun96962(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#96962, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12834:6, offset: 0x0216e017, size: 452 bytes, params: 8, frame: 22
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
ReactModule;
|
|
let value = ReactNativeModule;
|
|
const env0_3 = value.Image;
|
|
const env0_4 = value.View;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_6 = value.jsx;
|
|
const env0_7 = value.Fragment;
|
|
const env0_8 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object = {};
|
|
const BACKGROUND_BASE_LOWER = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWER;
|
|
object.container = {'flex': 1, 'height': '100%', 'alignItems': 'center', 'backgroundColor': null,
|
|
'paddingHorizontal': 16, backgroundColor: BACKGROUND_BASE_LOWER};
|
|
object.content = {'marginTop': 160, 'flex': 1, 'alignItems': 'center'};
|
|
const object3 = {'width': 100, 'height': 100, 'borderRadius': null, 'marginBottom': 16, 'backgroundColor': null,
|
|
'alignItems': 'center', 'justifyContent': 'center'};
|
|
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
|
|
const BACKGROUND_BASE_LOWEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWEST;
|
|
object3.backgroundColor = BACKGROUND_BASE_LOWEST;
|
|
object.imageWrapper = object3;
|
|
object.text = {'lineHeight': 24, 'textAlign': 'center'};
|
|
object.buildOverrideName = {marginTop: 8};
|
|
object.buildOverrideExpiration = {lineHeight: 24};
|
|
object.buildOverrideInvalid = {marginTop: 8};
|
|
object.buttonWrapper = {alignSelf: 'stretch'};
|
|
object.actionButton = {marginBottom: 8};
|
|
const env0_9 = Reflect.apply(createStyles, value, [object]);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/build_overrides/native/BuildOverrideModal.tsx');
|
|
exports.default = BuildOverrideModal;
|
|
function BuildOverrideModal({overrideUrl}) { // fn#96963, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12834:881, offset: 0x0216e1db, size: 1316 bytes, params: 2, frame: 37
|
|
var r7;
|
|
var r8;
|
|
var jsxRuntimeEnv0_7Binding;
|
|
var items3;
|
|
const Button = (ButtonNativeModule).Button;
|
|
var items5;
|
|
overrideUrl = overrideUrl === undefined ? '' : overrideUrl;
|
|
const styles = useStyles();
|
|
const r14 = (require(4002) /* metro dependency 4002: shared */).isThemeDark((importDefault(4048) /* metro dependency 4048: useTheme */)()) ? importDefault(12645) /* metro dependency 12645 */ : importDefault(12646) /* metro dependency 12646 */;
|
|
const override = (require(566) /* metro dependency 566: flux */).useStateFromStores([BuildOverrideStore],
|
|
function() {
|
|
return BuildOverrideStore.getBuildOverride(overrideUrl);
|
|
}, [overrideUrl]).override;
|
|
const id = override == null || override.targetBuildOverride == null ? undefined : override.targetBuildOverride[(require(10558) /* metro dependency 10558: BuildOverrideUtils */).DEVICE_FIELD]?.id;
|
|
const duration = defaultImport3.duration;
|
|
const value6 = defaultImport3();
|
|
const value8 = Reflect.apply(duration, defaultImport3, [value6.diff(override?.expiresAt)]).humanize();
|
|
const SafeAreaPaddingView = (SafeAreaViewModule).SafeAreaPaddingView;
|
|
const items2 = [
|
|
<View style={styles.imageWrapper}>
|
|
<Image source={r14} />
|
|
</View>,
|
|
];
|
|
const Text = (TextModule).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
let string = intl.string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
items2[1] = (
|
|
<Text style={styles.text} variant="text-md/medium">
|
|
{Reflect.apply(string, intl, [t['6ILkNN']])}
|
|
</Text>
|
|
);
|
|
if (id != null) {
|
|
jsxRuntimeEnv0_7Binding = jsxRuntimeEnv0_7;
|
|
items3 = [
|
|
<Text
|
|
style={styles.buildOverrideName}
|
|
variant="heading-xl/extrabold"
|
|
color="mobile-text-heading-primary"
|
|
>
|
|
{id}
|
|
</Text>,
|
|
];
|
|
items3[1] = (
|
|
<Text
|
|
style={styles.buildOverrideExpiration}
|
|
variant="text-md/medium"
|
|
color="text-default"
|
|
>
|
|
{intl.format((require(1244) /* metro dependency 1244: indexNative */).t.lOsPpu,
|
|
{expirationDuration: value8})}
|
|
</Text>
|
|
);
|
|
r7 = (
|
|
<>
|
|
{items3}
|
|
</>
|
|
);
|
|
} else {
|
|
r7 = (
|
|
<Text
|
|
style={styles.buildOverrideInvalid}
|
|
variant="heading-xl/extrabold"
|
|
color="mobile-text-heading-primary"
|
|
>
|
|
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['cz+sue'])}
|
|
</Text>
|
|
);
|
|
}
|
|
items2[2] = r7;
|
|
const view = (
|
|
<View style={styles.content}>
|
|
{items2}
|
|
</View>
|
|
);
|
|
if (id != null) {
|
|
jsxRuntimeEnv0_7Binding = jsxRuntimeEnv0_7;
|
|
string = intl.string;
|
|
items5 = [
|
|
<View style={styles.actionButton}>
|
|
<Button
|
|
text={Reflect.apply(string, intl, [t.v0MBqF])}
|
|
grow
|
|
onPress={onPress_96965}
|
|
/>
|
|
</View>,
|
|
];
|
|
string = intl.string;
|
|
items5[1] = (
|
|
<Button
|
|
text={Reflect.apply(string, intl, [t.b5KKph])}
|
|
variant="secondary"
|
|
grow
|
|
onPress={onPress_96966}
|
|
/>
|
|
);
|
|
r8 = (
|
|
<>
|
|
{items5}
|
|
</>
|
|
);
|
|
} else {
|
|
r8 = (
|
|
<Button
|
|
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.WRkdCQ)}
|
|
grow
|
|
onPress={onPress_96967}
|
|
/>
|
|
);
|
|
}
|
|
return (
|
|
<SafeAreaPaddingView
|
|
top
|
|
bottom
|
|
style={styles.container}
|
|
>
|
|
{view}
|
|
<View style={styles.buttonWrapper}>
|
|
{r8}
|
|
</View>
|
|
</SafeAreaPaddingView>
|
|
);
|
|
function BuildOverrideModalOnPress() { // fn#96965, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12834:2180, owner: BuildOverrideModal.onPress, offset: 0x0216e71a, size: 67 bytes, params: 1, frame: 14
|
|
let value = environment.__proto__;
|
|
value = require(10558) /* metro dependency 10558: BuildOverrideUtils */;
|
|
value.setBuildOverrideFromLink(env0_1.validatedURL ?? '');
|
|
}
|
|
|
|
function BuildOverrideModalOnPress_96966() { // fn#96966, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12834:2361, owner: BuildOverrideModal.onPress, offset: 0x0216e75d, size: 37 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return (ModalActionCreators).pop();
|
|
}
|
|
|
|
function BuildOverrideModalOnPress_96967() { // fn#96967, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12834:2465, owner: BuildOverrideModal.onPress, offset: 0x0216e75d, size: 37 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return (ModalActionCreators).pop();
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun96962, 12644, [31, 27, 10557, 33, 4501, 697, 4048, 4002, 12645, 12646, 566, 10558, 3738, 6618, 4573,
|
|
1244, 4578, 5080,
|
|
2]) /* metro module 12644, dependencies: [31, 27, 10557, 33, 4501, 697, 4048, 4002, 12645, 12646, 566, 10558, 3738, 6618, 4573, 1244, 4578, 5080, 2] */;
|