Files
discord-decomp/modules/game_profile/native/components/GameProfileGameClaimCta.tsx
T
2026-11-01 12:12:55 +02:00

19 lines
1.3 KiB
TypeScript

// Metro module 11941 (f11942).
import { useCallback } from "react";
import { RelativeMarketingURLs } from "../../../../Constants";
import { GameProfileTrackActionActions } from "../../GameProfileAnalyticUtils";
import MobileWebHandoffLinking from "../../../mobile_web_handoff/native/MobileWebHandoffLinking";
import { GameLinkTypes } from "../../../../flow/Server";
import { Button } from "../../../../design/components/Button/native/Button.native";
import { intl, t } from "../../../../intl/index.native";
export default function GameProfileGameClaimCta(props) {
const { game, trackAction } = props;
const callback = useCallback(async () => {
trackAction(GameProfileTrackActionActions.ClaimGame);
await MobileWebHandoffLinking.redirectDeveloperPortalWithHandoffToken(RelativeMarketingURLs.DEVELOPER_PORTAL_APPLICATIONS_GAME_IDENTITY);
}, [trackAction]);
const linkedApplications = game.linkedApplications;
const r18 = linkedApplications == null ? void 0 : linkedApplications.some((linkedApplication) => linkedApplication.type === GameLinkTypes.OFFICIAL);
return r18 != null ? r18 ? null : <Button variant="secondary" size="md" text={intl.string(t["mqg+to"])} onPress={callback} /> : <Button variant="secondary" size="md" text={intl.string(t["mqg+to"])} onPress={callback} />;
};