72 lines
2.7 KiB
TypeScript
72 lines
2.7 KiB
TypeScript
// Metro module 11889 (f11890).
|
|
import { useCallback } from "react";
|
|
import { Image as Image2 } from "react-native";
|
|
import { UserSettingsSections } from "../../../../Constants";
|
|
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
|
|
import Module712 from "../../../../_bundle/Module712";
|
|
import { GIFT_STYLE_IMG } from "../../../premium/native/gifting/PremiumGiftBackgroundSelectTile";
|
|
import { GiftingBadgeExperiment } from "../../../premium/gifting/experiments/GiftingBadgeExperiment";
|
|
import ModalActionCreators from "../../../../actions/ModalActionCreators";
|
|
import { openUserSettings } from "../../../user_settings/core/native/openUserSettings";
|
|
import Alert from "../../../../components_native/common/Alert";
|
|
import { Text } from "../../../../design/components/Text/native/Text";
|
|
import { intl, t } from "../../../../intl/index.native";
|
|
import { BaseTextButton } from "../../../../design/components/Button/native/BaseTextButton.native";
|
|
const useStyles = createStyles({
|
|
alertContainer: {
|
|
paddingHorizontal: Module712.space.PX_24,
|
|
paddingBottom: Module712.space.PX_24,
|
|
alignItems: "center"
|
|
},
|
|
image: {
|
|
position: "relative",
|
|
top: -50
|
|
},
|
|
title: {
|
|
marginTop: -Module712.space.PX_24,
|
|
marginBottom: Module712.space.PX_8
|
|
},
|
|
description: {
|
|
marginBottom: Module712.space.PX_24
|
|
}
|
|
});
|
|
export default function UnifiedGiftModalSuccessScreen(props) {
|
|
const { giftStyle, giftBadgeProgress, onClose } = props;
|
|
const styles = useStyles();
|
|
const source = GIFT_STYLE_IMG[giftStyle];
|
|
const enabled = GiftingBadgeExperiment.useConfig({
|
|
location: "UnifiedGiftModalSuccessScreen"
|
|
}).enabled;
|
|
const callback2 = useCallback(() => {
|
|
onClose();
|
|
let r9 = enabled;
|
|
if (enabled) {
|
|
r9 = giftBadgeProgress != null;
|
|
}
|
|
if (r9) {
|
|
ModalActionCreators.pushLazy(import("../../../collectibles/native/CollectiblesShopGiftBadgePostPurchaseModal"), {
|
|
giftBadgeProgress
|
|
}, "collectibles_shop_gift_badge_modal");
|
|
}
|
|
}, [enabled, giftBadgeProgress, onClose]);
|
|
const callback = useCallback(() => {
|
|
onClose();
|
|
openUserSettings({
|
|
screen: UserSettingsSections.PREMIUM_GIFTING,
|
|
params: {}
|
|
});
|
|
}, [onClose]);
|
|
return <Alert onClose={callback2} noDefaultButtons style={styles.alertContainer}>
|
|
<Image2 source={source} style={styles.image} />
|
|
<Text variant="heading-lg/bold" style={styles.title}>
|
|
{intl.string(t.MqZXbv)}
|
|
</Text>
|
|
<Text variant="text-md/medium" style={styles.description}>
|
|
{intl.format(t.YS2J4S, {
|
|
onClick: callback
|
|
})}
|
|
</Text>
|
|
<BaseTextButton onPress={callback2} text={intl.string(enabled && giftBadgeProgress != null ? t.PDTjLN : t.cpT0Cq)} textVariant="text-md/semibold" grow />
|
|
</Alert>;
|
|
};
|