109 lines
6.2 KiB
TypeScript
109 lines
6.2 KiB
TypeScript
/* Metro module 11428; source: components_native/common/RolePill.tsx; dependencies: [31, 27, 661, 33, 4501, 697, 3829, 6793, 6797, 3856, 5278, 6812, 4573, 2] */
|
|
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 ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as UserSettingsModule from '../../modules/user_settings/UserSettings.tsx'; /* Metro dependency 3829 */
|
|
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 RoleIconUtilsModule from '../../modules/guild_boosting/native/RoleIconUtils.tsx'; /* Metro dependency 6793 */
|
|
|
|
function _fun87482(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#87482, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11614:6, offset: 0x01fc0337, size: 466 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
ReactModule;
|
|
let value = ConstantsModule;
|
|
const env0_4 = value.EMPTY_STRING_SNOWFLAKE_ID;
|
|
const env0_5 = value.MAX_VISUAL_ROLE_LENGTH;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_6 = value.jsx;
|
|
const env0_7 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object = {};
|
|
const object2 = {'marginRight': 4, 'marginBottom': 4};
|
|
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs;
|
|
object.container = object2;
|
|
const object3 = {'flexDirection': 'row', 'alignItems': 'center', 'paddingHorizontal': 8, 'paddingVertical': 6};
|
|
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs;
|
|
const BACKGROUND_BASE_LOWEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWEST;
|
|
object3.backgroundColor = BACKGROUND_BASE_LOWEST;
|
|
object.pill = object3;
|
|
const object4 = {'marginRight': 8, 'borderRadius': null, 'height': 12, 'width': 12};
|
|
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
const ICON_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.ICON_MUTED;
|
|
object4.backgroundColor = ICON_MUTED;
|
|
object.bubble = object4;
|
|
const object5 = {'marginRight': 8, 'borderRadius': null, 'height': 12, 'width': 12};
|
|
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
object.verifiedContainer = object5;
|
|
object.roleIcon = {paddingRight: 4};
|
|
const env0_8 = Reflect.apply(createStyles, value, [object]);
|
|
(FileImportTrackerModule).fileFinishedImporting('components_native/common/RolePill.tsx');
|
|
exports.default = RolePill;
|
|
function RolePill({role, guildId, disableInteraction, color}) { // fn#87483, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11614:708, offset: 0x01fc0509, size: 616 bytes, params: 2, frame: 33
|
|
var r18;
|
|
var r10;
|
|
var VerifiedRoleIcon;
|
|
const DeveloperMode = (UserSettingsModule).DeveloperMode;
|
|
const value3 = DeveloperMode.useSetting();
|
|
const value4 = (RoleIconUtilsModule).useRoleIcon({guildId: guildId,
|
|
roleId: role.id, size: 12});
|
|
const r11 = role.name.length > MAX_VISUAL_ROLE_LENGTH ? '' + role.name.slice(0,
|
|
MAX_VISUAL_ROLE_LENGTH) + '...' : role.name;
|
|
const r19 = color ?? role.colorString;
|
|
const guild_connections = role.tags?.guild_connections;
|
|
const styles = useStyles();
|
|
const PressableHighlight = (PressablesModule).PressableHighlight;
|
|
object = {disabled: value3 ? disableInteraction : !value3, style: styles.container, onPress: onPress_87484,
|
|
accessible: false};
|
|
if (guild_connections !== undefined) {
|
|
VerifiedRoleIcon = importDefault(6812) /* metro dependency 6812: VerifiedRoleIcon */;
|
|
var defaultImportProps = {style: styles.verifiedContainer, roleId: role.id};
|
|
r18 = guildId ?? EMPTY_STRING_SNOWFLAKE_ID;
|
|
defaultImportProps.guildId = r18;
|
|
r18 = r19 ?? undefined;
|
|
defaultImportProps.roleColor = r18;
|
|
defaultImportProps.size = 14;
|
|
defaultImportProps.displayRoleIcon = false;
|
|
r10 = <VerifiedRoleIcon {...defaultImportProps} />;
|
|
} else {
|
|
r10 = <View style={[styles.bubble, r19 != null ? {backgroundColor: r19} : {}]} />;
|
|
}
|
|
const r9 = (
|
|
value4 != null
|
|
? (
|
|
<View style={styles.roleIcon}>
|
|
{value4}
|
|
</View>
|
|
)
|
|
: null
|
|
);
|
|
const Text = (TextModule).Text;
|
|
return (
|
|
<PressableHighlight {...object}>
|
|
<View style={styles.pill}>
|
|
{r10}
|
|
{r9}
|
|
<Text variant="text-xs/semibold" color="interactive-text-active">
|
|
{r11}
|
|
</Text>
|
|
</View>
|
|
</PressableHighlight>
|
|
);
|
|
function RolePillOnPress() { // fn#87484, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11614:1101, owner: RolePill.onPress, offset: 0x01fc0771, size: 77 bytes, params: 1, frame: 15
|
|
let value = environment.__proto__;
|
|
value = require(6797) /* metro dependency 6797: ClipboardUtilsNative */;
|
|
value.copy(role.id);
|
|
value = require(3856) /* metro dependency 3856: ToastUtils */;
|
|
value.roleIdCopied(name);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun87482, 11428, [31, 27, 661, 33, 4501, 697, 3829, 6793, 6797, 3856, 5278, 6812, 4573,
|
|
2]) /* metro module 11428, dependencies: [31, 27, 661, 33, 4501, 697, 3829, 6793, 6797, 3856, 5278, 6812, 4573, 2] */;
|