Files
discord-decomp/sources/modules/quests/native/QuestHomeEmptyState.tsx
T
2026-07-28 01:06:53 +03:00

115 lines
6.1 KiB
TypeScript

/* Metro module 13555; source: modules/quests/native/QuestHomeEmptyState.tsx; dependencies: [31, 27, 661, 33, 4501, 697, 1244, 3860, 4010, 6618, 477, 4573, 13556, 4589, 2] */
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import UseChatLayout from '../../chat/native/useChatLayout.tsx'; /* Metro dependency 4010 */
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 PlatformUtilsModule from '../../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
import * as UseTokenModule from '../../../design/tokens/native/useToken.tsx'; /* Metro dependency 3860 */
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as SafeAreaViewModule from '../../../components_native/common/SafeAreaView.tsx'; /* Metro dependency 6618 */
function _fun102966(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#102966, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13745:6, offset: 0x02251c62, size: 402 bytes, params: 8, frame: 22
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
ReactModule;
let value = ReactNativeModule;
const env0_3 = value.View;
const env0_4 = value.ImageBackground;
value = require(33) /* metro dependency 33 */;
const env0_6 = value.jsx;
const env0_7 = value.jsxs;
const env0_8 = value.Fragment;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
const PX_32 = (Native).space.PX_32;
const env0_9 = Reflect.apply(createStyles, value, [{container: {flex: 1},
emptyStateContainer: {'justifyContent': 'center', 'alignItems': 'center', 'flex': 1},
emptyStateContentContainer: {top: -55, paddingHorizontal: PX_32}, emptyStateContentTitle: {textAlign: 'center'},
emptyStateContentDescription: {'textAlign': 'center', 'marginTop': 4}, emptyImage: {'flex': 1, 'width': '100%',
'aspectRatio': 1.6375545851528384, 'minWidth': '100%', 'position': 'absolute', 'bottom': 0, 'zIndex': -1},
gradient: {'height': 22, 'width': '100%', 'position': 'absolute', 'bottom': 0}, actionWrapper: {'marginTop': 16,
'alignSelf': 'center'}}]);
(FileImportTrackerModule).fileFinishedImporting('modules/quests/native/QuestHomeEmptyState.tsx');
exports.default = QuestHomeEmptyState;
function QuestHomeEmptyState({action, title, subtitle}) { // fn#102967, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13745:745, offset: 0x02251df4, size: 720 bytes, params: 2, frame: 31
var r9;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var jsxRuntimeEnv0_8Binding;
var items3;
const r20 = title !== undefined ? title : intl.string((require(1244) /* metro dependency 1244: indexNative */).t.SdlRnK);
const r13 = subtitle !== undefined ? subtitle : intl.string((require(1244) /* metro dependency 1244: indexNative */).t['R7mv+G']);
const styles = useStyles();
const useToken = UseTokenModule.useToken;
const BACKGROUND_BASE_LOWER = (Native).colors.BACKGROUND_BASE_LOWER;
const value2 = Reflect.apply(useToken, UseTokenModule, [BACKGROUND_BASE_LOWER]);
const isChatLockedOpen = (UseChatLayout)().isChatLockedOpen;
const SafeAreaPaddingView = (SafeAreaViewModule).SafeAreaPaddingView;
const safeAreaPaddingViewProps = {bottom: (PlatformUtilsModule).isAndroid()};
let container = styles.container;
safeAreaPaddingViewProps.style = container;
container = styles.container;
const Text = (TextModule).Text;
const items2 = [
<Text
variant="heading-xl/bold"
color="mobile-text-heading-primary"
style={styles.emptyStateContentTitle}
>
{r20}
</Text>,
];
items2[1] = (
<Text
variant="text-md/normal"
color="text-default"
style={styles.emptyStateContentDescription}
>
{r13}
</Text>
);
items2[2] = action != null && <View style={styles.actionWrapper}>{action}</View>;
const view = (
<View style={styles.emptyStateContentContainer}>
{items2}
</View>
);
if (isChatLockedOpen) {
r9 = null;
} else {
jsxRuntimeEnv0_8Binding = jsxRuntimeEnv0_8;
items3 = [
<ImageBackground
style={styles.emptyImage}
source={importDefault(13556) /* metro dependency 13556 */}
resizeMode="cover"
/>,
];
items3[1] = ((Component) => <Component style={styles.gradient} end={VerticalGradient.END} start={VerticalGradient.START} colors={['rgba(0, 0, 0, 0)',
value2]} />)(importDefault(4589) /* metro dependency 4589 */);
r9 = (
<>
{items3}
</>
);
}
return (
<SafeAreaPaddingView {...safeAreaPaddingViewProps}>
<View style={container}>
<View style={styles.emptyStateContainer}>
{view}
{r9}
</View>
</View>
</SafeAreaPaddingView>
);
}
}
global.__d(_fun102966, 13555, [31, 27, 661, 33, 4501, 697, 1244, 3860, 4010, 6618, 477, 4573, 13556, 4589,
2]) /* metro module 13555, dependencies: [31, 27, 661, 33, 4501, 697, 1244, 3860, 4010, 6618, 477, 4573, 13556, 4589, 2] */;