Files
discord-decomp/sources/modules/feedback/native/RatingSelector.tsx
T
2026-07-27 16:20:00 +03:00

101 lines
5.6 KiB
TypeScript

/* Metro module 9910; source: modules/feedback/native/RatingSelector.tsx; dependencies: [31, 27, 9906, 33, 4501, 9911, 9912, 1244, 9916, 9917, 9921, 9922, 7975, 5278, 2] */
function _fun77666(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77666, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10096:6, offset: 0x01e07100, size: 354 bytes, params: 8, frame: 20
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.View;
const env0_4 = value.Image;
value = require(9906) /* metro dependency 9906: Constants */;
const env0_5 = value.DEFAULT_RATINGS;
const env0_6 = value.FeedbackRating;
const env0_7 = (require(33) /* metro dependency 33 */).jsx;
const env0_8 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({ratings: {'flexDirection': 'row',
'alignItems': 'center', 'justifyContent': 'center'}, rating: {}, emoji: {'width': 64, 'height': 64,
'marginVertical': 24, 'marginHorizontal': 12}});
const env0_9 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({ratings: {'flexDirection': 'column',
'alignItems': 'flex-start', 'justifyContent': 'flex-start', 'gap': 16, 'marginBottom': 12},
rating: {width: '100%'}, emoji: {'width': 32, 'height': 32}});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/feedback/native/RatingSelector.tsx');
exports.default = RatingSelector;
}
function RatingSelector({ratingOptions = DEFAULT_RATINGS, textLabels, selectedRating, onChangeRating}) { // fn#77667, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10096:641, offset: 0x01e07262, size: 151 bytes, params: 2, frame: 17
const styles = useStyles();
return (
<View style={(textLabels == null ? useStyles() : styles).ratings}>
{useEmojiConfigs(ratingOptions).map(_fun77673)}
</View>
);
}
function useEmojiConfigs(a0) { // fn#77668, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10096:765, owner: RatingSelector.useEmojiConfigs, offset: 0x01e072f9, size: 309 bytes, params: 2, frame: 21
var environment;
const object2 = {};
const value = environment.__proto__;
const BAD = FeedbackRating.BAD;
const object4 = {};
object4.selected = importDefault(9911) /* metro dependency 9911 */;
object4.normal = (require(9912) /* metro dependency 9912: FeedbackModalSadDesaturated */).useFeedbackModalSadDesaturatedSource();
const BAD2 = FeedbackRating.BAD;
object2[BAD] = {source: object4, getLabel: function() {
return require(dependencyMap[7]).intl.string(require(dependencyMap[7]).t['C/12Tt']);
}, rating: BAD2};
const NEUTRAL = FeedbackRating.NEUTRAL;
const object6 = {selected: importDefault(9916) /* metro dependency 9916 */};
object6.normal = (require(9917) /* metro dependency 9917: FeedbackModalNeutralDesaturated */).useFeedbackModalNeutralDesaturatedSource();
const NEUTRAL2 = FeedbackRating.NEUTRAL;
object2[NEUTRAL] = {source: object6, getLabel: function() {
return require(dependencyMap[7]).intl.string(require(dependencyMap[7]).t.Xcb4cF);
}, rating: NEUTRAL2};
const GOOD = FeedbackRating.GOOD;
const object8 = {selected: importDefault(9921) /* metro dependency 9921 */};
object8.normal = (require(9922) /* metro dependency 9922: FeedbackModalHappyDesaturated */).useFeedbackModalHappyDesaturatedSource();
const GOOD2 = FeedbackRating.GOOD;
object2[GOOD] = {source: object8, getLabel: function() {
return require(dependencyMap[7]).intl.string(require(dependencyMap[7]).t['1Vyb5J']);
}, rating: GOOD2};
return a0.map(_fun77672);
}
function _fun77673(a0) { // fn#77673, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10096:1359, offset: 0x01e074ee, size: 368 bytes, params: 2, frame: 26
var environment;
var r0;
var value2;
var PressableOpacity;
var object2;
var value3;
var value4;
var RowButton;
var object3;
var value5;
const rating = a0.rating;
const {selected, normal} = a0.source;
const getLabel = a0.getLabel;
if (textLabels != null) {
value4 = environment.__proto__;
var viewBindingProps = {style: env0_3.rating};
RowButton = (require(7975) /* metro dependency 7975: RowButtonNative */).RowButton;
object3 = {accessibilityRole: 'button', accessibilityLabel: getLabel()};
value5 = selectedRating === rating;
object3.accessibilityState = {selected: value5};
object3.onPress = function() {
return onChangeRating(rating);
};
object3.icon = <Image style={env0_3.emoji} source={value5 ? selected : normal} />;
object3.label = textLabels[rating];
r0 = <View {...viewBindingProps} key={rating}><RowButton {...object3} /></View>;
} else {
value2 = environment.__proto__;
PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
object2 = {accessibilityRole: 'button', accessibilityLabel: getLabel()};
value3 = selectedRating === rating;
object2.accessibilityState = {selected: value3};
object2.onPress = onPress_77675;
r0 = <PressableOpacity {...object2} key={rating}><Image style={env0_3.emoji} source={value3 ? selected : normal} /></PressableOpacity>;
}
return r0;
}