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

165 lines
8.3 KiB
TypeScript

/* Metro module 6815; source: modules/user_profile/native/UserProfileCard.tsx; dependencies: [31, 27, 6816, 33, 4501, 697, 5278, 4573, 6818, 1357, 2] */
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import MobileVisualRefreshExperiment from '../../themes/experiments/MobileVisualRefreshExperiment.tsx'; /* Metro dependency 1357 */
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 TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as PressablesModule from '../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */
import * as ConstantsModule from './Constants.tsx'; /* Metro dependency 6816 */
function _fun53584(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#53584, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6993:6, offset: 0x013502e8, size: 440 bytes, params: 8, frame: 25
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ConstantsModule;
const CARD_PADDING = value.CARD_PADDING;
const CARD_ROWS_COLUMN_GAP = value.CARD_ROWS_COLUMN_GAP;
const CARD_ROWS_ICON_SIZE = value.CARD_ROWS_ICON_SIZE;
const env0_5 = value.CARD_ROWS_ICON_SIZE_VARIANT;
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 BORDER_SUBTLE = (Native).colors.BORDER_SUBTLE;
const env0_9 = Reflect.apply(createStyles, value, [{title: {'marginBottom': 12, 'flexDirection': 'row',
'alignItems': 'center', 'gap': 4}, text: {flexShrink: 1}, rowDivider: {borderBottomWidth: 1,
borderBottomColor: BORDER_SUBTLE, marginLeft: CARD_ROWS_ICON_SIZE + CARD_ROWS_COLUMN_GAP,
marginRight: -CARD_PADDING}, row: {'flexDirection': 'column', 'paddingVertical': 20},
rowLabel: {'flexDirection': 'row', 'alignItems': 'center', columnGap: CARD_ROWS_COLUMN_GAP},
rowLabelText: {flex: 1, lineHeight: CARD_ROWS_ICON_SIZE},
rowSublabel: {marginHorizontal: CARD_ROWS_ICON_SIZE + CARD_ROWS_COLUMN_GAP}}]);
(FileImportTrackerModule).fileFinishedImporting('modules/user_profile/native/UserProfileCard.tsx');
exports.default = UserProfileCard;
exports.UserProfileFormRow = UserProfileFormRow;
exports.UserProfileCardRows = UserProfileCardRows;
function Divider() { // fn#53585, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6993:676, offset: 0x013504a0, size: 41 bytes, params: 1, frame: 14
const styles = useStyles();
return <View style={styles.rowDivider} />;
}
function UserProfileCard(a0) { // fn#53586, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6993:830, offset: 0x013504c9, size: 328 bytes, params: 2, frame: 27
var r14;
var r6;
var Text;
const title = a0.title;
const titleIcon = a0.titleIcon;
const titleStyle = a0.titleStyle;
const children = a0.children;
const style = a0.style;
const object = {'title': 0, 'titleIcon': 0, 'titleStyle': 0, 'children': 0, 'style': 0};
silentSetPrototypeOf(object, null, undefined);
let value = copyDataProperties({}, a0, object, undefined);
const styles = useStyles();
const value3 = (MobileVisualRefreshExperiment)('UserProfileCard');
const viewBindingProps = {style: style, ...value};
value = title != null;
if (value) {
var viewBinding2Props = {style: [styles.title, titleStyle]};
Text = (require(4573) /* metro dependency 4573: Text */).Text;
var textProps = {style: styles.text, accessibilityRole: 'header'};
value = 'text-sm/semibold';
r14 = value3 ? 'text-sm/medium' : value;
textProps.variant = r14;
value = 'text-default';
r14 = value3 ? 'text-strong' : value;
textProps.color = r14;
textProps.lineClamp = 1;
value = (
<Text {...textProps}>
{title}
</Text>
);
value = (
<View {...viewBinding2Props}>
{value}
{titleIcon}
</View>
);
r6 = value;
} else {
r6 = value;
}
return (
<View {...viewBindingProps}>
{r6}
{children}
</View>
);
}
function UserProfileFormRow({label, sublabel, icon, hint, disabled, isDestructive, onPress, labelColor, arrow}) { // fn#53587, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6993:1227, offset: 0x01350611, size: 437 bytes, params: 2, frame: 30
arrow = !(arrow === undefined) && arrow;
const styles = useStyles();
const r16 = isDestructive ? 'text-feedback-critical' : undefined;
let r18 = isDestructive ? 'text-feedback-critical' : 'mobile-text-heading-primary';
const PressableOpacity = (PressablesModule).PressableOpacity;
const items2 = [
((Component) => <Component size={CARD_ROWS_ICON_SIZE_VARIANT} color={r16} />)(icon),
];
const Text = (TextModule).Text;
r18 = labelColor ?? r18;
items2[1] = (
<Text
variant="text-md/semibold"
color={r18}
style={styles.rowLabelText}
>
{label}
</Text>
);
items2[2] = hint != null && ((Component) => <Component size={CARD_ROWS_ICON_SIZE_VARIANT} color={r16} />)(hint);
items2[3] = arrow && ((ChevronSmallRightIcon) => <ChevronSmallRightIcon size="sm" />)((require(6818) /* metro dependency 6818: ChevronSmallRightIcon */).ChevronSmallRightIcon);
return (
<PressableOpacity
style={styles.row}
accessibilityRole="button"
accessibilityLabel={label}
disabled={disabled}
onPress={onPress}
>
<View style={styles.rowLabel}>
{items2}
</View>
{sublabel != null && <View style={styles.rowSublabel}>{sublabel}</View>}
</PressableOpacity>
);
}
function UserProfileCardRows({children}) { // fn#53588, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6993:1887, offset: 0x013507c6, size: 96 bytes, params: 2, frame: 17
const env0_0 = (MobileVisualRefreshExperiment)('UserProfileCardRows');
const jsxRuntimeEnv0_8Binding = jsxRuntimeEnv0_8;
const Children = ReactModule.Children;
return (
<>
{Children.map(children, _fun53589)}
</>
);
function _fun53589(a0, a1) { // fn#53589, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6993:2006, offset: 0x01350826, size: 90 bytes, params: 3, frame: 19
const value = environment.__proto__;
const Fragment = env1_3.Fragment;
return (
<Fragment key={a1}>
{
[
env0_0 || a1 === 0
? null
: (
<Divider />
),
a0,
]
}
</Fragment>
);
}
}
}
global.__d(_fun53584, 6815, [31, 27, 6816, 33, 4501, 697, 5278, 4573, 6818, 1357,
2]) /* metro module 6815, dependencies: [31, 27, 6816, 33, 4501, 697, 5278, 4573, 6818, 1357, 2] */;