115 lines
7.0 KiB
TypeScript
115 lines
7.0 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] */
|
|
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
|
|
var object2;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
importAll(31) /* metro dependency 31 */;
|
|
let value = require(27) /* metro dependency 27 */;
|
|
const env0_3 = value.Image;
|
|
const env0_4 = value.View;
|
|
const buildOverrideStore = importDefault(10557) /* metro dependency 10557: BuildOverrideStore */;
|
|
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;
|
|
object2 = {};
|
|
const BACKGROUND_BASE_LOWER = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWER;
|
|
object2.container = {'flex': 1, 'height': '100%', 'alignItems': 'center', 'backgroundColor': null,
|
|
'paddingHorizontal': 16, backgroundColor: BACKGROUND_BASE_LOWER};
|
|
object2.content = {'marginTop': 160, 'flex': 1, 'alignItems': 'center'};
|
|
const object4 = {'width': 100, 'height': 100, 'borderRadius': null, 'marginBottom': 16, 'backgroundColor': null,
|
|
'alignItems': 'center', 'justifyContent': 'center'};
|
|
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
|
|
const BACKGROUND_BASE_LOWEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWEST;
|
|
object4.backgroundColor = BACKGROUND_BASE_LOWEST;
|
|
object2.imageWrapper = object4;
|
|
object2.text = {'lineHeight': 24, 'textAlign': 'center'};
|
|
object2.buildOverrideName = {marginTop: 8};
|
|
object2.buildOverrideExpiration = {lineHeight: 24};
|
|
object2.buildOverrideInvalid = {marginTop: 8};
|
|
object2.buttonWrapper = {alignSelf: 'stretch'};
|
|
object2.actionButton = {marginBottom: 8};
|
|
const env0_9 = Reflect.apply(createStyles, value, [object2]);
|
|
(require(2) /* metro dependency 2 */).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 = (require(4578) /* metro dependency 4578: ButtonNative */).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 defaultImport3 = importDefault(3738) /* metro dependency 3738 */;
|
|
const duration = defaultImport3.duration;
|
|
const value6 = defaultImport3();
|
|
const value8 = Reflect.apply(duration, defaultImport3, [value6.diff(override?.expiresAt)]).humanize();
|
|
const SafeAreaPaddingView = (require(6618) /* metro dependency 6618: SafeAreaView */).SafeAreaPaddingView;
|
|
const items2 = [<View style={styles.imageWrapper}><Image source={r14} /></View>];
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).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 (importDefault(5080) /* metro dependency 5080: ModalActionCreators */).pop();
|
|
}
|
|
|