400 lines
12 KiB
TypeScript
400 lines
12 KiB
TypeScript
// Metro module 3889 (f3890).
|
|
import { VerificationCriteria } from "../../../Constants";
|
|
import ToastActionCreators from "./ToastActionCreators";
|
|
import { intl, t } from "../../../intl/index.native";
|
|
import { FriendsIcon } from "../../../design/components/Icon/native/redesign/generated/FriendsIcon";
|
|
import { UserPlusIcon } from "../../../design/components/Icon/native/redesign/generated/UserPlusIcon";
|
|
import { UserPlatformIcon } from "../../../design/components/Icon/native/redesign/generated/UserPlatformIcon";
|
|
import { UserMinusIcon } from "../../../design/components/Icon/native/redesign/generated/UserMinusIcon";
|
|
import { LinkIcon } from "../../../design/components/Icon/native/redesign/generated/LinkIcon";
|
|
import { SendMessageIcon } from "../../../design/components/Icon/native/redesign/generated/SendMessageIcon";
|
|
import { CopyIcon } from "../../../design/components/Icon/native/redesign/generated/CopyIcon";
|
|
import { DownloadIcon } from "../../../design/components/Icon/native/redesign/generated/DownloadIcon";
|
|
import { CheckmarkLargeIcon } from "../../../design/components/Icon/native/redesign/generated/CheckmarkLargeIcon";
|
|
import AvatarUtils from "../../../utils/AvatarUtils";
|
|
import { XLargeIcon } from "../../../design/components/Icon/native/redesign/generated/XLargeIcon";
|
|
import { CircleInformationIcon } from "../../../design/components/Icon/native/redesign/generated/CircleInformationIcon";
|
|
import { TrashIcon } from "../../../design/components/Icon/native/redesign/generated/TrashIcon";
|
|
import { v4 } from "../../../_bundle/Module514";
|
|
import { CircleCheckIcon } from "../../../design/components/Icon/native/redesign/generated/CircleCheckIcon";
|
|
import { ClockIcon } from "../../../design/components/Icon/native/redesign/generated/ClockIcon";
|
|
export function presentAddedFriendToast() {
|
|
ToastActionCreators.open({
|
|
key: "TOAST_ADD_FRIEND",
|
|
content: intl.string(t.Fn5bwO),
|
|
iconColor: "status-positive",
|
|
IconComponent: FriendsIcon
|
|
});
|
|
}
|
|
export function presentFriendRequestAcceptedToast(a0) {
|
|
ToastActionCreators.open({
|
|
key: "TOAST_FRIEND_REQUEST_ACCEPTED",
|
|
content: a0 == null ? intl.string(t.UhJna5) : intl.formatToPlainString(t.b3eoD4, {
|
|
username: a0.username
|
|
}),
|
|
IconComponent: UserPlusIcon,
|
|
iconColor: "status-positive"
|
|
});
|
|
}
|
|
export function presentGameFriendRequestAcceptedToast() {
|
|
ToastActionCreators.open({
|
|
key: "TOAST_GAME_FRIEND_REQUEST_ACCEPTED",
|
|
content: intl.string(t.xjNLeZ),
|
|
IconComponent: UserPlatformIcon,
|
|
iconColor: "status-positive"
|
|
});
|
|
}
|
|
export function presentFriendRequestIgnoredToast() {
|
|
ToastActionCreators.open({
|
|
key: "TOAST_FRIEND_REQUEST_IGNORED",
|
|
content: intl.string(t.YlavlY),
|
|
IconComponent: UserMinusIcon,
|
|
iconColor: "icon-feedback-critical"
|
|
});
|
|
}
|
|
export function presentGameFriendRequestIgnoredToast() {
|
|
ToastActionCreators.open({
|
|
key: "TOAST_GAME_FRIEND_REQUEST_IGNORED",
|
|
content: intl.string(t.P6BzJP),
|
|
IconComponent: UserMinusIcon,
|
|
iconColor: "icon-feedback-critical"
|
|
});
|
|
}
|
|
export function presentLinkCopied() {
|
|
ToastActionCreators.open({
|
|
key: "LINK_COPIED",
|
|
content: intl.string(t["+5kSoW"]),
|
|
IconComponent: LinkIcon
|
|
});
|
|
}
|
|
export function presentInviteSent() {
|
|
ToastActionCreators.open({
|
|
key: "INVITE_SENT",
|
|
content: intl.string(t.sVwWdV),
|
|
IconComponent: SendMessageIcon
|
|
});
|
|
}
|
|
export function presentIdCopied() {
|
|
ToastActionCreators.open({
|
|
key: "TOAST_ID_COPIED",
|
|
content: intl.string(t.eNjAah),
|
|
IconComponent: CopyIcon
|
|
});
|
|
}
|
|
export function presentImageSaved() {
|
|
ToastActionCreators.open({
|
|
key: "TOAST_IMAGE_SAVED",
|
|
content: intl.string(t.cqpdJW),
|
|
IconComponent: DownloadIcon
|
|
});
|
|
}
|
|
export function presentVideoSaved() {
|
|
ToastActionCreators.open({
|
|
key: "TOAST_VIDEO_SAVED",
|
|
content: intl.string(t["cEK+1g"]),
|
|
IconComponent: DownloadIcon
|
|
});
|
|
}
|
|
export function presentGifSaved() {
|
|
ToastActionCreators.open({
|
|
key: "TOAST_GIF_SAVED",
|
|
content: intl.string(t.LktEtN),
|
|
IconComponent: DownloadIcon
|
|
});
|
|
}
|
|
export function presentMessageCopied() {
|
|
ToastActionCreators.open({
|
|
key: "TOAST_MESSAGE_COPIED",
|
|
content: intl.string(t.R3o53R),
|
|
IconComponent: CopyIcon
|
|
});
|
|
}
|
|
export function presentMessageIdCopied() {
|
|
ToastActionCreators.open({
|
|
key: "TOAST_MESSAGE_ID_COPIED",
|
|
content: intl.string(t.svRBmK),
|
|
IconComponent: CopyIcon
|
|
});
|
|
}
|
|
export function presentPostIdCopied() {
|
|
ToastActionCreators.open({
|
|
key: "TOAST_FORUM_POST_ID_COPIED",
|
|
content: intl.string(t.aBQ2RP),
|
|
IconComponent: CopyIcon
|
|
});
|
|
}
|
|
export function presentUsernameCopied() {
|
|
ToastActionCreators.open({
|
|
key: "TOAST_USERNAME_SAVED",
|
|
content: intl.string(t["FHVR/+"]),
|
|
IconComponent: CopyIcon
|
|
});
|
|
}
|
|
export function presentFeedbackSent() {
|
|
ToastActionCreators.open({
|
|
key: "TOAST_FEEDBACK_SENT",
|
|
content: intl.string(t.xpiDtu),
|
|
IconComponent: CheckmarkLargeIcon,
|
|
iconColor: "status-positive"
|
|
});
|
|
}
|
|
export function presentEmoji(a0) {
|
|
ToastActionCreators.open({
|
|
key: `PRESENT_EMOJI-${a0.id}`,
|
|
content: `:${a0.name}:`,
|
|
icon: {
|
|
uri: AvatarUtils.getEmojiURL({
|
|
id: a0.id,
|
|
animated: a0.animated,
|
|
size: 48
|
|
})
|
|
}
|
|
});
|
|
}
|
|
export function presentNoiseCancellation(a0) {
|
|
ToastActionCreators.open({
|
|
key: "NOISE_CANCELLATION_TOGGLE",
|
|
content: a0 ? intl.string(t["Q+fhfv"]) : intl.string(t.hEMHnF),
|
|
IconComponent: a0 ? CheckmarkLargeIcon : XLargeIcon,
|
|
iconColor: a0 ? "status-positive" : "icon-feedback-critical"
|
|
});
|
|
}
|
|
export function presentNoiseCancellationError() {
|
|
ToastActionCreators.open({
|
|
key: "MOBILE_NOISE_CANCELLATION_CPU_OVERUSE",
|
|
content: intl.string(t.DnmX2G),
|
|
IconComponent: XLargeIcon,
|
|
iconColor: "icon-feedback-critical"
|
|
});
|
|
}
|
|
export function presentError(a0) {
|
|
ToastActionCreators.open({
|
|
key: "ERROR",
|
|
content: a0,
|
|
IconComponent: XLargeIcon,
|
|
iconColor: "icon-feedback-critical"
|
|
});
|
|
}
|
|
export function presentVoiceActivityDetectionError() {
|
|
ToastActionCreators.open({
|
|
key: "MOBILE_ADVANCED_VOICE_ACTIVITY_CPU_OVERUSE",
|
|
content: intl.string(t.zz1Tft),
|
|
IconComponent: XLargeIcon,
|
|
iconColor: "icon-feedback-critical"
|
|
});
|
|
}
|
|
export function roleIdCopied(a0) {
|
|
ToastActionCreators.open({
|
|
key: `ROLE_ID_COPIED-${a0}`,
|
|
content: intl.formatToPlainString(t.iOWpeB, {
|
|
role: a0
|
|
}),
|
|
IconComponent: CopyIcon
|
|
});
|
|
}
|
|
export function communityRequirementSatisfied() {
|
|
ToastActionCreators.open({
|
|
key: "ENABLE_COMMUNITY_MODAL_REQUIREMENT_SATISFIED_TOOLTIP",
|
|
content: intl.string(t.PHjrpp),
|
|
IconComponent: CheckmarkLargeIcon,
|
|
iconColor: "status-positive"
|
|
});
|
|
}
|
|
export function communityAdminOnly() {
|
|
ToastActionCreators.open({
|
|
key: "GUILD_SETTINGS_COMMUNITY_ADMINISTRATOR_ONLY",
|
|
content: intl.string(t["pjG+T3"]),
|
|
IconComponent: CircleInformationIcon
|
|
});
|
|
}
|
|
export function unverifiedVoiceGate(a0) {
|
|
let content;
|
|
const { notClaimed, notEmailVerified, notPhoneVerified, newAccount, newMember } = a0;
|
|
let missingVerificationRole = a0.missingVerificationRole;
|
|
const verificationRole = a0.verificationRole;
|
|
if (notClaimed) {
|
|
content = intl.string(t.IRxUlG);
|
|
} else if (notPhoneVerified) {
|
|
content = intl.string(t.vW8iUF);
|
|
} else if (notEmailVerified) {
|
|
content = intl.string(t.vdSOpz);
|
|
} else if (newMember) {
|
|
content = intl.formatToPlainString(t.v1ktYb, {
|
|
min: VerificationCriteria.MEMBER_AGE
|
|
});
|
|
} else if (newAccount) {
|
|
content = intl.formatToPlainString(t.sncw41, {
|
|
min: VerificationCriteria.ACCOUNT_AGE
|
|
});
|
|
} else {
|
|
if (missingVerificationRole) {
|
|
missingVerificationRole = verificationRole != null;
|
|
}
|
|
content = missingVerificationRole ? intl.formatToPlainString(t.MZbCuG, {
|
|
roleName: `@${verificationRole.name}`
|
|
}) : null;
|
|
}
|
|
if (content != null) {
|
|
ToastActionCreators.open({
|
|
key: "UNVERIFIED_VOICE_GATE",
|
|
content,
|
|
IconComponent: CircleInformationIcon
|
|
});
|
|
}
|
|
}
|
|
export function transferOwnershipProtected() {
|
|
ToastActionCreators.open({
|
|
key: "TRANSFER_OWNERSHIP_PROTECTED_GUILD",
|
|
content: intl.string(t.wDkfrN),
|
|
IconComponent: CircleInformationIcon
|
|
});
|
|
}
|
|
export function memberOrRoleRemovedToast(a0) {
|
|
ToastActionCreators.open({
|
|
key: "PRIVATE_CHANNEL_MEMBERS_REMOVED",
|
|
content: intl.formatToPlainString(t.vJGtXc, {
|
|
name: a0
|
|
}),
|
|
IconComponent: TrashIcon
|
|
});
|
|
}
|
|
export function memberOrRoleAddedToast(a0, a1) {
|
|
const content = a0 > 0 && a1 > 0 ? intl.string(t.fRD8wW) : a0 > 0 ? intl.formatToPlainString(t["yM/8JE"], {
|
|
count: a0
|
|
}) : a1 > 0 ? intl.formatToPlainString(t.yvV5Ye, {
|
|
count: a1
|
|
}) : void 0;
|
|
if (content != null) {
|
|
ToastActionCreators.open({
|
|
key: "MEMBER_OR_ROLE_ADDED",
|
|
content,
|
|
IconComponent: CheckmarkLargeIcon,
|
|
iconColor: "status-positive"
|
|
});
|
|
}
|
|
}
|
|
export function roleTemplateAppliedToast() {
|
|
ToastActionCreators.open({
|
|
key: "ROLE_PERMISSION_TEMPLATE_SELECT_CONFIRMATION_TOAST",
|
|
content: intl.string(t.e6xHUV),
|
|
IconComponent: CheckmarkLargeIcon,
|
|
iconColor: "status-positive"
|
|
});
|
|
}
|
|
export function roleCreatedToast() {
|
|
ToastActionCreators.open({
|
|
key: "ROLE_CREATED_TOAST",
|
|
content: intl.string(t.kubT4R),
|
|
IconComponent: CheckmarkLargeIcon,
|
|
iconColor: "status-positive"
|
|
});
|
|
}
|
|
export function roleCreateFailedToast() {
|
|
ToastActionCreators.open({
|
|
key: "ROLE_CREATION_FAILED",
|
|
content: intl.string(t.hbr6Uj),
|
|
IconComponent: XLargeIcon,
|
|
iconColor: "icon-feedback-critical"
|
|
});
|
|
}
|
|
export function presentFailedToast(a0) {
|
|
ToastActionCreators.open({
|
|
key: "FAILED",
|
|
content: a0,
|
|
IconComponent: XLargeIcon,
|
|
iconColor: "icon-feedback-critical"
|
|
});
|
|
}
|
|
export function presentCommandCopied() {
|
|
ToastActionCreators.open({
|
|
key: "TOAST_COMMAND_COPIED",
|
|
content: intl.string(t.U989ct),
|
|
IconComponent: LinkIcon
|
|
});
|
|
}
|
|
export function presentGuildMemberBio(a0, c13717_0) {
|
|
ToastActionCreators.open({
|
|
key: "GUILD_IDENTITY_BIO_TOAST",
|
|
content: intl.formatToPlainString(t.pOy2tm, {
|
|
guildName: a0
|
|
}),
|
|
icon: () => c13717_0
|
|
});
|
|
}
|
|
export function presentGuildMemberPronouns(a0, c13718_0) {
|
|
ToastActionCreators.open({
|
|
key: "GUILD_IDENTITY_PRONOUNS_TOAST",
|
|
content: intl.formatToPlainString(t.gPVLS0, {
|
|
guildName: a0
|
|
}),
|
|
icon: () => c13718_0
|
|
});
|
|
}
|
|
export function presentUserPronouns() {
|
|
ToastActionCreators.open({
|
|
key: "USER_POPOUT_PRONOUNS",
|
|
content: intl.string(t["1w6drw"])
|
|
});
|
|
}
|
|
export function presentCopiedToClipboard() {
|
|
ToastActionCreators.open({
|
|
key: `COPIED_TEXT_${v4()}`,
|
|
content: intl.string(t.mGZ66D),
|
|
IconComponent: CopyIcon
|
|
});
|
|
}
|
|
export function presentGuildRoleSubscriptionTrialTierMonthCost() {
|
|
ToastActionCreators.open({
|
|
key: "GUILD_ROLE_SUBSCRIPTION_MANAGE_SUBSCRIPTION_PAGE_TRIAL_PRICE_INFO",
|
|
content: intl.string(t["/q6fpa"]),
|
|
IconComponent: CircleInformationIcon
|
|
});
|
|
}
|
|
export function showVoiceRecordingFailed() {
|
|
ToastActionCreators.open({
|
|
key: "VOICE_MESSAGES_RECORDING_FAILED",
|
|
content: intl.string(t.H03AqF),
|
|
IconComponent: XLargeIcon,
|
|
iconColor: "icon-feedback-critical"
|
|
});
|
|
}
|
|
export function showMaxGroupMembers() {
|
|
ToastActionCreators.open({
|
|
key: "GROUP_DM_INVITE_FULL_MAIN",
|
|
content: intl.string(t.OtTQDz),
|
|
IconComponent: XLargeIcon,
|
|
iconColor: "icon-feedback-critical"
|
|
});
|
|
}
|
|
export function showTransferOwnershipSuccess() {
|
|
ToastActionCreators.open({
|
|
key: "TRANSFER_OWNERSHIP_SUCCESS",
|
|
content: intl.string(t["2Eyydu"]),
|
|
IconComponent: CheckmarkLargeIcon,
|
|
iconColor: "status-positive"
|
|
});
|
|
}
|
|
export function showSafetySuccess(a0, a1) {
|
|
ToastActionCreators.open({
|
|
key: a0,
|
|
content: a1,
|
|
IconComponent: CircleCheckIcon,
|
|
iconColor: "status-positive"
|
|
});
|
|
}
|
|
export function showVerificationSent() {
|
|
ToastActionCreators.open({
|
|
key: "VERIFICATION_RESENT",
|
|
content: intl.string(t.gI8IST),
|
|
IconComponent: CheckmarkLargeIcon,
|
|
iconColor: "status-positive"
|
|
});
|
|
}
|
|
export function presentTimestamp(a0) {
|
|
ToastActionCreators.open({
|
|
key: "MESSAGE_TIMESTAMP",
|
|
content: a0,
|
|
IconComponent: ClockIcon
|
|
});
|
|
}
|