147 lines
8.0 KiB
TypeScript
147 lines
8.0 KiB
TypeScript
/* Metro module 9908; source: modules/feedback/native/FeedbackForm.tsx; dependencies: [57, 31, 9906, 33, 4501, 697, 6266, 22, 9909, 4594, 7972, 4573, 6239, 9910, 1244, 2] */
|
|
function _fun77643(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77643, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10094:6, offset: 0x01e057fa, size: 342 bytes, params: 8, frame: 22
|
|
var object2;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_4 = importAll(31) /* metro dependency 31 */;
|
|
const env0_5 = (require(9906) /* metro dependency 9906: Constants */).FeedbackRating;
|
|
let value = require(33) /* metro dependency 33 */;
|
|
const env0_6 = value.jsx;
|
|
const env0_7 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object2 = {};
|
|
object2.ratingsLabel = {textAlign: 'center'};
|
|
object2.reasonsHeader = {marginBottom: 8};
|
|
object2.reasonsList = {'overflow': 'hidden', 'marginBottom': 12, 'padding': 0};
|
|
const INTERACTIVE_TEXT_ACTIVE = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_TEXT_ACTIVE;
|
|
object2.reason = {color: INTERACTIVE_TEXT_ACTIVE};
|
|
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
|
|
object2.doNotShowAgainContainer = {'paddingHorizontal': 0, 'paddingVertical': 8,
|
|
backgroundColor: BACKGROUND_SURFACE_HIGH};
|
|
const env0_8 = Reflect.apply(createStyles, value, [object2]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/feedback/native/FeedbackForm.tsx');
|
|
exports.FeedbackForm = FeedbackForm;
|
|
}
|
|
|
|
function FeedbackForm({showDoNotShowAgainCheckbox, ratingsBodyLabel, reasonsHeaderLabel, reasons, otherKey, onFeedbackChanged, trackOpen}) { // fn#77644, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10094:584, offset: 0x01e05950, size: 933 bytes, params: 2, frame: 30
|
|
var FormRow;
|
|
var Checkbox;
|
|
var doNotShowAgain;
|
|
var Label;
|
|
var intl;
|
|
const styles = useStyles();
|
|
const env0_4 = styles;
|
|
const value2 = (importDefault(6266) /* metro dependency 6266: usePrevious */)(reasons);
|
|
const binding = env0_4;
|
|
let useState = binding.useState;
|
|
const defaultImport = importDefault(22) /* metro dependency 22 */;
|
|
const value3 = Reflect.apply(useState, binding, [defaultImport.shuffle(reasons)]);
|
|
const binding2 = trackOpen;
|
|
const value4 = binding2(value3, 2);
|
|
const property = value4[0];
|
|
const env0_6 = value4[1];
|
|
binding.useEffect(_fun77645, [reasons, value2, otherKey]);
|
|
useState = binding.useState;
|
|
const value5 = binding2(Reflect.apply(useState, binding, [{}]), 2);
|
|
const property2 = value5[0];
|
|
const env0_8 = value5[1];
|
|
(importDefault(4594) /* metro dependency 4594: useMountEffect */)(function() {
|
|
trackOpen();
|
|
});
|
|
const value6 = binding.useCallback(_fun77647, [property2, onFeedbackChanged]);
|
|
let r5 = property2.rating != null ? property2.rating === FeedbackRating.GOOD ? null : <env0_4.Fragment>{((Text) => <Text style={styles.reasonsHeader} variant="eyebrow" color="text-default">{reasonsHeaderLabel}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)}{((Card) => <Card border="subtle" style={styles.reasonsList}>{property.filter(function(a0) {
|
|
return a0.label;
|
|
}).map(_fun77649)}</Card>)((require(6239) /* metro dependency 6239: CardNative */).Card)}</env0_4.Fragment> : null;
|
|
const Fragment = env0_4.Fragment;
|
|
const items2 = [ratingsBodyLabel != null ? ((Text) => <Text style={styles.ratingsLabel} variant="heading-md/semibold" color="text-default">{ratingsBodyLabel}</Text>)((require(4573) /* metro dependency 4573: Text */).Text) : null];
|
|
items2[1] = ((Component) => <Component selectedRating={property2.rating ?? null} onChangeRating={onChangeRating} />)(importDefault(9910) /* metro dependency 9910: RatingSelector */);
|
|
items2[2] = r5;
|
|
if (showDoNotShowAgainCheckbox) {
|
|
FormRow = (require(7972) /* metro dependency 7972: native */).FormRow;
|
|
var formRowProps = {style: styles.doNotShowAgainContainer};
|
|
Checkbox = (require(7972) /* metro dependency 7972: native */).FormRow.Checkbox;
|
|
doNotShowAgain = property2.doNotShowAgain;
|
|
formRowProps.leading = <Checkbox selected={doNotShowAgain != null && doNotShowAgain} />;
|
|
Label = (require(7972) /* metro dependency 7972: native */).FormRow.Label;
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
formRowProps.label = <Label text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['5E9SB9'])} />;
|
|
formRowProps.onPress = value6;
|
|
r5 = <FormRow {...formRowProps} />;
|
|
} else {
|
|
r5 = null;
|
|
}
|
|
items2[3] = r5;
|
|
return (
|
|
<Fragment>
|
|
{items2}
|
|
</Fragment>
|
|
);
|
|
}
|
|
|
|
function _fun77645() { // fn#77645, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10094:829, offset: 0x01e05cf5, size: 102 bytes, params: 1, frame: 16
|
|
let value = environment.__proto__;
|
|
const defaultImport = importDefault(22) /* metro dependency 22 */;
|
|
const isEqual = defaultImport.isEqual;
|
|
let binding = env0_5;
|
|
if (!Reflect.apply(isEqual, defaultImport, [binding, reasons])) {
|
|
binding = env0_6;
|
|
value = require(9909) /* metro dependency 9909: FeedbackUtils */;
|
|
binding(value.shuffleProblems(reasons, otherKey));
|
|
}
|
|
}
|
|
|
|
function _fun77647() { // fn#77647, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10094:987, offset: 0x01e05d5b, size: 75 bytes, params: 1, frame: 15
|
|
const doNotShowAgain = env0_7.doNotShowAgain;
|
|
const r0 = doNotShowAgain != null && doNotShowAgain;
|
|
const binding = env0_8;
|
|
const object2 = {};
|
|
const binding2 = env0_7;
|
|
copyDataProperties(object2, binding2, undefined);
|
|
object2['doNotShowAgain'] = !r0;
|
|
binding(object2);
|
|
onFeedbackChanged(binding2);
|
|
}
|
|
|
|
function _fun77649(a0, a1) { // fn#77649, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10094:1102, offset: 0x01e05da6, size: 220 bytes, params: 3, frame: 25
|
|
const env0_0 = a0;
|
|
const Fragment = env1_4.Fragment;
|
|
const r6 = a1 > 0 ? ((FormDivider) => <FormDivider />)((require(7972) /* metro dependency 7972: native */).FormDivider) : null;
|
|
const FormRow = (require(7972) /* metro dependency 7972: native */).FormRow;
|
|
const FormLabel = (require(7972) /* metro dependency 7972: native */).FormLabel;
|
|
return (
|
|
<Fragment key={a1}>
|
|
{r6}
|
|
<FormRow
|
|
labelStyle={styles.reason}
|
|
label={<FormLabel text={a0.label} numberOfLines={2} />}
|
|
onPress={onPress_77650}
|
|
/>
|
|
</Fragment>
|
|
);
|
|
}
|
|
|
|
function onChangeRating(a0) { // fn#77651, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10094:1795, owner: FeedbackForm.onChangeRating, offset: 0x01e05eb8, size: 91 bytes, params: 2, frame: 14
|
|
const value = environment.__proto__;
|
|
const GOOD = FeedbackRating.GOOD;
|
|
const reason = a0 === GOOD ? null : env0_7.reason;
|
|
const object2 = {};
|
|
copyDataProperties(object2, env0_7, a0);
|
|
object2['rating'] = a0;
|
|
object2['reason'] = reason;
|
|
env0_8(object2);
|
|
onFeedbackChanged(object2);
|
|
}
|
|
|
|
function onPress_77650() { // fn#77650, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10094:1276, offset: 0x01e05e82, size: 54 bytes, params: 1, frame: 13
|
|
const binding = env0_0;
|
|
const object2 = {};
|
|
copyDataProperties(object2, env1_7, binding);
|
|
object2['reason'] = binding;
|
|
env1_8(object2);
|
|
onFeedbackChanged(object2);
|
|
}
|
|
|