80 lines
4.6 KiB
TypeScript
80 lines
4.6 KiB
TypeScript
/* Metro module 11789; source: modules/chat/native/SlowModeIndicator.tsx; dependencies: [31, 7080, 33, 4501, 697, 566, 7081, 3857, 10227, 5278, 4573, 2] */
|
|
function _fun90295(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90295, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11975:6, offset: 0x02033917, size: 257 bytes, params: 8, frame: 22
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = importAll(31) /* metro dependency 31 */;
|
|
const slowmodeStore = importDefault(7080) /* metro dependency 7080: SlowmodeStore */;
|
|
const value2 = require(33) /* metro dependency 33 */;
|
|
const env0_5 = value2.jsx;
|
|
const env0_6 = value2.jsxs;
|
|
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = createStylesModule.createStyles;
|
|
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
const env0_7 = Reflect.apply(createStyles, createStylesModule, [{container: {'alignItems': 'center',
|
|
'flexDirection': 'row'}, icon: {marginLeft: PX_4}}]);
|
|
value = value.memo(SlowModeIndicator);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/chat/native/SlowModeIndicator.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function SlowModeIndicator({channel, hasTypingText, slowmodeType}) { // fn#90296, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11975:272, offset: 0x02033a18, size: 348 bytes, params: 2, frame: 22
|
|
const styles = useStyles();
|
|
const slowmodeCooldownGuess = (require(566) /* metro dependency 566: flux */).useStateFromStores([SlowmodeStore],
|
|
function() {
|
|
return SlowmodeStore.getSlowmodeCooldownGuess(channel.id, slowmodeType);
|
|
});
|
|
const env0_3 = slowmodeCooldownGuess;
|
|
const value2 = (require(7081) /* metro dependency 7081: SlowmodeUtils */).useCanBypassSlowmode(channel,
|
|
slowmodeType);
|
|
const binding = env0_3;
|
|
const value3 = binding.useMemo(_fun90298, [hasTypingText, value2, slowmodeCooldownGuess]);
|
|
const value4 = binding.useCallback(_fun90299, [channel.rateLimitPerUser]);
|
|
const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
const text = <Text lineClamp={1} allowFontScaling={false} variant="text-xs/medium" color="interactive-text-default">{value3}</Text>;
|
|
const TimerIcon = (require(10227) /* metro dependency 10227: TimerIcon */).TimerIcon;
|
|
return (
|
|
<PressableOpacity onPress={value4} style={styles.container}>
|
|
{text}
|
|
<TimerIcon style={styles.icon} size="xxs" />
|
|
</PressableOpacity>
|
|
);
|
|
}
|
|
|
|
function _fun90298() { // fn#90298, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11975:477, offset: 0x02033b99, size: 79 bytes, params: 1, frame: 14
|
|
var r0;
|
|
var value3;
|
|
var moduleValue;
|
|
if (hasTypingText) {
|
|
if (env0_4) {
|
|
value3 = environment.__proto__;
|
|
moduleValue = require(7081) /* metro dependency 7081: SlowmodeUtils */;
|
|
r0 = moduleValue.getSlowmodeIndicatorText(slowmodeCooldownGuess, env0_4);
|
|
} else if (slowmodeCooldownGuess <= 0) {
|
|
r0 = null;
|
|
} else {
|
|
value3 = environment.__proto__;
|
|
moduleValue = require(7081) /* metro dependency 7081: SlowmodeUtils */;
|
|
r0 = moduleValue.getSlowmodeIndicatorText(slowmodeCooldownGuess, env0_4);
|
|
}
|
|
} else {
|
|
value3 = environment.__proto__;
|
|
moduleValue = require(7081) /* metro dependency 7081: SlowmodeUtils */;
|
|
r0 = moduleValue.getSlowmodeIndicatorText(slowmodeCooldownGuess, env0_4);
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun90299() { // fn#90299, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11975:563, offset: 0x02033be8, size: 116 bytes, params: 1, frame: 15
|
|
const value = environment.__proto__;
|
|
const defaultImport = importDefault(3857) /* metro dependency 3857: ToastActionCreators */;
|
|
const open = defaultImport.open;
|
|
const object2 = {key: 'CHANNEL_SLOWMODE_INFO'};
|
|
const TimerIcon = (require(10227) /* metro dependency 10227: TimerIcon */).TimerIcon;
|
|
object2.IconComponent = TimerIcon;
|
|
object2.content = (require(7081) /* metro dependency 7081: SlowmodeUtils */).getSlowmodeDescription(channel.rateLimitPerUser);
|
|
Reflect.apply(open, defaultImport, [object2]);
|
|
}
|
|
|