297 lines
16 KiB
TypeScript
297 lines
16 KiB
TypeScript
/* Metro module 14884; source: modules/icymi/native/NewContentPill.tsx; dependencies: [57, 31, 27, 1867, 9569, 33, 4501, 697, 7599, 6819, 566, 4048, 7230, 9579, 4017, 4577, 1487, 5278, 14278, 4573, 1244, 4002, 2] */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import GuildStore from '../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
|
|
import UseTheme from '../../../hooks/useTheme.tsx'; /* Metro dependency 4048 */
|
|
import GuildIcon2 from '../../guild/native/GuildIcon.tsx'; /* Metro dependency 6819 */
|
|
import ClipView from '../../../design/components/Icon/native/ClipView.tsx'; /* Metro dependency 7599 */
|
|
import ICYMIStore from '../ICYMIStore.tsx'; /* Metro dependency 9569 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as Module01487Module from '../../../by-id/module-01487.js'; /* Metro dependency 1487 */
|
|
import * as ReanimatedRexportModule from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
|
|
import * as SpringModule from '../../../design/animation/reanimated/spring/spring.tsx'; /* Metro dependency 4577 */
|
|
import * as PressablesModule from '../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */
|
|
import * as GuildIconModule from '../../guild/native/GuildIcon.tsx'; /* Metro dependency 6819 */
|
|
import * as ICYMITypesModule from '../ICYMITypes.tsx'; /* Metro dependency 7230 */
|
|
import * as ClipViewModule from '../../../design/components/Icon/native/ClipView.tsx'; /* Metro dependency 7599 */
|
|
|
|
function _fun112600(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#112600, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15081:6, offset: 0x023d4171, size: 437 bytes, params: 8, frame: 22
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactNativeModule;
|
|
const env0_5 = value.ActivityIndicator;
|
|
const env0_6 = value.View;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_9 = value.jsx;
|
|
const env0_10 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object = {};
|
|
const object2 = {'alignSelf': 'center', 'alignItems': 'center', 'flexDirection': 'row', 'paddingRight': 12,
|
|
'paddingLeft': 8, 'paddingVertical': 6};
|
|
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
|
|
const BACKGROUND_BRAND = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BRAND;
|
|
object2.backgroundColor = BACKGROUND_BRAND;
|
|
object.container = object2;
|
|
const BACKGROUND_BASE_LOWER = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWER;
|
|
object.guildIconBG = {backgroundColor: BACKGROUND_BASE_LOWER};
|
|
object.refreshMorePillContainer = {'position': 'absolute', 'top': 0, 'left': 0, 'height': 32, 'width': '100%',
|
|
'zIndex': 100};
|
|
const env0_11 = Reflect.apply(createStyles, value, [object]);
|
|
const env0_12 = {'overshootClamping': true, 'stiffness': 20, 'damping': 15, 'mass': 0.03};
|
|
object = {code: "function NewContentPillTsx1(){const{withSpring,showingPill,springConfig}=this.__closure;return{transform:[{translateY:withSpring(showingPill?12:0,springConfig)}],opacity:withSpring(showingPill?1:0,springConfig,'respect-motion-settings')};}"};
|
|
object = {code: "function NewContentPillTsx2(){const{showingPill}=this.__closure;return{pointerEvents:showingPill?'box-none':'none'};}"};
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/icymi/native/NewContentPill.tsx');
|
|
exports.default = NewContentPill;
|
|
function CutoutGuildIcon_112601({guild}) { // fn#112601, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15081:649, offset: 0x023d4326, size: 246 bytes, params: 2, frame: 24
|
|
const styles = useStyles();
|
|
const object2 = {'shape': null, 'x': 18, 'y': -4, 'width': 32, 'height': 32};
|
|
const CutoutShape = (ClipViewModule).CutoutShape;
|
|
const RoundedRect = CutoutShape.RoundedRect;
|
|
object2.shape = RoundedRect;
|
|
object2.cornerRadius = (importDefault(697) /* metro dependency 697: native */).radii.md;
|
|
const items2 = [object2];
|
|
const guildIcon = GuildIcon2;
|
|
const GuildIconSizes = (GuildIconModule).GuildIconSizes;
|
|
const XSMALL = GuildIconSizes.XSMALL;
|
|
return (
|
|
<View style={{'width': 24, 'height': 24}}>
|
|
<ClipView cutouts={items2}>
|
|
{((Component) => <Component guild={guild} size={XSMALL} style={styles.guildIconBG} />)(guildIcon)}
|
|
</ClipView>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function NewContentPill({onPress, isRefreshing}) { // fn#112602, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15081:1420, offset: 0x023d441c, size: 1419 bytes, params: 2, frame: 35
|
|
var r15;
|
|
var view;
|
|
var View2;
|
|
const PressableOpacity = (PressablesModule).PressableOpacity;
|
|
var isThemeDark2;
|
|
var unsafe_rawColors;
|
|
var items2;
|
|
var slice;
|
|
var value17;
|
|
var object2;
|
|
var GuildIcon;
|
|
var View3;
|
|
var items4;
|
|
var Text;
|
|
var intl;
|
|
const styles = useStyles();
|
|
const useStateFromStoresArray = FluxModule.useStateFromStoresArray;
|
|
const icymiStoreBinding = ICYMIStore;
|
|
const value2 = Reflect.apply(useStateFromStoresArray, FluxModule, [[icymiStoreBinding], function() {
|
|
return ICYMIStore.getNewUnreadDehydratedItems();
|
|
}]);
|
|
let closure = function() {
|
|
return ICYMIStore.hasNewContent();
|
|
};
|
|
const value3 = FluxModule.useStateFromStores([icymiStoreBinding], closure, []);
|
|
const env0_3 = value3;
|
|
let binding = property2;
|
|
let useState = binding.useState;
|
|
const value4 = Reflect.apply(useState, binding, [value2]);
|
|
const binding2 = env0_3;
|
|
const value5 = binding2(value4, 2);
|
|
var property = value5[0];
|
|
var property2 = property;
|
|
const env0_5 = value5[1];
|
|
const value6 = (UseTheme)();
|
|
const env0_6 = binding.useMemo(_fun112605, [property]);
|
|
const value7 = FluxModule.useStateFromStoresArray([GuildStore], _fun112607);
|
|
useState = binding.useState;
|
|
const value8 = binding2(Reflect.apply(useState, binding, [false]), 2);
|
|
property = value8[0];
|
|
const env0_7 = value8[1];
|
|
const r19 = value3 && property;
|
|
const useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
|
|
closure = NewContentPillY;
|
|
closure.__closure = {withSpring: (require(4577) /* metro dependency 4577: spring */).withSpring, showingPill: r19,
|
|
springConfig: env0_12};
|
|
closure.__workletHash = 13655660855782;
|
|
closure.__initData = env0_13;
|
|
const value9 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [closure]);
|
|
const useAnimatedProps = ReanimatedRexportModule.useAnimatedProps;
|
|
closure = NewContentPillC;
|
|
closure.__closure = {showingPill: r19};
|
|
closure.__workletHash = 876312391659;
|
|
closure.__initData = env0_14;
|
|
const value10 = Reflect.apply(useAnimatedProps, ReanimatedRexportModule, [closure]);
|
|
const value11 = (Module01487Module).useIsFocused();
|
|
binding = property2;
|
|
var [property, env0_11] = env0_3(binding.useState(false), 2);
|
|
binding.useLayoutEffect(_fun112611, [value3, value11, property]);
|
|
binding.useEffect(_fun112612, [isRefreshing, value2, value3]);
|
|
const value14 = binding.useCallback(function() {
|
|
onPress();
|
|
}, [onPress]);
|
|
let length = value7.length;
|
|
if (length === 0) {
|
|
View3 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
|
|
var view3Props = {style: [styles.refreshMorePillContainer, value9], animatedProps: value10};
|
|
var pressableOpacityProps = {onPress: value14, style: styles.container};
|
|
const ArrowSmallUpIcon = (require(14278) /* metro dependency 14278: ArrowSmallUpIcon */).ArrowSmallUpIcon;
|
|
items4 = [
|
|
<ArrowSmallUpIcon size="md" color="interactive-text-active" />,
|
|
];
|
|
Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
items4[1] = (
|
|
<Text
|
|
style={{marginLeft: 4}}
|
|
variant="heading-md/bold"
|
|
color="interactive-text-active"
|
|
>
|
|
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['4Nl0Rl'])}
|
|
</Text>
|
|
);
|
|
view = (
|
|
<View3 {...view3Props}>
|
|
<PressableOpacity {...pressableOpacityProps}>
|
|
{items4}
|
|
</PressableOpacity>
|
|
</View3>
|
|
);
|
|
} else {
|
|
View2 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
|
|
var view2Props = {style: [styles.refreshMorePillContainer, value9], animatedProps: value10};
|
|
var pressableOpacityProps = {onPress: value14, style: styles.container};
|
|
if (isRefreshing) {
|
|
isThemeDark2 = (require(4002) /* metro dependency 4002: shared */).isThemeDark(value6);
|
|
unsafe_rawColors = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors;
|
|
r15 = <ActivityIndicator color={isThemeDark2 ? unsafe_rawColors.WHITE : unsafe_rawColors.PRIMARY_500} />;
|
|
} else {
|
|
const ArrowSmallUpIcon2 = (require(14278) /* metro dependency 14278: ArrowSmallUpIcon */).ArrowSmallUpIcon;
|
|
r15 = <ArrowSmallUpIcon2 size="md" color="interactive-text-active" />;
|
|
}
|
|
items2 = [r15];
|
|
slice = value7.slice;
|
|
length = value7.length;
|
|
value17 = Reflect.apply(slice, value7, [0, length - 1]);
|
|
items2[1] = value17.map(_fun112614);
|
|
object2 = {};
|
|
length = value7.length;
|
|
object2.style = {marginLeft: length > 1 ? -2 : 4};
|
|
GuildIcon = importDefault(6819) /* metro dependency 6819: GuildIcon */;
|
|
length = value7.length;
|
|
items2[2] = (
|
|
<View {...object2}>
|
|
<GuildIcon
|
|
guild={value7[length - 1]}
|
|
size={(require(6819) /* metro dependency 6819: GuildIcon */).GuildIconSizes.XSMALL}
|
|
style={styles.guildIconBG}
|
|
/>
|
|
</View>
|
|
);
|
|
view = (
|
|
<View2 {...view2Props}>
|
|
<PressableOpacity {...pressableOpacityProps}>
|
|
{items2}
|
|
</PressableOpacity>
|
|
</View2>
|
|
);
|
|
}
|
|
return view;
|
|
function _fun112605() { // fn#112605, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15081:1691, offset: 0x023d49cf, size: 36 bytes, params: 1, frame: 12
|
|
ReactModule.forEach(_fun112606);
|
|
return [];
|
|
function _fun112606(a0) { // fn#112606, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15081:1723, offset: 0x023d49f3, size: 140 bytes, params: 2, frame: 15
|
|
var r3;
|
|
var isGuildItem2;
|
|
var binding;
|
|
const length = env0_0.length;
|
|
const MIN_ITEMS_FOR_NEW_PILL = (ICYMITypesModule).MIN_ITEMS_FOR_NEW_PILL;
|
|
if (!(length >= MIN_ITEMS_FOR_NEW_PILL)) {
|
|
isGuildItem2 = (require(9579) /* metro dependency 9579: ICYMIUtils */).isGuildItem(a0);
|
|
if (isGuildItem2) {
|
|
binding = env0_0;
|
|
r3 = !binding.includes(a0.data.guild_id);
|
|
} else {
|
|
r3 = isGuildItem2;
|
|
}
|
|
if (r3) {
|
|
binding = env0_0;
|
|
binding.push(a0.data.guild_id);
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function _fun112607() { // fn#112607, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15081:1901, offset: 0x023d4a7f, size: 46 bytes, params: 1, frame: 11
|
|
const value = env0_6.map(function(a0) {
|
|
return GuildStore.getGuild(a0);
|
|
});
|
|
const filter = value.filter;
|
|
const Boolean = global.Boolean;
|
|
return Reflect.apply(filter, value, [Boolean]);
|
|
}
|
|
|
|
function NewContentPillY() { // fn#112609, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15081:2028, owner: NewContentPill.y, offset: 0x023d4ac4, size: 133 bytes, params: 1, frame: 21
|
|
const object = {};
|
|
const withSpring = SpringModule.withSpring;
|
|
const value3 = 0;
|
|
object.transform = [{translateY: Reflect.apply(withSpring, SpringModule, [env0_8 ? 12 : value3, env1_12])}];
|
|
object.opacity = SpringModule.withSpring(env0_8 ? 1 : value3, env1_12, 'respect-motion-settings');
|
|
return object;
|
|
}
|
|
|
|
function NewContentPillC() { // fn#112610, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15081:2320, owner: NewContentPill.C, offset: 0x023d4b49, size: 29 bytes, params: 1, frame: 3
|
|
return {pointerEvents: env0_8 ? 'box-none' : 'none'};
|
|
}
|
|
|
|
function _fun112611() { // fn#112611, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15081:2534, offset: 0x023d4b66, size: 93 bytes, params: 1, frame: 12
|
|
var r1;
|
|
if (env0_10) {
|
|
r1 = env0_10 && env0_9;
|
|
r1 = r1 && !env0_3;
|
|
if (r1) {
|
|
env0_7(true);
|
|
}
|
|
} else if (env0_9) {
|
|
if (env0_3) {
|
|
env0_7(false);
|
|
} else {
|
|
r1 = env0_10 && env0_9;
|
|
r1 = r1 && !env0_3;
|
|
if (r1) {
|
|
env0_7(true);
|
|
}
|
|
}
|
|
} else {
|
|
r1 = env0_10 && env0_9;
|
|
r1 = r1 && !env0_3;
|
|
if (r1) {
|
|
env0_7(true);
|
|
}
|
|
}
|
|
env0_11(env0_9);
|
|
}
|
|
|
|
function _fun112612() { // fn#112612, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15081:2599, offset: 0x023d4bc3, size: 29 bytes, params: 1, frame: 11
|
|
if (!isRefreshing) {
|
|
env0_5(env0_2);
|
|
}
|
|
}
|
|
|
|
function _fun112614(a0, a1) { // fn#112614, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15081:3407, offset: 0x023d4be0, size: 88 bytes, params: 3, frame: 18
|
|
return (
|
|
<View style={{marginLeft: a1 > 0 ? -2 : 4}} key={a0.id}>
|
|
<CutoutGuildIcon_112601 guild={a0} />
|
|
</View>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun112600, 14884, [57, 31, 27, 1867, 9569, 33, 4501, 697, 7599, 6819, 566, 4048, 7230, 9579, 4017, 4577,
|
|
1487, 5278, 14278, 4573, 1244, 4002,
|
|
2]) /* metro module 14884, dependencies: [57, 31, 27, 1867, 9569, 33, 4501, 697, 7599, 6819, 566, 4048, 7230, 9579, 4017, 4577, 1487, 5278, 14278, 4573, 1244, 4002, 2] */;
|