@tyrads.com/tyrads-sdk 3.0.0-beta.0 → 3.2.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/tyradssdk/TyradsSdkModule.kt +130 -29
- package/ios/Tyrads/AcmoAssets.swift +14 -0
- package/ios/Tyrads/ApiHeaders.swift +1 -0
- package/ios/Tyrads/InitModel.swift +3 -0
- package/ios/Tyrads/Tyrads.swift +255 -213
- package/ios/Tyrads/WebViewController.swift +195 -0
- package/ios/Tyrads/core/utils/AcmoKeyNames.swift +29 -0
- package/ios/Tyrads/core/utils/ColorExtension.swift +55 -0
- package/ios/Tyrads/core/utils/Services/LocalizationService.swift +175 -0
- package/ios/Tyrads/helpers/device_details.swift +160 -0
- package/ios/Tyrads/legal/AcmoPrivacyPage.swift +353 -0
- package/ios/Tyrads/legal/PrivacyPageController.swift +31 -0
- package/ios/Tyrads/user/AcmoUserUpdatePage.swift +302 -0
- package/ios/Tyrads/user/AcmoUsersUpdateController.swift +26 -0
- package/ios/Tyrads/user/Repository.swift +89 -0
- package/ios/TyradsSdk.mm +22 -4
- package/ios/TyradsSdk.swift +101 -31
- package/lib/commonjs/acmo/core/helpers/launcher.js +20 -0
- package/lib/commonjs/acmo/core/helpers/launcher.js.map +1 -0
- package/lib/commonjs/acmo/core/helpers/native_methods.js +37 -0
- package/lib/commonjs/acmo/core/helpers/native_methods.js.map +1 -0
- package/lib/commonjs/acmo/core/helpers/numeral.js +19 -0
- package/lib/commonjs/acmo/core/helpers/numeral.js.map +1 -0
- package/lib/commonjs/acmo/core/services/localization_service.js +164 -0
- package/lib/commonjs/acmo/core/services/localization_service.js.map +1 -0
- package/lib/commonjs/acmo/core/storage/storage.js +15 -1
- package/lib/commonjs/acmo/core/storage/storage.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/active_offers_button.js +79 -0
- package/lib/commonjs/acmo/modules/dashboard/components/active_offers_button.js.map +1 -0
- package/lib/commonjs/acmo/modules/dashboard/components/custom_card.js +7 -10
- package/lib/commonjs/acmo/modules/dashboard/components/custom_card.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/custom_scroller.js +141 -0
- package/lib/commonjs/acmo/modules/dashboard/components/custom_scroller.js.map +1 -0
- package/lib/commonjs/acmo/{core/marquee.js → modules/dashboard/components/custom_shimmer.js} +46 -34
- package/lib/commonjs/acmo/modules/dashboard/components/custom_shimmer.js.map +1 -0
- package/lib/commonjs/acmo/modules/dashboard/components/offer_card.js +263 -0
- package/lib/commonjs/acmo/modules/dashboard/components/offer_card.js.map +1 -0
- package/lib/commonjs/acmo/modules/dashboard/components/offer_list_item.js +203 -0
- package/lib/commonjs/acmo/modules/dashboard/components/offer_list_item.js.map +1 -0
- package/lib/commonjs/acmo/modules/dashboard/components/premium_empty_widget.js +87 -0
- package/lib/commonjs/acmo/modules/dashboard/components/premium_empty_widget.js.map +1 -0
- package/lib/commonjs/acmo/modules/dashboard/components/premium_header.js +16 -14
- package/lib/commonjs/acmo/modules/dashboard/components/premium_header.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/premium_loading.js +111 -0
- package/lib/commonjs/acmo/modules/dashboard/components/premium_loading.js.map +1 -0
- package/lib/commonjs/acmo/modules/dashboard/repository.js +108 -32
- package/lib/commonjs/acmo/modules/dashboard/repository.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/top_offers.js +85 -63
- package/lib/commonjs/acmo/modules/dashboard/top_offers.js.map +1 -1
- package/lib/commonjs/acmo/modules/localization/localization_context.js +56 -0
- package/lib/commonjs/acmo/modules/localization/localization_context.js.map +1 -0
- package/lib/commonjs/assets/images/angle_up.png +0 -0
- package/lib/commonjs/assets/images/diamond.png +0 -0
- package/lib/commonjs/assets/images/info.png +0 -0
- package/lib/commonjs/assets/images/info_icon.png +0 -0
- package/lib/commonjs/assets/images/premium-emptybg.jpeg +0 -0
- package/lib/commonjs/assets/images/rank_1.png +0 -0
- package/lib/commonjs/assets/images/rank_2.png +0 -0
- package/lib/commonjs/assets/images/rank_3.png +0 -0
- package/lib/commonjs/assets/images/rank_4.png +0 -0
- package/lib/commonjs/assets/images/rank_5.png +0 -0
- package/lib/commonjs/index.js +50 -16
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/acmo/core/helpers/launcher.js +15 -0
- package/lib/module/acmo/core/helpers/launcher.js.map +1 -0
- package/lib/module/acmo/core/helpers/native_methods.js +33 -0
- package/lib/module/acmo/core/helpers/native_methods.js.map +1 -0
- package/lib/module/acmo/core/helpers/numeral.js +14 -0
- package/lib/module/acmo/core/helpers/numeral.js.map +1 -0
- package/lib/module/acmo/core/services/localization_service.js +159 -0
- package/lib/module/acmo/core/services/localization_service.js.map +1 -0
- package/lib/module/acmo/core/storage/storage.js +13 -0
- package/lib/module/acmo/core/storage/storage.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/components/active_offers_button.js +73 -0
- package/lib/module/acmo/modules/dashboard/components/active_offers_button.js.map +1 -0
- package/lib/module/acmo/modules/dashboard/components/custom_card.js +7 -10
- package/lib/module/acmo/modules/dashboard/components/custom_card.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/components/custom_scroller.js +135 -0
- package/lib/module/acmo/modules/dashboard/components/custom_scroller.js.map +1 -0
- package/lib/module/acmo/modules/dashboard/components/custom_shimmer.js +66 -0
- package/lib/module/acmo/modules/dashboard/components/custom_shimmer.js.map +1 -0
- package/lib/module/acmo/modules/dashboard/components/offer_card.js +257 -0
- package/lib/module/acmo/modules/dashboard/components/offer_card.js.map +1 -0
- package/lib/module/acmo/modules/dashboard/components/offer_list_item.js +197 -0
- package/lib/module/acmo/modules/dashboard/components/offer_list_item.js.map +1 -0
- package/lib/module/acmo/modules/dashboard/components/premium_empty_widget.js +82 -0
- package/lib/module/acmo/modules/dashboard/components/premium_empty_widget.js.map +1 -0
- package/lib/module/acmo/modules/dashboard/components/premium_header.js +16 -14
- package/lib/module/acmo/modules/dashboard/components/premium_header.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/components/premium_loading.js +106 -0
- package/lib/module/acmo/modules/dashboard/components/premium_loading.js.map +1 -0
- package/lib/module/acmo/modules/dashboard/repository.js +105 -30
- package/lib/module/acmo/modules/dashboard/repository.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/top_offers.js +86 -64
- package/lib/module/acmo/modules/dashboard/top_offers.js.map +1 -1
- package/lib/module/acmo/modules/localization/localization_context.js +45 -0
- package/lib/module/acmo/modules/localization/localization_context.js.map +1 -0
- package/lib/module/assets/images/angle_up.png +0 -0
- package/lib/module/assets/images/diamond.png +0 -0
- package/lib/module/assets/images/info.png +0 -0
- package/lib/module/assets/images/info_icon.png +0 -0
- package/lib/module/assets/images/premium-emptybg.jpeg +0 -0
- package/lib/module/assets/images/rank_1.png +0 -0
- package/lib/module/assets/images/rank_2.png +0 -0
- package/lib/module/assets/images/rank_3.png +0 -0
- package/lib/module/assets/images/rank_4.png +0 -0
- package/lib/module/assets/images/rank_5.png +0 -0
- package/lib/module/index.js +49 -17
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/commonjs/src/acmo/core/helpers/launcher.d.ts +3 -0
- package/lib/typescript/commonjs/src/acmo/core/helpers/launcher.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/core/helpers/native_methods.d.ts +6 -0
- package/lib/typescript/commonjs/src/acmo/core/helpers/native_methods.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/core/helpers/numeral.d.ts +2 -0
- package/lib/typescript/commonjs/src/acmo/core/helpers/numeral.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/core/services/localization_service.d.ts +18 -0
- package/lib/typescript/commonjs/src/acmo/core/services/localization_service.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/core/storage/storage.d.ts +1 -0
- package/lib/typescript/commonjs/src/acmo/core/storage/storage.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/active_offers_button.d.ts +9 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/active_offers_button.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_card.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_scroller.d.ts +17 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_scroller.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_shimmer.d.ts +11 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/custom_shimmer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_card.d.ts +12 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_card.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_list_item.d.ts +15 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_list_item.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_empty_widget.d.ts +7 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_empty_widget.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_header.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_loading.d.ts +8 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_loading.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/repository.d.ts +2 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/repository.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/top_offers.d.ts +8 -7
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/top_offers.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/localization/localization_context.d.ts +14 -0
- package/lib/typescript/commonjs/src/acmo/modules/localization/localization_context.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +8 -6
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/core/helpers/launcher.d.ts +3 -0
- package/lib/typescript/module/src/acmo/core/helpers/launcher.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/core/helpers/native_methods.d.ts +6 -0
- package/lib/typescript/module/src/acmo/core/helpers/native_methods.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/core/helpers/numeral.d.ts +2 -0
- package/lib/typescript/module/src/acmo/core/helpers/numeral.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/core/services/localization_service.d.ts +18 -0
- package/lib/typescript/module/src/acmo/core/services/localization_service.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/core/storage/storage.d.ts +1 -0
- package/lib/typescript/module/src/acmo/core/storage/storage.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/active_offers_button.d.ts +9 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/active_offers_button.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_card.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_scroller.d.ts +17 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_scroller.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_shimmer.d.ts +11 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/custom_shimmer.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_card.d.ts +12 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_card.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_list_item.d.ts +15 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_list_item.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_empty_widget.d.ts +7 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_empty_widget.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_header.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_loading.d.ts +8 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_loading.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/modules/dashboard/repository.d.ts +2 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/repository.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/top_offers.d.ts +8 -7
- package/lib/typescript/module/src/acmo/modules/dashboard/top_offers.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/localization/localization_context.d.ts +14 -0
- package/lib/typescript/module/src/acmo/modules/localization/localization_context.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +8 -6
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/package.json +3 -6
- package/readme.md +8 -8
- package/src/acmo/core/helpers/launcher.ts +14 -0
- package/src/acmo/core/helpers/native_methods.ts +43 -0
- package/src/acmo/core/helpers/numeral.ts +14 -0
- package/src/acmo/core/services/localization_service.ts +200 -0
- package/src/acmo/core/storage/storage.ts +14 -0
- package/src/acmo/core/types/types.d.ts +11 -13
- package/src/acmo/modules/dashboard/components/active_offers_button.tsx +62 -0
- package/src/acmo/modules/dashboard/components/custom_card.tsx +5 -8
- package/src/acmo/modules/dashboard/components/custom_scroller.tsx +164 -0
- package/src/acmo/modules/dashboard/components/custom_shimmer.tsx +75 -0
- package/src/acmo/modules/dashboard/components/offer_card.tsx +248 -0
- package/src/acmo/modules/dashboard/components/offer_list_item.tsx +228 -0
- package/src/acmo/modules/dashboard/components/premium_empty_widget.tsx +79 -0
- package/src/acmo/modules/dashboard/components/premium_header.tsx +14 -13
- package/src/acmo/modules/dashboard/components/premium_loading.tsx +72 -0
- package/src/acmo/modules/dashboard/repository.ts +121 -46
- package/src/acmo/modules/dashboard/top_offers.tsx +105 -53
- package/src/acmo/modules/localization/localization_context.tsx +52 -0
- package/src/assets/images/angle_up.png +0 -0
- package/src/assets/images/diamond.png +0 -0
- package/src/assets/images/info.png +0 -0
- package/src/assets/images/info_icon.png +0 -0
- package/src/assets/images/premium-emptybg.jpeg +0 -0
- package/src/assets/images/rank_1.png +0 -0
- package/src/assets/images/rank_2.png +0 -0
- package/src/assets/images/rank_3.png +0 -0
- package/src/assets/images/rank_4.png +0 -0
- package/src/assets/images/rank_5.png +0 -0
- package/src/index.tsx +76 -34
- package/lib/commonjs/acmo/core/marquee.js.map +0 -1
- package/lib/commonjs/acmo/modules/dashboard/components/auto_scroller.js +0 -87
- package/lib/commonjs/acmo/modules/dashboard/components/auto_scroller.js.map +0 -1
- package/lib/commonjs/acmo/modules/dashboard/components/my_games_button.js +0 -48
- package/lib/commonjs/acmo/modules/dashboard/components/my_games_button.js.map +0 -1
- package/lib/commonjs/acmo/modules/dashboard/components/offer_info_section.js +0 -158
- package/lib/commonjs/acmo/modules/dashboard/components/offer_info_section.js.map +0 -1
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_1.js +0 -180
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_1.js.map +0 -1
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_2.js +0 -102
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_2.js.map +0 -1
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_3.js +0 -41
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_3.js.map +0 -1
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_4.js +0 -214
- package/lib/commonjs/acmo/modules/dashboard/components/premium_option_4.js.map +0 -1
- package/lib/commonjs/i18n.js +0 -112
- package/lib/commonjs/i18n.js.map +0 -1
- package/lib/module/acmo/core/marquee.js +0 -54
- package/lib/module/acmo/core/marquee.js.map +0 -1
- package/lib/module/acmo/modules/dashboard/components/auto_scroller.js +0 -81
- package/lib/module/acmo/modules/dashboard/components/auto_scroller.js.map +0 -1
- package/lib/module/acmo/modules/dashboard/components/my_games_button.js +0 -43
- package/lib/module/acmo/modules/dashboard/components/my_games_button.js.map +0 -1
- package/lib/module/acmo/modules/dashboard/components/offer_info_section.js +0 -153
- package/lib/module/acmo/modules/dashboard/components/offer_info_section.js.map +0 -1
- package/lib/module/acmo/modules/dashboard/components/premium_option_1.js +0 -174
- package/lib/module/acmo/modules/dashboard/components/premium_option_1.js.map +0 -1
- package/lib/module/acmo/modules/dashboard/components/premium_option_2.js +0 -97
- package/lib/module/acmo/modules/dashboard/components/premium_option_2.js.map +0 -1
- package/lib/module/acmo/modules/dashboard/components/premium_option_3.js +0 -36
- package/lib/module/acmo/modules/dashboard/components/premium_option_3.js.map +0 -1
- package/lib/module/acmo/modules/dashboard/components/premium_option_4.js +0 -209
- package/lib/module/acmo/modules/dashboard/components/premium_option_4.js.map +0 -1
- package/lib/module/i18n.js +0 -107
- package/lib/module/i18n.js.map +0 -1
- package/lib/typescript/commonjs/src/acmo/core/marquee.d.ts +0 -11
- package/lib/typescript/commonjs/src/acmo/core/marquee.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/auto_scroller.d.ts +0 -10
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/auto_scroller.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/my_games_button.d.ts +0 -8
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/my_games_button.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_info_section.d.ts +0 -11
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_info_section.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_1.d.ts +0 -9
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_1.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_2.d.ts +0 -9
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_2.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_3.d.ts +0 -9
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_3.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_4.d.ts +0 -9
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_4.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/i18n.d.ts +0 -3
- package/lib/typescript/commonjs/src/i18n.d.ts.map +0 -1
- package/lib/typescript/module/src/acmo/core/marquee.d.ts +0 -11
- package/lib/typescript/module/src/acmo/core/marquee.d.ts.map +0 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/auto_scroller.d.ts +0 -10
- package/lib/typescript/module/src/acmo/modules/dashboard/components/auto_scroller.d.ts.map +0 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/my_games_button.d.ts +0 -8
- package/lib/typescript/module/src/acmo/modules/dashboard/components/my_games_button.d.ts.map +0 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_info_section.d.ts +0 -11
- package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_info_section.d.ts.map +0 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_1.d.ts +0 -9
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_1.d.ts.map +0 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_2.d.ts +0 -9
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_2.d.ts.map +0 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_3.d.ts +0 -9
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_3.d.ts.map +0 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_4.d.ts +0 -9
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_4.d.ts.map +0 -1
- package/lib/typescript/module/src/i18n.d.ts +0 -3
- package/lib/typescript/module/src/i18n.d.ts.map +0 -1
- package/src/acmo/core/marquee.tsx +0 -62
- package/src/acmo/modules/dashboard/components/auto_scroller.tsx +0 -85
- package/src/acmo/modules/dashboard/components/my_games_button.tsx +0 -40
- package/src/acmo/modules/dashboard/components/offer_info_section.tsx +0 -139
- package/src/acmo/modules/dashboard/components/premium_option_1.tsx +0 -163
- package/src/acmo/modules/dashboard/components/premium_option_2.tsx +0 -100
- package/src/acmo/modules/dashboard/components/premium_option_3.tsx +0 -42
- package/src/acmo/modules/dashboard/components/premium_option_4.tsx +0 -185
- package/src/i18n.ts +0 -115
@@ -0,0 +1,200 @@
|
|
1
|
+
import AsyncStorage from '@react-native-async-storage/async-storage';
|
2
|
+
import axios, { type AxiosInstance } from 'axios';
|
3
|
+
|
4
|
+
const BASE_URL = 'https://api.tyrads.com/v3.0/';
|
5
|
+
|
6
|
+
interface TranslationResponse {
|
7
|
+
data: Array<{
|
8
|
+
code: string;
|
9
|
+
sha256: string;
|
10
|
+
}>;
|
11
|
+
}
|
12
|
+
|
13
|
+
type Translations = {
|
14
|
+
[key: string]: string | Translations;
|
15
|
+
};
|
16
|
+
|
17
|
+
class LocalizationService {
|
18
|
+
private static instance: LocalizationService;
|
19
|
+
private axios: AxiosInstance | null = null;
|
20
|
+
private translations: Translations = {};
|
21
|
+
private supportedLocales: string[] = [];
|
22
|
+
private readonly fallbackLocale: string = 'en';
|
23
|
+
|
24
|
+
private constructor() {
|
25
|
+
}
|
26
|
+
|
27
|
+
public static getInstance(): LocalizationService {
|
28
|
+
if (!LocalizationService.instance) {
|
29
|
+
LocalizationService.instance = new LocalizationService();
|
30
|
+
}
|
31
|
+
return LocalizationService.instance;
|
32
|
+
}
|
33
|
+
|
34
|
+
private static async getHeadersFromStorage(): Promise<Record<string, string>> {
|
35
|
+
try {
|
36
|
+
const data = await AsyncStorage.getItem('credentials');
|
37
|
+
return data ? JSON.parse(data) : {};
|
38
|
+
} catch (error) {
|
39
|
+
console.error('Failed to retrieve headers from AsyncStorage', error);
|
40
|
+
return {};
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
|
45
|
+
public async init(locale: string): Promise<void> {
|
46
|
+
if (this.axios) {
|
47
|
+
return;
|
48
|
+
}
|
49
|
+
|
50
|
+
const headers = await LocalizationService.getHeadersFromStorage();
|
51
|
+
|
52
|
+
this.axios = axios.create({
|
53
|
+
baseURL: BASE_URL,
|
54
|
+
timeout: 10000,
|
55
|
+
headers: {
|
56
|
+
'Content-Type': 'application/json',
|
57
|
+
Accept: 'application/json',
|
58
|
+
"X-API-Key": headers["X-API-Key"],
|
59
|
+
"X-API-Secret": headers["X-API-Secret"],
|
60
|
+
}
|
61
|
+
});
|
62
|
+
|
63
|
+
this.axios.interceptors.request.use(
|
64
|
+
(config) => {
|
65
|
+
console.log('====================================');
|
66
|
+
console.log(`Request: ${config.method} ${config.baseURL}${config.url}`);
|
67
|
+
console.log('Headers:', config.headers);
|
68
|
+
console.log('====================================');
|
69
|
+
return config;
|
70
|
+
},
|
71
|
+
(error) => {
|
72
|
+
return Promise.reject(error);
|
73
|
+
}
|
74
|
+
);
|
75
|
+
this.axios.interceptors.response.use(
|
76
|
+
(res) => {
|
77
|
+
console.log('====================================');
|
78
|
+
console.log('Response Data:', res.data);
|
79
|
+
console.log('====================================');
|
80
|
+
return res;
|
81
|
+
},
|
82
|
+
(error) => {
|
83
|
+
return Promise.reject(error);
|
84
|
+
}
|
85
|
+
);
|
86
|
+
await this.loadTranslations(locale);
|
87
|
+
}
|
88
|
+
|
89
|
+
private async loadTranslations(locale: string, force = false): Promise<void> {
|
90
|
+
const hasUpdate = await this.checkForUpdate(locale, force);
|
91
|
+
|
92
|
+
if (!hasUpdate) {
|
93
|
+
const cachedData = await AsyncStorage.getItem(`translations_${locale}`);
|
94
|
+
if (cachedData) {
|
95
|
+
try {
|
96
|
+
this.translations = JSON.parse(cachedData);
|
97
|
+
return;
|
98
|
+
} catch (e) {
|
99
|
+
console.error('Failed to parse cached translations', e);
|
100
|
+
}
|
101
|
+
}
|
102
|
+
}
|
103
|
+
|
104
|
+
await this.fetchTranslations(locale, force);
|
105
|
+
}
|
106
|
+
|
107
|
+
private async fetchTranslations(locale: string, force = false): Promise<void> {
|
108
|
+
if (!this.axios) return;
|
109
|
+
try {
|
110
|
+
let effectiveLocale = locale;
|
111
|
+
if (!this.supportedLocales.includes(locale)) {
|
112
|
+
effectiveLocale = this.fallbackLocale;
|
113
|
+
}
|
114
|
+
|
115
|
+
const response = await this.axios.get(
|
116
|
+
`translations/${effectiveLocale}`,
|
117
|
+
{
|
118
|
+
params: {
|
119
|
+
force,
|
120
|
+
format: 'nested',
|
121
|
+
},
|
122
|
+
}
|
123
|
+
);
|
124
|
+
|
125
|
+
if (response.status === 200) {
|
126
|
+
this.translations = response.data as Translations;
|
127
|
+
await AsyncStorage.setItem(`translations_${effectiveLocale}`, JSON.stringify(response.data));
|
128
|
+
} else {
|
129
|
+
console.warn(`Failed to load translations: ${response.status}`);
|
130
|
+
}
|
131
|
+
} catch (e) {
|
132
|
+
if (axios.isAxiosError(e)) {
|
133
|
+
console.error('Network error fetching translations:', e.message);
|
134
|
+
} else {
|
135
|
+
console.error('An unexpected error occurred:', e);
|
136
|
+
}
|
137
|
+
}
|
138
|
+
}
|
139
|
+
|
140
|
+
private async checkForUpdate(locale: string, force = false): Promise<boolean> {
|
141
|
+
if (!this.axios) return false;
|
142
|
+
try {
|
143
|
+
const response = await this.axios.get<TranslationResponse>('translations/version', { params: { force } });
|
144
|
+
if (response.status === 200) {
|
145
|
+
const data = response.data.data;
|
146
|
+
this.supportedLocales = data.map(item => item.code);
|
147
|
+
|
148
|
+
const currentLocaleData = data.find(item => item.code === locale);
|
149
|
+
if (!currentLocaleData) {
|
150
|
+
return false;
|
151
|
+
}
|
152
|
+
|
153
|
+
const currentLocaleSha256 = currentLocaleData.sha256;
|
154
|
+
const cachedVersion = await AsyncStorage.getItem(`cached_version_${locale}`);
|
155
|
+
|
156
|
+
if (currentLocaleSha256 !== cachedVersion) {
|
157
|
+
await AsyncStorage.setItem(`cached_version_${locale}`, currentLocaleSha256);
|
158
|
+
return true;
|
159
|
+
}
|
160
|
+
}
|
161
|
+
} catch (e) {
|
162
|
+
if (axios.isAxiosError(e)) {
|
163
|
+
console.error('Error checking for update:', e.message);
|
164
|
+
} else {
|
165
|
+
console.error('An unexpected error occurred:', e);
|
166
|
+
}
|
167
|
+
}
|
168
|
+
return false;
|
169
|
+
}
|
170
|
+
|
171
|
+
public translate(key: string, args: Record<string, string | number> = {}): string {
|
172
|
+
const keys = key.split('.');
|
173
|
+
let currentMap: any = this.translations;
|
174
|
+
|
175
|
+
for (const k of keys) {
|
176
|
+
if (typeof currentMap === 'object' && currentMap !== null && currentMap.hasOwnProperty(k)) {
|
177
|
+
currentMap = currentMap[k];
|
178
|
+
} else {
|
179
|
+
return key;
|
180
|
+
}
|
181
|
+
}
|
182
|
+
|
183
|
+
if (typeof currentMap === 'string') {
|
184
|
+
let result = currentMap;
|
185
|
+
for (const [argKey, argValue] of Object.entries(args)) {
|
186
|
+
const regex = new RegExp(`{${argKey}}`, 'gi');
|
187
|
+
result = result.replace(regex, String(argValue));
|
188
|
+
}
|
189
|
+
return result;
|
190
|
+
}
|
191
|
+
|
192
|
+
return key;
|
193
|
+
}
|
194
|
+
|
195
|
+
public async changeLanguage(locale: string, force = false): Promise<void> {
|
196
|
+
await this.loadTranslations(locale, force);
|
197
|
+
}
|
198
|
+
}
|
199
|
+
|
200
|
+
export default LocalizationService;
|
@@ -25,4 +25,18 @@ export const getData = async <T>(key: string): Promise<T | null> => {
|
|
25
25
|
}
|
26
26
|
return null;
|
27
27
|
}
|
28
|
+
};
|
29
|
+
|
30
|
+
export const clearData = async <T>(key: string): Promise<T | null> => {
|
31
|
+
try {
|
32
|
+
await AsyncStorage.removeItem(key);
|
33
|
+
return true as T;
|
34
|
+
} catch (e: any) {
|
35
|
+
if (e instanceof Error) {
|
36
|
+
console.error('Error getting object:', e.message);
|
37
|
+
} else {
|
38
|
+
console.error('An unknown error occurred while getting.');
|
39
|
+
}
|
40
|
+
return false as T;
|
41
|
+
}
|
28
42
|
};
|
@@ -1,16 +1,3 @@
|
|
1
|
-
interface TransformedCampaign {
|
2
|
-
campaignId: number;
|
3
|
-
appId: number;
|
4
|
-
title: string;
|
5
|
-
creativePackName: string;
|
6
|
-
fileUrl: string;
|
7
|
-
points: number;
|
8
|
-
rewards: number;
|
9
|
-
currency: any;
|
10
|
-
thumbnail: string;
|
11
|
-
premium: boolean;
|
12
|
-
sortingScore: number;
|
13
|
-
}
|
14
1
|
|
15
2
|
interface Campaign {
|
16
3
|
campaignId: number;
|
@@ -54,6 +41,7 @@ interface Campaign {
|
|
54
41
|
tracking: {
|
55
42
|
impressionUrl: string;
|
56
43
|
clickUrl: string;
|
44
|
+
s2sClickUrl: string;
|
57
45
|
};
|
58
46
|
targeting: {
|
59
47
|
os: string;
|
@@ -88,7 +76,17 @@ interface Campaign {
|
|
88
76
|
}[];
|
89
77
|
}[];
|
90
78
|
};
|
79
|
+
isInstalled: boolean;
|
91
80
|
isRetryDownload: boolean;
|
92
81
|
capReached: boolean;
|
93
82
|
premium: boolean;
|
83
|
+
}
|
84
|
+
|
85
|
+
interface CurrencySales {
|
86
|
+
name: null | string,
|
87
|
+
multiplier: null | number,
|
88
|
+
bannerUrl: null | string,
|
89
|
+
dateStart: null | string,
|
90
|
+
dateEnd: null | string,
|
91
|
+
remainingTimeSeconds: null | number
|
94
92
|
}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { TouchableOpacity, Text, StyleSheet, View, } from 'react-native';
|
3
|
+
import { useLocalization } from '../../localization/localization_context';
|
4
|
+
// import { useTranslation } from 'react-i18next';
|
5
|
+
|
6
|
+
interface ActiveOffersBtnProps {
|
7
|
+
premiumColor?: string;
|
8
|
+
activeCount: number;
|
9
|
+
onPress: (route: string) => void;
|
10
|
+
}
|
11
|
+
|
12
|
+
const ActiveOffersButton: React.FC<ActiveOffersBtnProps> = ({ premiumColor, activeCount, onPress }) => {
|
13
|
+
const { t } = useLocalization();
|
14
|
+
return (
|
15
|
+
<TouchableOpacity
|
16
|
+
style={[styles.button, { borderColor: premiumColor }]}
|
17
|
+
onPress={() => onPress && onPress('active-offers')}
|
18
|
+
>
|
19
|
+
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
20
|
+
<Text style={[styles.buttonText, { color: premiumColor }]}>{t("data.offers.button.activeOffers")}</Text>
|
21
|
+
{activeCount > 0 &&
|
22
|
+
<View style={styles.activeCountContainer}>
|
23
|
+
<Text style={styles.activeCountText}>{activeCount > 99 ? '99+' : activeCount}</Text>
|
24
|
+
</View>}
|
25
|
+
</View>
|
26
|
+
</TouchableOpacity>
|
27
|
+
);
|
28
|
+
};
|
29
|
+
|
30
|
+
const styles = StyleSheet.create({
|
31
|
+
button: {
|
32
|
+
borderRadius: 42,
|
33
|
+
paddingHorizontal: 16,
|
34
|
+
paddingVertical: 8,
|
35
|
+
height: 40,
|
36
|
+
justifyContent: 'center',
|
37
|
+
alignItems: 'center',
|
38
|
+
marginHorizontal: 16,
|
39
|
+
marginBottom: 16,
|
40
|
+
borderWidth: 2,
|
41
|
+
},
|
42
|
+
buttonText: {
|
43
|
+
fontSize: 14,
|
44
|
+
fontWeight: 'bold',
|
45
|
+
},
|
46
|
+
activeCountContainer: {
|
47
|
+
marginLeft: 8,
|
48
|
+
width: 18,
|
49
|
+
height: 18,
|
50
|
+
backgroundColor: '#FF554A',
|
51
|
+
alignItems: 'center',
|
52
|
+
justifyContent: 'center',
|
53
|
+
borderRadius: 9,
|
54
|
+
},
|
55
|
+
activeCountText: {
|
56
|
+
color: 'white',
|
57
|
+
fontSize: 10,
|
58
|
+
fontWeight: 'bold',
|
59
|
+
}
|
60
|
+
});
|
61
|
+
|
62
|
+
export default ActiveOffersButton;
|
@@ -13,18 +13,15 @@ const CustomCard: React.FC<CustomCardProps> = ({ children, style }) => {
|
|
13
13
|
const styles = StyleSheet.create({
|
14
14
|
card: {
|
15
15
|
backgroundColor: 'white',
|
16
|
-
|
17
|
-
borderTopRightRadius: 20,
|
18
|
-
borderBottomLeftRadius: 14,
|
19
|
-
borderBottomRightRadius: 14,
|
16
|
+
borderRadius: 16,
|
20
17
|
paddingTop: 6,
|
21
18
|
paddingBottom: 5,
|
22
19
|
shadowColor: '#000',
|
23
|
-
shadowOffset: { width: 4, height: 4 },
|
24
|
-
shadowOpacity: 0.2,
|
25
|
-
shadowRadius: 4,
|
26
|
-
elevation: 4,
|
27
20
|
alignSelf: 'center',
|
21
|
+
shadowOffset: { width: 0, height: 2 },
|
22
|
+
shadowOpacity: 0.24,
|
23
|
+
shadowRadius: 3.5,
|
24
|
+
elevation: 4,
|
28
25
|
},
|
29
26
|
});
|
30
27
|
|
@@ -0,0 +1,164 @@
|
|
1
|
+
import React, { useRef, useState, useEffect } from 'react';
|
2
|
+
import {
|
3
|
+
View,
|
4
|
+
Animated,
|
5
|
+
StyleSheet,
|
6
|
+
type ViewStyle,
|
7
|
+
type StyleProp,
|
8
|
+
type LayoutChangeEvent,
|
9
|
+
} from 'react-native';
|
10
|
+
|
11
|
+
interface PagerProps {
|
12
|
+
totalPages: number;
|
13
|
+
delayInMillis?: number;
|
14
|
+
premiumColor?: string;
|
15
|
+
content: (index: number) => React.ReactNode;
|
16
|
+
viewportFraction?: number;
|
17
|
+
scaleFactor?: number;
|
18
|
+
spacing?: number;
|
19
|
+
indicatorStyle?: StyleProp<ViewStyle>;
|
20
|
+
activeIndicatorColor?: string;
|
21
|
+
inactiveIndicatorColor?: string;
|
22
|
+
}
|
23
|
+
|
24
|
+
const AcmoScrollPager: React.FC<PagerProps> = ({
|
25
|
+
totalPages,
|
26
|
+
delayInMillis = 5000,
|
27
|
+
content,
|
28
|
+
viewportFraction = 0.92,
|
29
|
+
scaleFactor = 0.94,
|
30
|
+
spacing = 2,
|
31
|
+
indicatorStyle,
|
32
|
+
activeIndicatorColor = 'red',
|
33
|
+
inactiveIndicatorColor = 'lightgray',
|
34
|
+
}) => {
|
35
|
+
const scrollX = useRef(new Animated.Value(0)).current;
|
36
|
+
const scrollViewRef = useRef<React.RefObject<typeof Animated.ScrollView> | any>(null);
|
37
|
+
const [currentPage, setCurrentPage] = useState(0);
|
38
|
+
const [containerWidth, setContainerWidth] = useState<number | null>(null);
|
39
|
+
|
40
|
+
const intervalRef = useRef<ReturnType<typeof setInterval> | null>(null);
|
41
|
+
|
42
|
+
const onContainerLayout = (e: LayoutChangeEvent) => {
|
43
|
+
const { width } = e.nativeEvent.layout;
|
44
|
+
if (width !== containerWidth) setContainerWidth(width);
|
45
|
+
};
|
46
|
+
|
47
|
+
useEffect(() => {
|
48
|
+
if (!containerWidth) return;
|
49
|
+
|
50
|
+
const itemWidth = containerWidth * viewportFraction;
|
51
|
+
const offset = itemWidth + spacing;
|
52
|
+
|
53
|
+
intervalRef.current = setInterval(() => {
|
54
|
+
const next = (currentPage + 1) % totalPages;
|
55
|
+
setCurrentPage(next);
|
56
|
+
scrollViewRef.current.scrollTo({
|
57
|
+
x: next * offset,
|
58
|
+
animated: true,
|
59
|
+
});
|
60
|
+
}, delayInMillis);
|
61
|
+
|
62
|
+
return () => {
|
63
|
+
if (intervalRef.current) clearInterval(intervalRef.current);
|
64
|
+
};
|
65
|
+
}, [containerWidth, currentPage, delayInMillis, totalPages, viewportFraction, spacing]);
|
66
|
+
|
67
|
+
const handleScroll = Animated.event(
|
68
|
+
[{ nativeEvent: { contentOffset: { x: scrollX } } }],
|
69
|
+
{
|
70
|
+
useNativeDriver: true,
|
71
|
+
listener: (event: { nativeEvent: { contentOffset: { x: number } } }) => {
|
72
|
+
if (!containerWidth) return;
|
73
|
+
const offset = containerWidth * viewportFraction + spacing;
|
74
|
+
const index = Math.round(event.nativeEvent.contentOffset.x / offset);
|
75
|
+
setCurrentPage(index);
|
76
|
+
},
|
77
|
+
}
|
78
|
+
);
|
79
|
+
|
80
|
+
const renderIndicators = () => (
|
81
|
+
<View style={[styles.indicatorContainer, indicatorStyle]}>
|
82
|
+
{Array.from({ length: totalPages }, (_, i) => (
|
83
|
+
<View
|
84
|
+
key={i}
|
85
|
+
style={[
|
86
|
+
styles.indicator,
|
87
|
+
{
|
88
|
+
backgroundColor:
|
89
|
+
i === currentPage ? activeIndicatorColor : inactiveIndicatorColor,
|
90
|
+
},
|
91
|
+
]}
|
92
|
+
/>
|
93
|
+
))}
|
94
|
+
</View>
|
95
|
+
);
|
96
|
+
|
97
|
+
if (!containerWidth) {
|
98
|
+
return <View onLayout={onContainerLayout} style={{ width: '100%' }} />;
|
99
|
+
}
|
100
|
+
|
101
|
+
const itemWidth = containerWidth * viewportFraction;
|
102
|
+
const itemOffset = itemWidth + spacing;
|
103
|
+
const sidePadding = (containerWidth - itemWidth - 16) / 2;
|
104
|
+
|
105
|
+
return (
|
106
|
+
<View onLayout={onContainerLayout} style={{ width: '100%', alignItems: 'center' }}>
|
107
|
+
<Animated.ScrollView
|
108
|
+
ref={scrollViewRef}
|
109
|
+
horizontal
|
110
|
+
pagingEnabled={false}
|
111
|
+
snapToInterval={itemOffset}
|
112
|
+
decelerationRate="fast"
|
113
|
+
showsHorizontalScrollIndicator={false}
|
114
|
+
scrollEventThrottle={16}
|
115
|
+
onScroll={handleScroll}
|
116
|
+
contentContainerStyle={{ paddingHorizontal: sidePadding }}
|
117
|
+
>
|
118
|
+
{Array.from({ length: totalPages }, (_, i) => {
|
119
|
+
const inputRange = [
|
120
|
+
itemOffset * (i - 1),
|
121
|
+
itemOffset * i,
|
122
|
+
itemOffset * (i + 1),
|
123
|
+
];
|
124
|
+
|
125
|
+
const scale = scrollX.interpolate({
|
126
|
+
inputRange,
|
127
|
+
outputRange: [scaleFactor, 1, scaleFactor],
|
128
|
+
extrapolate: 'clamp',
|
129
|
+
});
|
130
|
+
|
131
|
+
return (
|
132
|
+
<Animated.View
|
133
|
+
key={i}
|
134
|
+
style={{
|
135
|
+
width: itemWidth,
|
136
|
+
transform: [{ scale }],
|
137
|
+
}}
|
138
|
+
>
|
139
|
+
{content(i)}
|
140
|
+
</Animated.View>
|
141
|
+
);
|
142
|
+
})}
|
143
|
+
</Animated.ScrollView>
|
144
|
+
{renderIndicators()}
|
145
|
+
</View>
|
146
|
+
);
|
147
|
+
};
|
148
|
+
|
149
|
+
const styles = StyleSheet.create({
|
150
|
+
indicatorContainer: {
|
151
|
+
flexDirection: 'row',
|
152
|
+
justifyContent: 'center',
|
153
|
+
marginTop: 6,
|
154
|
+
marginBottom: 8,
|
155
|
+
},
|
156
|
+
indicator: {
|
157
|
+
width: 8,
|
158
|
+
height: 8,
|
159
|
+
borderRadius: 4,
|
160
|
+
marginHorizontal: 4,
|
161
|
+
},
|
162
|
+
});
|
163
|
+
|
164
|
+
export default AcmoScrollPager;
|
@@ -0,0 +1,75 @@
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
2
|
+
import { View, Animated, StyleSheet, Dimensions, type DimensionValue, type ViewStyle, type StyleProp } from 'react-native';
|
3
|
+
|
4
|
+
interface ShimmerProps {
|
5
|
+
width?: DimensionValue;
|
6
|
+
shimmerHeight?: number;
|
7
|
+
style?: StyleProp<ViewStyle>;
|
8
|
+
duration?: number;
|
9
|
+
}
|
10
|
+
|
11
|
+
const SCREEN_WIDTH = Dimensions.get('window').width;
|
12
|
+
|
13
|
+
const Shimmer: React.FC<ShimmerProps> = ({
|
14
|
+
width = '100%',
|
15
|
+
shimmerHeight: height = 16,
|
16
|
+
style,
|
17
|
+
duration = 1500,
|
18
|
+
}) => {
|
19
|
+
const translateX = useRef(new Animated.Value(-1)).current;
|
20
|
+
|
21
|
+
useEffect(() => {
|
22
|
+
const animation = Animated.loop(
|
23
|
+
Animated.timing(translateX, {
|
24
|
+
toValue: 1,
|
25
|
+
duration,
|
26
|
+
useNativeDriver: true,
|
27
|
+
}),
|
28
|
+
);
|
29
|
+
animation.start();
|
30
|
+
return () => animation.stop();
|
31
|
+
}, [translateX, duration]);
|
32
|
+
|
33
|
+
const translateXInterpolate = translateX.interpolate({
|
34
|
+
inputRange: [-1, 1],
|
35
|
+
outputRange: [-SCREEN_WIDTH, SCREEN_WIDTH],
|
36
|
+
});
|
37
|
+
|
38
|
+
return (
|
39
|
+
<View style={[styles.container, { width }, style]}>
|
40
|
+
<View style={[styles.shimmerBackground, { height }]} />
|
41
|
+
<Animated.View
|
42
|
+
style={[
|
43
|
+
styles.shimmerOverlay,
|
44
|
+
{
|
45
|
+
width: SCREEN_WIDTH,
|
46
|
+
height,
|
47
|
+
transform: [{ translateX: translateXInterpolate }],
|
48
|
+
},
|
49
|
+
]}
|
50
|
+
/>
|
51
|
+
</View>
|
52
|
+
);
|
53
|
+
};
|
54
|
+
|
55
|
+
const styles = StyleSheet.create({
|
56
|
+
container: {
|
57
|
+
overflow: 'hidden',
|
58
|
+
backgroundColor: '#e1e1e1',
|
59
|
+
borderRadius: 4,
|
60
|
+
},
|
61
|
+
shimmerBackground: {
|
62
|
+
flex: 1,
|
63
|
+
backgroundColor: '#d3d3d3',
|
64
|
+
},
|
65
|
+
shimmerOverlay: {
|
66
|
+
position: 'absolute',
|
67
|
+
top: 0,
|
68
|
+
left: 0,
|
69
|
+
backgroundColor: 'rgba(255,255,255,0.5)',
|
70
|
+
opacity: 0.4,
|
71
|
+
borderRadius: 4,
|
72
|
+
},
|
73
|
+
});
|
74
|
+
|
75
|
+
export default Shimmer;
|