175 lines
9.6 KiB
TypeScript
175 lines
9.6 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] */
|
|
import Module00022 from '../../../by-id/module-00022.js'; /* Metro dependency 22 */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
|
|
import UsePrevious from '../../../hooks/usePrevious.tsx'; /* Metro dependency 6266 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as ConstantsModule from '../Constants.tsx'; /* Metro dependency 9906 */
|
|
|
|
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
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = JsxRuntimeModule;
|
|
const env0_6 = value.jsx;
|
|
const env0_7 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object = {};
|
|
object.ratingsLabel = {textAlign: 'center'};
|
|
object.reasonsHeader = {marginBottom: 8};
|
|
object.reasonsList = {'overflow': 'hidden', 'marginBottom': 12, 'padding': 0};
|
|
const INTERACTIVE_TEXT_ACTIVE = (Native).colors.INTERACTIVE_TEXT_ACTIVE;
|
|
object.reason = {color: INTERACTIVE_TEXT_ACTIVE};
|
|
const BACKGROUND_SURFACE_HIGH = (Native).colors.BACKGROUND_SURFACE_HIGH;
|
|
object.doNotShowAgainContainer = {'paddingHorizontal': 0, 'paddingVertical': 8,
|
|
backgroundColor: BACKGROUND_SURFACE_HIGH};
|
|
const env0_8 = Reflect.apply(createStyles, value, [object]);
|
|
(FileImportTrackerModule).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 styles2 = styles;
|
|
const value2 = (UsePrevious)(reasons);
|
|
const binding = styles2;
|
|
let useState = binding.useState;
|
|
const defaultImport = Module00022;
|
|
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
|
|
: (
|
|
<styles2.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)}
|
|
</styles2.Fragment>
|
|
)
|
|
)
|
|
: null
|
|
);
|
|
const Fragment = styles2.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 = Module00022;
|
|
const isEqual = defaultImport.isEqual;
|
|
let binding = ConstantsModule.FeedbackRating;
|
|
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 object = {};
|
|
const binding2 = env0_7;
|
|
copyDataProperties(object, binding2, undefined);
|
|
object['doNotShowAgain'] = !r0;
|
|
binding(object);
|
|
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 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 object = {};
|
|
copyDataProperties(object, env1_7, binding);
|
|
object['reason'] = binding;
|
|
env1_8(object);
|
|
onFeedbackChanged(object);
|
|
}
|
|
|
|
}
|
|
|
|
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 object = {};
|
|
copyDataProperties(object, env0_7, a0);
|
|
object['rating'] = a0;
|
|
object['reason'] = reason;
|
|
env0_8(object);
|
|
onFeedbackChanged(object);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun77643, 9908, [57, 31, 9906, 33, 4501, 697, 6266, 22, 9909, 4594, 7972, 4573, 6239, 9910, 1244,
|
|
2]) /* metro module 9908, dependencies: [57, 31, 9906, 33, 4501, 697, 6266, 22, 9909, 4594, 7972, 4573, 6239, 9910, 1244, 2] */;
|