Files
discord-decomp/sources/modules/premium/native/gifting/PremiumGiftSuccess.tsx
T
2026-07-28 01:06:53 +03:00

108 lines
7.9 KiB
TypeScript

/* Metro module 10463; source: modules/premium/native/gifting/PremiumGiftSuccess.tsx; dependencies: [31, 27, 7261, 1376, 33, 4501, 697, 1585, 7669, 44, 10464, 10392, 7675, 566, 1367, 1365, 10465, 10466, 10467, 2] */
import Module00044 from '../../../../by-id/module-00044.js'; /* Metro dependency 44 */
import UseSafeAreaInsetsNative from '../../../safe_area/useSafeAreaInsets.native.tsx'; /* Metro dependency 1585 */
import PromotionsStore from '../../promotions/PromotionsStore.tsx'; /* Metro dependency 7261 */
import UseShouldShowGiftingPromotionDeco from '../../gifting/native/hooks/useShouldShowGiftingPromotionDeco.tsx'; /* Metro dependency 10392 */
import UseGiftingPromotionConfig from '../../gifting/hooks/useGiftingPromotionConfig.tsx'; /* Metro dependency 10464 */
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 JsxRuntimeModule from '../../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
import * as FluxModule from '../../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as DismissibleContentConstantsModule from '../../../dismissible_content/DismissibleContentConstants.tsx'; /* Metro dependency 1376 */
import * as CreateStylesModule from '../../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as NativeGiftContextModule from '../../../payments/native/NativeGiftContext.tsx'; /* Metro dependency 7669 */
import * as UseFetchCollectiblesCategoriesAndPurchasesModule from '../../../collectibles/hooks/useFetchCollectiblesCategoriesAndPurchases.tsx'; /* Metro dependency 7675 */
function _fun80981(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80981, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10649:6, offset: 0x01e931f3, size: 253 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_10 = (CreateStylesModule).createStyles(_fun80982);
(FileImportTrackerModule).fileFinishedImporting('modules/premium/native/gifting/PremiumGiftSuccess.tsx');
exports.default = PremiumGiftSuccess;
function _fun80982(a0) { // fn#80982, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10649:230, offset: 0x01e932f0, size: 250 bytes, params: 2, frame: 17
const object = {};
const object2 = {'backgroundColor': null, 'paddingHorizontal': null, 'flex': 1, 'alignContent': 'center',
'justifyContent': 'center', 'flexGrow': 1};
let BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object2.backgroundColor = BACKGROUND_BASE_LOW;
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object2.paddingHorizontal = PX_16;
object.bodyContainer = object2;
const object3 = {};
BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object3.backgroundColor = BACKGROUND_BASE_LOW;
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object3.paddingTop = PX_16;
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object3.paddingBottom = a0 + PX_16;
const PX_162 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object3.paddingHorizontal = PX_162;
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object3.gap = PX_8;
const SHADOW_TOP_LOW = (importDefault(697) /* metro dependency 697: native */).shadows.SHADOW_TOP_LOW;
copyDataProperties(object3, SHADOW_TOP_LOW, PX_16);
object.actionContainer = object3;
return object;
}
function PremiumGiftSuccess() { // fn#80983, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10649:737, offset: 0x01e933ea, size: 560 bytes, params: 1, frame: 24
const styles = useStyles((UseSafeAreaInsetsNative)().bottom);
const {recipientUser, giftCodeRecord,
selectedGiftingPromotionReward} = (NativeGiftContextModule).useNativeGiftContext();
(Module00044)(giftCodeRecord != null,
'Gift code record cannot be null on success screen');
const value3 = (UseGiftingPromotionConfig)();
const value4 = (UseShouldShowGiftingPromotionDeco)();
const value5 = (UseFetchCollectiblesCategoriesAndPurchasesModule).useGetOrFetchPurchase(selectedGiftingPromotionReward,
false);
ReactModule.useEffect(_fun80985, [value4, value3,
(FluxModule).useStateFromStores([PromotionsStore], _fun80984)]);
return (
<>
<View style={styles.bodyContainer}>
{
recipientUser == null
? ((Component) => <Component giftCodeRecord={giftCodeRecord} />)(importDefault(10465) /* metro dependency 10465: PremiumGiftPurchaseSuccess */)
: ((Component) => <Component />)(importDefault(10466) /* metro dependency 10466: PremiumGiftDMPurchaseSuccess */)
}
</View>
<View style={styles.actionContainer}>
{
value5 != null
? ((Component) => <Component purchase={value5} />)(importDefault(10467) /* metro dependency 10467: PremiumGiftingPromotionSuccessActions */)
: (
recipientUser == null
? ((PremiumGiftSuccessActions) => <PremiumGiftSuccessActions giftCodeRecord={giftCodeRecord} />)((require(10465) /* metro dependency 10465: PremiumGiftPurchaseSuccess */).PremiumGiftSuccessActions)
: ((PremiumGiftDMSuccessActions) => <PremiumGiftDMSuccessActions />)((require(10466) /* metro dependency 10466: PremiumGiftDMPurchaseSuccess */).PremiumGiftDMSuccessActions)
)
}
</View>
</>
);
function _fun80984() { // fn#80984, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10649:1075, offset: 0x01e9361a, size: 35 bytes, params: 1, frame: 10
const value = environment.__proto__;
return PromotionsStore.getGiftPromotion()?.id;
}
function _fun80985() { // fn#80985, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10649:1152, offset: 0x01e9363d, size: 140 bytes, params: 1, frame: 18
var value5;
var moduleValue;
if (env0_0 != null && env0_0.reminderNotice != null && env0_1 && env0_2 != null) {
value5 = environment.__proto__;
moduleValue = require(1367) /* metro dependency 1367: DismissibleContentUtils */;
moduleValue.markSnowflakeBoundDismissibleContentAsDismissed((require(1365) /* metro dependency 1365: dismissible_content */).DismissibleContent.GIFTING_PROMOTION_REMINDER,
env0_2, {dismissAction: ContentDismissActionType.INDIRECT_ACTION});
}
}
}
}
global.__d(_fun80981, 10463, [31, 27, 7261, 1376, 33, 4501, 697, 1585, 7669, 44, 10464, 10392, 7675, 566, 1367,
1365, 10465, 10466, 10467,
2]) /* metro module 10463, dependencies: [31, 27, 7261, 1376, 33, 4501, 697, 1585, 7669, 44, 10464, 10392, 7675, 566, 1367, 1365, 10465, 10466, 10467, 2] */;