Files
discord-decomp/modules/collectibles/native/UnlockWithNitroButton.tsx
T
2026-11-01 12:12:55 +02:00

33 lines
1.8 KiB
TypeScript

// Metro module 11914 (f11915).
import IAPStore_android from "../../../stores/native/IAPStore.android";
import CollectiblesPurchaseStore from "../CollectiblesPurchaseStore";
import { ShopCtaEnum } from "../CollectiblesShopConstants";
import { useStateFromStores } from "../../../_bundle/Module589";
import { ProductIds } from "../../premium/native/ProductIds.android";
import useOpenNitroSubscribeActionSheet from "./useOpenNitroSubscribeActionSheet";
import { intl, t } from "../../../intl/index.native";
import { BaseTextButton } from "../../../design/components/Button/native/BaseTextButton.native";
import { Text } from "../../../design/components/Text/native/Text";
import { NitroWheelIcon } from "../../../design/components/Icon/native/redesign/generated/NitroWheelIcon";
export function UnlockWithNitroButton(props) {
let shouldShrink = props.shouldShrink;
if (shouldShrink === void 0) {
shouldShrink = false;
}
let c19267_1;
const onTrackPress = props.onTrackPress;
let text = props.text;
c19267_1 = void 0;
const stateFromStores = useStateFromStores([CollectiblesPurchaseStore, IAPStore_android], () => CollectiblesPurchaseStore.isClaiming != null || IAPStore_android.isPurchasingProduct(ProductIds.GENERIC_CONSUMABLE));
c19267_1 = useOpenNitroSubscribeActionSheet();
if (text == null) {
text = intl.string(t.sEAnVH);
}
return <BaseTextButton textElement={shouldShrink ? <Text variant="text-xs/semibold" color="text-overlay-light" allowFontScaling={false}>{text}</Text> : void 0} text={shouldShrink ? void 0 : text} accessibilityLabel={text} variant="primary" size={shouldShrink ? "sm" : "md"} grow icon={<NitroWheelIcon size="sm" color="white" />} onPress={() => {
if (onTrackPress != null) {
onTrackPress(ShopCtaEnum.UNLOCK_WITH_NITRO);
}
c19267_1();
}} disabled={stateFromStores} />;
}