react-native-stallion 2.5.0-alpha.2 → 2.5.0-alpha.3
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/src/main/java/com/stallion/networkmanager/StallionApiConstants.java +4 -0
- package/android/src/main/java/com/stallion/networkmanager/StallionApiManager.java +2 -0
- package/android/src/main/java/com/stallion/networkmanager/StallionFileDownloader.java +8 -2
- package/android/src/main/java/com/stallion/networkmanager/StallionPatchHandler.java +4 -1
- package/android/src/main/java/com/stallion/networkmanager/StallionStageManager.java +7 -2
- package/android/src/main/java/com/stallion/networkmanager/StallionSyncHandler.java +14 -9
- package/android/src/main/java/com/stallion/storage/StallionConfig.java +2 -10
- package/android/src/main/java/com/stallion/utils/StallionSlotManager.java +1 -0
- package/ios/main/StallionConfig.m +2 -6
- package/ios/main/StallionConstants.swift +4 -0
- package/ios/main/StallionFileDownloader.swift +7 -3
- package/ios/main/StallionPatchHandler.swift +4 -1
- package/ios/main/StallionSlotManager.m +5 -4
- package/ios/main/StallionStageManager.swift +10 -4
- package/ios/main/StallionSyncHandler.swift +9 -2
- package/package.json +2 -2
- package/src/index.js +2 -0
- package/src/index.js.map +1 -1
- package/src/main/components/StallionDevMenu.js +69 -0
- package/src/main/components/StallionDevMenu.js.map +1 -0
- package/src/main/components/common/BackButton/index.js +19 -42
- package/src/main/components/common/BackButton/index.js.map +1 -1
- package/src/main/components/common/Chevron/index.js +64 -0
- package/src/main/components/common/Chevron/index.js.map +1 -0
- package/src/main/components/common/CrossButton/index.js +18 -11
- package/src/main/components/common/CrossButton/index.js.map +1 -1
- package/src/main/components/common/Header/index.js +3 -15
- package/src/main/components/common/Header/index.js.map +1 -1
- package/src/main/components/common/Header/styles.js +0 -22
- package/src/main/components/common/Header/styles.js.map +1 -1
- package/src/main/components/modules/devMenu/components/ActionButton.js +45 -0
- package/src/main/components/modules/devMenu/components/ActionButton.js.map +1 -0
- package/src/main/components/modules/devMenu/components/AppHeader.js +17 -0
- package/src/main/components/modules/devMenu/components/AppHeader.js.map +1 -0
- package/src/main/components/modules/devMenu/components/BucketRow.js +34 -0
- package/src/main/components/modules/devMenu/components/BucketRow.js.map +1 -0
- package/src/main/components/modules/devMenu/components/BundleHistoryCard.js +92 -0
- package/src/main/components/modules/devMenu/components/BundleHistoryCard.js.map +1 -0
- package/src/main/components/modules/devMenu/components/Chip.js +16 -0
- package/src/main/components/modules/devMenu/components/Chip.js.map +1 -0
- package/src/main/components/modules/devMenu/components/DetailHeader.js +32 -0
- package/src/main/components/modules/devMenu/components/DetailHeader.js.map +1 -0
- package/src/main/components/modules/devMenu/components/DeviceCard.js +31 -0
- package/src/main/components/modules/devMenu/components/DeviceCard.js.map +1 -0
- package/src/main/components/modules/devMenu/components/ErrorBanner.js +17 -0
- package/src/main/components/modules/devMenu/components/ErrorBanner.js.map +1 -0
- package/src/main/components/modules/devMenu/components/ModeToggle.js +54 -0
- package/src/main/components/modules/devMenu/components/ModeToggle.js.map +1 -0
- package/src/main/components/modules/devMenu/components/ProdBundleCard.js +47 -0
- package/src/main/components/modules/devMenu/components/ProdBundleCard.js.map +1 -0
- package/src/main/components/modules/devMenu/components/ReleaseNote.js +44 -0
- package/src/main/components/modules/devMenu/components/ReleaseNote.js.map +1 -0
- package/src/main/components/modules/devMenu/components/SectionLabel.js +13 -0
- package/src/main/components/modules/devMenu/components/SectionLabel.js.map +1 -0
- package/src/main/components/modules/devMenu/components/StateCard.js +30 -0
- package/src/main/components/modules/devMenu/components/StateCard.js.map +1 -0
- package/src/main/components/modules/devMenu/components/Wordmark.js +35 -0
- package/src/main/components/modules/devMenu/components/Wordmark.js.map +1 -0
- package/src/main/components/modules/devMenu/components/styles/index.js +403 -0
- package/src/main/components/modules/devMenu/components/styles/index.js.map +1 -0
- package/src/main/components/modules/devMenu/index.js +47 -0
- package/src/main/components/modules/devMenu/index.js.map +1 -0
- package/src/main/components/modules/devMenu/screens/BundleHistory.js +142 -0
- package/src/main/components/modules/devMenu/screens/BundleHistory.js.map +1 -0
- package/src/main/components/modules/devMenu/screens/Production.js +65 -0
- package/src/main/components/modules/devMenu/screens/Production.js.map +1 -0
- package/src/main/components/modules/devMenu/screens/TestingBuckets.js +81 -0
- package/src/main/components/modules/devMenu/screens/TestingBuckets.js.map +1 -0
- package/src/main/components/modules/devMenu/styles.js +50 -0
- package/src/main/components/modules/devMenu/styles.js.map +1 -0
- package/src/main/components/modules/modal/StallionModal.js +15 -51
- package/src/main/components/modules/modal/StallionModal.js.map +1 -1
- package/src/main/components/modules/modal/hooks/useStallionModal.js +21 -19
- package/src/main/components/modules/modal/hooks/useStallionModal.js.map +1 -1
- package/src/main/constants/appConstants.js +56 -53
- package/src/main/constants/appConstants.js.map +1 -1
- package/src/main/constants/colors.js +1 -10
- package/src/main/constants/colors.js.map +1 -1
- package/src/main/constants/designTokens.js +80 -0
- package/src/main/constants/designTokens.js.map +1 -0
- package/src/main/index.js +3 -1
- package/src/main/index.js.map +1 -1
- package/src/main/state/useStallionEvents.js.map +1 -1
- package/src/main/utils/useStallionConfig.js +14 -0
- package/src/main/utils/useStallionConfig.js.map +1 -0
- package/src/types/bundle.types.js +7 -0
- package/src/types/bundle.types.js.map +1 -1
- package/types/index.d.ts +2 -0
- package/types/index.d.ts.map +1 -1
- package/types/main/components/StallionDevMenu.d.ts +5 -0
- package/types/main/components/StallionDevMenu.d.ts.map +1 -0
- package/types/main/components/common/BackButton/index.d.ts +4 -3
- package/types/main/components/common/BackButton/index.d.ts.map +1 -1
- package/types/main/components/common/Chevron/index.d.ts +11 -0
- package/types/main/components/common/Chevron/index.d.ts.map +1 -0
- package/types/main/components/common/CrossButton/index.d.ts +4 -3
- package/types/main/components/common/CrossButton/index.d.ts.map +1 -1
- package/types/main/components/common/Header/index.d.ts +0 -2
- package/types/main/components/common/Header/index.d.ts.map +1 -1
- package/types/main/components/common/Header/styles.d.ts +0 -21
- package/types/main/components/common/Header/styles.d.ts.map +1 -1
- package/types/main/components/modules/devMenu/components/ActionButton.d.ts +19 -0
- package/types/main/components/modules/devMenu/components/ActionButton.d.ts.map +1 -0
- package/types/main/components/modules/devMenu/components/AppHeader.d.ts +7 -0
- package/types/main/components/modules/devMenu/components/AppHeader.d.ts.map +1 -0
- package/types/main/components/modules/devMenu/components/BucketRow.d.ts +11 -0
- package/types/main/components/modules/devMenu/components/BucketRow.d.ts.map +1 -0
- package/types/main/components/modules/devMenu/components/BundleHistoryCard.d.ts +22 -0
- package/types/main/components/modules/devMenu/components/BundleHistoryCard.d.ts.map +1 -0
- package/types/main/components/modules/devMenu/components/Chip.d.ts +9 -0
- package/types/main/components/modules/devMenu/components/Chip.d.ts.map +1 -0
- package/types/main/components/modules/devMenu/components/DetailHeader.d.ts +10 -0
- package/types/main/components/modules/devMenu/components/DetailHeader.d.ts.map +1 -0
- package/types/main/components/modules/devMenu/components/DeviceCard.d.ts +8 -0
- package/types/main/components/modules/devMenu/components/DeviceCard.d.ts.map +1 -0
- package/types/main/components/modules/devMenu/components/ErrorBanner.d.ts +6 -0
- package/types/main/components/modules/devMenu/components/ErrorBanner.d.ts.map +1 -0
- package/types/main/components/modules/devMenu/components/ModeToggle.d.ts +8 -0
- package/types/main/components/modules/devMenu/components/ModeToggle.d.ts.map +1 -0
- package/types/main/components/modules/devMenu/components/ProdBundleCard.d.ts +13 -0
- package/types/main/components/modules/devMenu/components/ProdBundleCard.d.ts.map +1 -0
- package/types/main/components/modules/devMenu/components/ReleaseNote.d.ts +11 -0
- package/types/main/components/modules/devMenu/components/ReleaseNote.d.ts.map +1 -0
- package/types/main/components/modules/devMenu/components/SectionLabel.d.ts +6 -0
- package/types/main/components/modules/devMenu/components/SectionLabel.d.ts.map +1 -0
- package/types/main/components/modules/devMenu/components/StateCard.d.ts +9 -0
- package/types/main/components/modules/devMenu/components/StateCard.d.ts.map +1 -0
- package/types/main/components/modules/{listing/index.d.ts → devMenu/components/Wordmark.d.ts} +1 -1
- package/types/main/components/modules/devMenu/components/Wordmark.d.ts.map +1 -0
- package/types/main/components/modules/devMenu/components/styles/index.d.ts +353 -0
- package/types/main/components/modules/devMenu/components/styles/index.d.ts.map +1 -0
- package/types/main/components/modules/devMenu/index.d.ts +14 -0
- package/types/main/components/modules/devMenu/index.d.ts.map +1 -0
- package/types/main/components/modules/devMenu/screens/BundleHistory.d.ts +4 -0
- package/types/main/components/modules/devMenu/screens/BundleHistory.d.ts.map +1 -0
- package/types/main/components/modules/devMenu/screens/Production.d.ts +4 -0
- package/types/main/components/modules/devMenu/screens/Production.d.ts.map +1 -0
- package/types/main/components/modules/devMenu/screens/TestingBuckets.d.ts +4 -0
- package/types/main/components/modules/devMenu/screens/TestingBuckets.d.ts.map +1 -0
- package/types/main/components/modules/devMenu/styles.d.ts +46 -0
- package/types/main/components/modules/devMenu/styles.d.ts.map +1 -0
- package/types/main/components/modules/modal/StallionModal.d.ts.map +1 -1
- package/types/main/components/modules/modal/hooks/useStallionModal.d.ts +5 -6
- package/types/main/components/modules/modal/hooks/useStallionModal.d.ts.map +1 -1
- package/types/main/constants/appConstants.d.ts +46 -48
- package/types/main/constants/appConstants.d.ts.map +1 -1
- package/types/main/constants/colors.d.ts +0 -9
- package/types/main/constants/colors.d.ts.map +1 -1
- package/types/main/constants/designTokens.d.ts +73 -0
- package/types/main/constants/designTokens.d.ts.map +1 -0
- package/types/main/index.d.ts +1 -0
- package/types/main/index.d.ts.map +1 -1
- package/types/main/state/useStallionEvents.d.ts +2 -0
- package/types/main/state/useStallionEvents.d.ts.map +1 -1
- package/types/main/utils/useStallionConfig.d.ts +5 -0
- package/types/main/utils/useStallionConfig.d.ts.map +1 -0
- package/types/types/bundle.types.d.ts +7 -0
- package/types/types/bundle.types.d.ts.map +1 -1
- package/types/types/utils.types.d.ts +3 -0
- package/types/types/utils.types.d.ts.map +1 -1
- package/src/main/components/common/ErrorView/index.js +0 -24
- package/src/main/components/common/ErrorView/index.js.map +0 -1
- package/src/main/components/common/ErrorView/styles.js +0 -30
- package/src/main/components/common/ErrorView/styles.js.map +0 -1
- package/src/main/components/common/Footer/index.js +0 -50
- package/src/main/components/common/Footer/index.js.map +0 -1
- package/src/main/components/common/Footer/styles.js +0 -91
- package/src/main/components/common/Footer/styles.js.map +0 -1
- package/src/main/components/common/FooterLoader/index.js +0 -11
- package/src/main/components/common/FooterLoader/index.js.map +0 -1
- package/src/main/components/common/FooterLoader/styles.js +0 -12
- package/src/main/components/common/FooterLoader/styles.js.map +0 -1
- package/src/main/components/common/OverlayLoader/index.js +0 -26
- package/src/main/components/common/OverlayLoader/index.js.map +0 -1
- package/src/main/components/common/OverlayLoader/styles.js +0 -33
- package/src/main/components/common/OverlayLoader/styles.js.map +0 -1
- package/src/main/components/modules/listing/components/BucketCard.js +0 -33
- package/src/main/components/modules/listing/components/BucketCard.js.map +0 -1
- package/src/main/components/modules/listing/components/BucketCardInfoSection.js +0 -56
- package/src/main/components/modules/listing/components/BucketCardInfoSection.js.map +0 -1
- package/src/main/components/modules/listing/components/BundleCard.js +0 -42
- package/src/main/components/modules/listing/components/BundleCard.js.map +0 -1
- package/src/main/components/modules/listing/components/BundleCardInfoSection.js +0 -82
- package/src/main/components/modules/listing/components/BundleCardInfoSection.js.map +0 -1
- package/src/main/components/modules/listing/components/CardDescriptionContent.js +0 -36
- package/src/main/components/modules/listing/components/CardDescriptionContent.js.map +0 -1
- package/src/main/components/modules/listing/components/ConfigView.js +0 -29
- package/src/main/components/modules/listing/components/ConfigView.js.map +0 -1
- package/src/main/components/modules/listing/components/MetaCard.js +0 -39
- package/src/main/components/modules/listing/components/MetaCard.js.map +0 -1
- package/src/main/components/modules/listing/components/SlotView.js +0 -80
- package/src/main/components/modules/listing/components/SlotView.js.map +0 -1
- package/src/main/components/modules/listing/components/styles/index.js +0 -121
- package/src/main/components/modules/listing/components/styles/index.js.map +0 -1
- package/src/main/components/modules/listing/hooks/useListing.js +0 -84
- package/src/main/components/modules/listing/hooks/useListing.js.map +0 -1
- package/src/main/components/modules/listing/index.js +0 -75
- package/src/main/components/modules/listing/index.js.map +0 -1
- package/src/main/components/modules/listing/styles.js +0 -24
- package/src/main/components/modules/listing/styles.js.map +0 -1
- package/src/main/components/modules/prod/index.js +0 -3
- package/src/main/components/modules/prod/index.js.map +0 -1
- package/src/main/components/modules/prod/prod.js +0 -30
- package/src/main/components/modules/prod/prod.js.map +0 -1
- package/src/main/components/modules/prod/styles/index.js +0 -29
- package/src/main/components/modules/prod/styles/index.js.map +0 -1
- package/types/main/components/common/ErrorView/index.d.ts +0 -8
- package/types/main/components/common/ErrorView/index.d.ts.map +0 -1
- package/types/main/components/common/ErrorView/styles.d.ts +0 -27
- package/types/main/components/common/ErrorView/styles.d.ts.map +0 -1
- package/types/main/components/common/Footer/index.d.ts +0 -10
- package/types/main/components/common/Footer/index.d.ts.map +0 -1
- package/types/main/components/common/Footer/styles.d.ts +0 -88
- package/types/main/components/common/Footer/styles.d.ts.map +0 -1
- package/types/main/components/common/FooterLoader/index.d.ts +0 -4
- package/types/main/components/common/FooterLoader/index.d.ts.map +0 -1
- package/types/main/components/common/FooterLoader/styles.d.ts +0 -10
- package/types/main/components/common/FooterLoader/styles.d.ts.map +0 -1
- package/types/main/components/common/OverlayLoader/index.d.ts +0 -7
- package/types/main/components/common/OverlayLoader/index.d.ts.map +0 -1
- package/types/main/components/common/OverlayLoader/styles.d.ts +0 -30
- package/types/main/components/common/OverlayLoader/styles.d.ts.map +0 -1
- package/types/main/components/modules/listing/components/BucketCard.d.ts +0 -13
- package/types/main/components/modules/listing/components/BucketCard.d.ts.map +0 -1
- package/types/main/components/modules/listing/components/BucketCardInfoSection.d.ts +0 -11
- package/types/main/components/modules/listing/components/BucketCardInfoSection.d.ts.map +0 -1
- package/types/main/components/modules/listing/components/BundleCard.d.ts +0 -15
- package/types/main/components/modules/listing/components/BundleCard.d.ts.map +0 -1
- package/types/main/components/modules/listing/components/BundleCardInfoSection.d.ts +0 -15
- package/types/main/components/modules/listing/components/BundleCardInfoSection.d.ts.map +0 -1
- package/types/main/components/modules/listing/components/CardDescriptionContent.d.ts +0 -8
- package/types/main/components/modules/listing/components/CardDescriptionContent.d.ts.map +0 -1
- package/types/main/components/modules/listing/components/ConfigView.d.ts +0 -8
- package/types/main/components/modules/listing/components/ConfigView.d.ts.map +0 -1
- package/types/main/components/modules/listing/components/MetaCard.d.ts +0 -8
- package/types/main/components/modules/listing/components/MetaCard.d.ts.map +0 -1
- package/types/main/components/modules/listing/components/SlotView.d.ts +0 -5
- package/types/main/components/modules/listing/components/SlotView.d.ts.map +0 -1
- package/types/main/components/modules/listing/components/styles/index.d.ts +0 -118
- package/types/main/components/modules/listing/components/styles/index.d.ts.map +0 -1
- package/types/main/components/modules/listing/hooks/useListing.d.ts +0 -15
- package/types/main/components/modules/listing/hooks/useListing.d.ts.map +0 -1
- package/types/main/components/modules/listing/index.d.ts.map +0 -1
- package/types/main/components/modules/listing/styles.d.ts +0 -21
- package/types/main/components/modules/listing/styles.d.ts.map +0 -1
- package/types/main/components/modules/prod/index.d.ts +0 -3
- package/types/main/components/modules/prod/index.d.ts.map +0 -1
- package/types/main/components/modules/prod/prod.d.ts +0 -4
- package/types/main/components/modules/prod/prod.d.ts.map +0 -1
- package/types/main/components/modules/prod/styles/index.d.ts +0 -25
- package/types/main/components/modules/prod/styles/index.d.ts.map +0 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import AppHeader from './components/AppHeader';
|
|
4
|
+
import DetailHeader from './components/DetailHeader';
|
|
5
|
+
import ErrorBanner from './components/ErrorBanner';
|
|
6
|
+
import ModeToggle from './components/ModeToggle';
|
|
7
|
+
import BundleHistory from './screens/BundleHistory';
|
|
8
|
+
import Production from './screens/Production';
|
|
9
|
+
import TestingBuckets from './screens/TestingBuckets';
|
|
10
|
+
import styles from './styles';
|
|
11
|
+
const DevMenu = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
isTesting,
|
|
14
|
+
isBundleHistory,
|
|
15
|
+
bucketTitle,
|
|
16
|
+
bucketSubtitle,
|
|
17
|
+
downloadError,
|
|
18
|
+
onBackPress,
|
|
19
|
+
onClosePress,
|
|
20
|
+
onTabChange
|
|
21
|
+
} = _ref;
|
|
22
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
23
|
+
style: styles.root
|
|
24
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
25
|
+
style: styles.headerSafeArea
|
|
26
|
+
}, isBundleHistory ? /*#__PURE__*/React.createElement(DetailHeader, {
|
|
27
|
+
title: bucketTitle,
|
|
28
|
+
subtitle: bucketSubtitle,
|
|
29
|
+
onBackPress: onBackPress,
|
|
30
|
+
onClosePress: onClosePress
|
|
31
|
+
}) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(AppHeader, {
|
|
32
|
+
onClosePress: onClosePress
|
|
33
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
34
|
+
style: styles.toggleArea
|
|
35
|
+
}, /*#__PURE__*/React.createElement(ModeToggle, {
|
|
36
|
+
isTesting: isTesting,
|
|
37
|
+
onChange: onTabChange
|
|
38
|
+
})))), downloadError ? /*#__PURE__*/React.createElement(View, {
|
|
39
|
+
style: styles.bannerWrapper
|
|
40
|
+
}, /*#__PURE__*/React.createElement(ErrorBanner, {
|
|
41
|
+
message: downloadError
|
|
42
|
+
})) : null, /*#__PURE__*/React.createElement(View, {
|
|
43
|
+
style: styles.content
|
|
44
|
+
}, isBundleHistory ? /*#__PURE__*/React.createElement(BundleHistory, null) : isTesting ? /*#__PURE__*/React.createElement(TestingBuckets, null) : /*#__PURE__*/React.createElement(Production, null)));
|
|
45
|
+
};
|
|
46
|
+
export default DevMenu;
|
|
47
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","AppHeader","DetailHeader","ErrorBanner","ModeToggle","BundleHistory","Production","TestingBuckets","styles","DevMenu","_ref","isTesting","isBundleHistory","bucketTitle","bucketSubtitle","downloadError","onBackPress","onClosePress","onTabChange","createElement","style","root","headerSafeArea","title","subtitle","Fragment","toggleArea","onChange","bannerWrapper","message","content"],"sourceRoot":"../../../../../../src","sources":["main/components/modules/devMenu/index.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AAEnC,OAAOC,SAAS,MAAM,wBAAwB;AAC9C,OAAOC,YAAY,MAAM,2BAA2B;AACpD,OAAOC,WAAW,MAAM,0BAA0B;AAClD,OAAOC,UAAU,MAAM,yBAAyB;AAEhD,OAAOC,aAAa,MAAM,yBAAyB;AACnD,OAAOC,UAAU,MAAM,sBAAsB;AAC7C,OAAOC,cAAc,MAAM,0BAA0B;AAErD,OAAOC,MAAM,MAAM,UAAU;AAa7B,MAAMC,OAA2B,GAAGC,IAAA;EAAA,IAAC;IACnCC,SAAS;IACTC,eAAe;IACfC,WAAW;IACXC,cAAc;IACdC,aAAa;IACbC,WAAW;IACXC,YAAY;IACZC;EACF,CAAC,GAAAR,IAAA;EAAA,oBACCX,KAAA,CAAAoB,aAAA,CAACnB,IAAI;IAACoB,KAAK,EAAEZ,MAAM,CAACa;EAAK,gBACvBtB,KAAA,CAAAoB,aAAA,CAACnB,IAAI;IAACoB,KAAK,EAAEZ,MAAM,CAACc;EAAe,GAChCV,eAAe,gBACdb,KAAA,CAAAoB,aAAA,CAACjB,YAAY;IACXqB,KAAK,EAAEV,WAAY;IACnBW,QAAQ,EAAEV,cAAe;IACzBE,WAAW,EAAEA,WAAY;IACzBC,YAAY,EAAEA;EAAa,CAC5B,CAAC,gBAEFlB,KAAA,CAAAoB,aAAA,CAAApB,KAAA,CAAA0B,QAAA,qBACE1B,KAAA,CAAAoB,aAAA,CAAClB,SAAS;IAACgB,YAAY,EAAEA;EAAa,CAAE,CAAC,eACzClB,KAAA,CAAAoB,aAAA,CAACnB,IAAI;IAACoB,KAAK,EAAEZ,MAAM,CAACkB;EAAW,gBAC7B3B,KAAA,CAAAoB,aAAA,CAACf,UAAU;IAACO,SAAS,EAAEA,SAAU;IAACgB,QAAQ,EAAET;EAAY,CAAE,CACtD,CACN,CAEA,CAAC,EACNH,aAAa,gBACZhB,KAAA,CAAAoB,aAAA,CAACnB,IAAI;IAACoB,KAAK,EAAEZ,MAAM,CAACoB;EAAc,gBAChC7B,KAAA,CAAAoB,aAAA,CAAChB,WAAW;IAAC0B,OAAO,EAAEd;EAAc,CAAE,CAClC,CAAC,GACL,IAAI,eAERhB,KAAA,CAAAoB,aAAA,CAACnB,IAAI;IAACoB,KAAK,EAAEZ,MAAM,CAACsB;EAAQ,GACzBlB,eAAe,gBACdb,KAAA,CAAAoB,aAAA,CAACd,aAAa,MAAE,CAAC,GACfM,SAAS,gBACXZ,KAAA,CAAAoB,aAAA,CAACZ,cAAc,MAAE,CAAC,gBAElBR,KAAA,CAAAoB,aAAA,CAACb,UAAU,MAAE,CAEX,CACF,CAAC;AAAA,CACR;AAED,eAAeG,OAAO"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
+
import { ActivityIndicator, FlatList, RefreshControl, View } from 'react-native';
|
|
3
|
+
import BundleHistoryCard from '../components/BundleHistoryCard';
|
|
4
|
+
import StateCard from '../components/StateCard';
|
|
5
|
+
import { EMPTY_BUNDLES_SUBTITLE, EMPTY_BUNDLES_TITLE, EMPTY_ERROR_MESSAGE_BUNDLE, END_REACH_THRESHOLD, GENERIC_ERROR_TITLE } from '../../../../constants/appConstants';
|
|
6
|
+
import { DS_COLORS } from '../../../../constants/designTokens';
|
|
7
|
+
import { GlobalContext } from '../../../../state';
|
|
8
|
+
import { BUNDLE_STATUS } from '../../../../../types/bundle.types';
|
|
9
|
+
import { restart } from '../../../../utils/StallionNativeUtils';
|
|
10
|
+
import styles from '../styles';
|
|
11
|
+
const Separator = () => /*#__PURE__*/React.createElement(View, {
|
|
12
|
+
style: styles.cardSeparator
|
|
13
|
+
});
|
|
14
|
+
const BundleHistory = () => {
|
|
15
|
+
var _downloadState$data2;
|
|
16
|
+
const {
|
|
17
|
+
bundleState,
|
|
18
|
+
metaState,
|
|
19
|
+
downloadState,
|
|
20
|
+
actions: {
|
|
21
|
+
fetchBundles,
|
|
22
|
+
downloadBundle
|
|
23
|
+
}
|
|
24
|
+
} = useContext(GlobalContext);
|
|
25
|
+
const [expandedNotes, setExpandedNotes] = useState({});
|
|
26
|
+
const [downloadingId, setDownloadingId] = useState(null);
|
|
27
|
+
const wasDownloading = useRef(false);
|
|
28
|
+
const selectedBucketId = bundleState.selectedBucketId;
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (selectedBucketId) {
|
|
31
|
+
fetchBundles(selectedBucketId);
|
|
32
|
+
}
|
|
33
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
34
|
+
}, [selectedBucketId]);
|
|
35
|
+
|
|
36
|
+
// The download reducer is global, so pair it with the bundle we kicked off.
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (wasDownloading.current && !downloadState.isLoading) {
|
|
39
|
+
setDownloadingId(null);
|
|
40
|
+
}
|
|
41
|
+
wasDownloading.current = !!downloadState.isLoading;
|
|
42
|
+
}, [downloadState.isLoading]);
|
|
43
|
+
const bundles = useMemo(() => bundleState.data || [], [bundleState.data]);
|
|
44
|
+
const latestBundleId = useMemo(() => {
|
|
45
|
+
var _bundles$reduce;
|
|
46
|
+
return (_bundles$reduce = bundles.reduce((latest, bundle) => !latest || bundle.version > latest.version ? bundle : latest, null)) === null || _bundles$reduce === void 0 ? void 0 : _bundles$reduce.id;
|
|
47
|
+
}, [bundles]);
|
|
48
|
+
const getStatus = useCallback(bundleId => {
|
|
49
|
+
const stageSlot = metaState === null || metaState === void 0 ? void 0 : metaState.stageSlot;
|
|
50
|
+
if ((stageSlot === null || stageSlot === void 0 ? void 0 : stageSlot.newHash) === bundleId) return BUNDLE_STATUS.ACTIVE;
|
|
51
|
+
if ((stageSlot === null || stageSlot === void 0 ? void 0 : stageSlot.tempHash) === bundleId) return BUNDLE_STATUS.DOWNLOADED;
|
|
52
|
+
if (downloadingId === bundleId && downloadState.isLoading) return BUNDLE_STATUS.DOWNLOADING;
|
|
53
|
+
return BUNDLE_STATUS.AVAILABLE;
|
|
54
|
+
}, [metaState === null || metaState === void 0 ? void 0 : metaState.stageSlot, downloadingId, downloadState.isLoading]);
|
|
55
|
+
const handleDownload = useCallback(bundleId => {
|
|
56
|
+
if (downloadState.isLoading) return;
|
|
57
|
+
const bundle = bundles.find(item => item.id === bundleId);
|
|
58
|
+
if (!bundle) return;
|
|
59
|
+
setDownloadingId(bundleId);
|
|
60
|
+
downloadBundle(bundle.downloadUrl, bundleId);
|
|
61
|
+
}, [bundles, downloadBundle, downloadState.isLoading]);
|
|
62
|
+
const handleRestart = useCallback(() => {
|
|
63
|
+
requestAnimationFrame(() => restart());
|
|
64
|
+
}, []);
|
|
65
|
+
const handleToggleExpand = useCallback(bundleId => {
|
|
66
|
+
setExpandedNotes(previous => ({
|
|
67
|
+
...previous,
|
|
68
|
+
[bundleId]: !previous[bundleId]
|
|
69
|
+
}));
|
|
70
|
+
}, []);
|
|
71
|
+
const handleRefresh = useCallback(() => fetchBundles(selectedBucketId), [fetchBundles, selectedBucketId]);
|
|
72
|
+
const handleEndReached = useCallback(() => {
|
|
73
|
+
if (bundleState.pageOffset && !bundleState.isLoading && !bundleState.isNextPageLoading) {
|
|
74
|
+
fetchBundles(selectedBucketId, bundleState.pageOffset);
|
|
75
|
+
}
|
|
76
|
+
}, [fetchBundles, selectedBucketId, bundleState.pageOffset, bundleState.isLoading, bundleState.isNextPageLoading]);
|
|
77
|
+
const renderItem = useCallback(_ref => {
|
|
78
|
+
var _item$author, _downloadState$data;
|
|
79
|
+
let {
|
|
80
|
+
item
|
|
81
|
+
} = _ref;
|
|
82
|
+
const isDownloading = downloadingId === item.id;
|
|
83
|
+
return /*#__PURE__*/React.createElement(BundleHistoryCard, {
|
|
84
|
+
id: item.id,
|
|
85
|
+
version: item.version,
|
|
86
|
+
releaseNote: item.releaseNote,
|
|
87
|
+
author: (_item$author = item.author) === null || _item$author === void 0 ? void 0 : _item$author.fullName,
|
|
88
|
+
updatedAt: item.updatedAt,
|
|
89
|
+
size: item.size,
|
|
90
|
+
isLatest: item.id === latestBundleId,
|
|
91
|
+
status: getStatus(item.id)
|
|
92
|
+
// Only the active download row receives progress so memo can skip
|
|
93
|
+
// the rest of the list on each tick.
|
|
94
|
+
,
|
|
95
|
+
progress: isDownloading ? ((_downloadState$data = downloadState.data) === null || _downloadState$data === void 0 ? void 0 : _downloadState$data.currentProgress) || 0 : undefined,
|
|
96
|
+
expanded: !!expandedNotes[item.id],
|
|
97
|
+
onToggleExpand: handleToggleExpand,
|
|
98
|
+
onDownload: handleDownload,
|
|
99
|
+
onRestart: handleRestart
|
|
100
|
+
});
|
|
101
|
+
}, [latestBundleId, downloadingId, getStatus, (_downloadState$data2 = downloadState.data) === null || _downloadState$data2 === void 0 ? void 0 : _downloadState$data2.currentProgress, expandedNotes, handleToggleExpand, handleDownload, handleRestart]);
|
|
102
|
+
if (bundleState.isLoading && !bundles.length) {
|
|
103
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
104
|
+
style: styles.centeredFill
|
|
105
|
+
}, /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
106
|
+
color: DS_COLORS.indigo
|
|
107
|
+
}));
|
|
108
|
+
}
|
|
109
|
+
if (!bundles.length) {
|
|
110
|
+
const isEmpty = bundleState.error === EMPTY_ERROR_MESSAGE_BUNDLE;
|
|
111
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
112
|
+
style: styles.screenPadding
|
|
113
|
+
}, /*#__PURE__*/React.createElement(StateCard, {
|
|
114
|
+
title: isEmpty ? EMPTY_BUNDLES_TITLE : GENERIC_ERROR_TITLE,
|
|
115
|
+
subtitle: isEmpty ? EMPTY_BUNDLES_SUBTITLE : bundleState.error || undefined,
|
|
116
|
+
onRetry: handleRefresh
|
|
117
|
+
}));
|
|
118
|
+
}
|
|
119
|
+
return /*#__PURE__*/React.createElement(FlatList, {
|
|
120
|
+
style: styles.content,
|
|
121
|
+
contentContainerStyle: styles.screenPadding,
|
|
122
|
+
data: bundles,
|
|
123
|
+
keyExtractor: item => item.id,
|
|
124
|
+
renderItem: renderItem,
|
|
125
|
+
ItemSeparatorComponent: Separator,
|
|
126
|
+
refreshControl: /*#__PURE__*/React.createElement(RefreshControl, {
|
|
127
|
+
refreshing: bundleState.isLoading,
|
|
128
|
+
onRefresh: handleRefresh,
|
|
129
|
+
tintColor: DS_COLORS.indigo,
|
|
130
|
+
colors: [DS_COLORS.indigo]
|
|
131
|
+
}),
|
|
132
|
+
onEndReached: handleEndReached,
|
|
133
|
+
onEndReachedThreshold: END_REACH_THRESHOLD,
|
|
134
|
+
ListFooterComponent: bundleState.isNextPageLoading ? /*#__PURE__*/React.createElement(View, {
|
|
135
|
+
style: styles.listFooter
|
|
136
|
+
}, /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
137
|
+
color: DS_COLORS.indigo
|
|
138
|
+
})) : null
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
export default BundleHistory;
|
|
142
|
+
//# sourceMappingURL=BundleHistory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useCallback","useContext","useEffect","useMemo","useRef","useState","ActivityIndicator","FlatList","RefreshControl","View","BundleHistoryCard","StateCard","EMPTY_BUNDLES_SUBTITLE","EMPTY_BUNDLES_TITLE","EMPTY_ERROR_MESSAGE_BUNDLE","END_REACH_THRESHOLD","GENERIC_ERROR_TITLE","DS_COLORS","GlobalContext","BUNDLE_STATUS","restart","styles","Separator","createElement","style","cardSeparator","BundleHistory","_downloadState$data2","bundleState","metaState","downloadState","actions","fetchBundles","downloadBundle","expandedNotes","setExpandedNotes","downloadingId","setDownloadingId","wasDownloading","selectedBucketId","current","isLoading","bundles","data","latestBundleId","_bundles$reduce","reduce","latest","bundle","version","id","getStatus","bundleId","stageSlot","newHash","ACTIVE","tempHash","DOWNLOADED","DOWNLOADING","AVAILABLE","handleDownload","find","item","downloadUrl","handleRestart","requestAnimationFrame","handleToggleExpand","previous","handleRefresh","handleEndReached","pageOffset","isNextPageLoading","renderItem","_ref","_item$author","_downloadState$data","isDownloading","releaseNote","author","fullName","updatedAt","size","isLatest","status","progress","currentProgress","undefined","expanded","onToggleExpand","onDownload","onRestart","length","centeredFill","color","indigo","isEmpty","error","screenPadding","title","subtitle","onRetry","content","contentContainerStyle","keyExtractor","ItemSeparatorComponent","refreshControl","refreshing","onRefresh","tintColor","colors","onEndReached","onEndReachedThreshold","ListFooterComponent","listFooter"],"sourceRoot":"../../../../../../../src","sources":["main/components/modules/devMenu/screens/BundleHistory.tsx"],"mappings":"AAAA,OAAOA,KAAK,IACVC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,OAAO;AACd,SACEC,iBAAiB,EACjBC,QAAQ,EACRC,cAAc,EACdC,IAAI,QACC,cAAc;AAErB,OAAOC,iBAAiB,MAAM,iCAAiC;AAC/D,OAAOC,SAAS,MAAM,yBAAyB;AAE/C,SACEC,sBAAsB,EACtBC,mBAAmB,EACnBC,0BAA0B,EAC1BC,mBAAmB,EACnBC,mBAAmB,QACd,oCAAoC;AAC3C,SAASC,SAAS,QAAQ,oCAAoC;AAC9D,SAASC,aAAa,QAAQ,mBAAmB;AACjD,SAASC,aAAa,QAAqB,mCAAmC;AAC9E,SAASC,OAAO,QAAQ,uCAAuC;AAE/D,OAAOC,MAAM,MAAM,WAAW;AAE9B,MAAMC,SAAmB,GAAGA,CAAA,kBAAMvB,KAAA,CAAAwB,aAAA,CAACd,IAAI;EAACe,KAAK,EAAEH,MAAM,CAACI;AAAc,CAAE,CAAC;AAEvE,MAAMC,aAAuB,GAAGA,CAAA,KAAM;EAAA,IAAAC,oBAAA;EACpC,MAAM;IACJC,WAAW;IACXC,SAAS;IACTC,aAAa;IACbC,O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O,EAAEhC;IAAc,CACxB,CACG,CAAC;EAEX;EAEA,oBACErE,KAAA,CAAAwB,aAAA,CAAChB,QAAQ;IACPiB,KAAK,EAAEH,MAAM,CAACgF,OAAQ;IACtBC,qBAAqB,EAAEjF,MAAM,CAAC4E,aAAc;IAC5CtD,IAAI,EAAED,OAAQ;IACd6D,YAAY,EAAGzC,IAAI,IAAKA,IAAI,CAACZ,EAAG;IAChCsB,UAAU,EAAEA,UAAW;IACvBgC,sBAAsB,EAAElF,SAAU;IAClCmF,cAAc,eACZ1G,KAAA,CAAAwB,aAAA,CAACf,cAAc;MACbkG,UAAU,EAAE9E,WAAW,CAACa,SAAU;MAClCkE,SAAS,EAAEvC,aAAc;MACzBwC,SAAS,EAAE3F,SAAS,CAAC6E,MAAO;MAC5Be,MAAM,EAAE,CAAC5F,SAAS,CAAC6E,MAAM;IAAE,CAC5B,CACF;IACDgB,YAAY,EAAEzC,gBAAiB;IAC/B0C,qBAAqB,EAAEhG,mBAAoB;IAC3CiG,mBAAmB,EACjBpF,WAAW,CAAC2C,iBAAiB,gBAC3BxE,KAAA,CAAAwB,aAAA,CAACd,IAAI;MAACe,KAAK,EAAEH,MAAM,CAAC4F;IAAW,gBAC7BlH,KAAA,CAAAwB,aAAA,CAACjB,iBAAiB;MAACuF,KAAK,EAAE5E,SAAS,CAAC6E;IAAO,CAAE,CACzC,CAAC,GACL;EACL,CACF,CAAC;AAEN,CAAC;AAED,eAAepE,aAAa"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React, { useCallback, useContext, useState } from 'react';
|
|
2
|
+
import { ScrollView, View } from 'react-native';
|
|
3
|
+
import DeviceCard from '../components/DeviceCard';
|
|
4
|
+
import ProdBundleCard from '../components/ProdBundleCard';
|
|
5
|
+
import SectionLabel from '../components/SectionLabel';
|
|
6
|
+
import StateCard from '../components/StateCard';
|
|
7
|
+
import { PROD_EMPTY_SUBTITLE, PROD_EMPTY_TITLE, SECTION_LABELS } from '../../../../constants/appConstants';
|
|
8
|
+
import { GlobalContext } from '../../../../state';
|
|
9
|
+
import { restart } from '../../../../utils/StallionNativeUtils';
|
|
10
|
+
import styles from '../styles';
|
|
11
|
+
const Production = () => {
|
|
12
|
+
const {
|
|
13
|
+
configState,
|
|
14
|
+
updateMetaState
|
|
15
|
+
} = useContext(GlobalContext);
|
|
16
|
+
const [expandedNotes, setExpandedNotes] = useState({});
|
|
17
|
+
const newBundle = updateMetaState.newBundle;
|
|
18
|
+
const activeBundle = updateMetaState.currentlyRunningBundle;
|
|
19
|
+
const hasBundles = !!(newBundle || activeBundle);
|
|
20
|
+
const handleToggleExpand = useCallback(bundleId => {
|
|
21
|
+
setExpandedNotes(previous => ({
|
|
22
|
+
...previous,
|
|
23
|
+
[bundleId]: !previous[bundleId]
|
|
24
|
+
}));
|
|
25
|
+
}, []);
|
|
26
|
+
const handleRestart = useCallback(() => {
|
|
27
|
+
requestAnimationFrame(() => restart());
|
|
28
|
+
}, []);
|
|
29
|
+
return /*#__PURE__*/React.createElement(ScrollView, {
|
|
30
|
+
style: styles.content,
|
|
31
|
+
contentContainerStyle: styles.screenPadding,
|
|
32
|
+
showsVerticalScrollIndicator: false
|
|
33
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
34
|
+
style: styles.section
|
|
35
|
+
}, /*#__PURE__*/React.createElement(SectionLabel, {
|
|
36
|
+
label: SECTION_LABELS.THIS_DEVICE
|
|
37
|
+
}), /*#__PURE__*/React.createElement(DeviceCard, {
|
|
38
|
+
appVersion: configState === null || configState === void 0 ? void 0 : configState.appVersion,
|
|
39
|
+
uid: configState === null || configState === void 0 ? void 0 : configState.uid
|
|
40
|
+
})), newBundle ? /*#__PURE__*/React.createElement(View, {
|
|
41
|
+
style: activeBundle ? styles.section : styles.sectionLast
|
|
42
|
+
}, /*#__PURE__*/React.createElement(SectionLabel, {
|
|
43
|
+
label: SECTION_LABELS.NEW_BUNDLE
|
|
44
|
+
}), /*#__PURE__*/React.createElement(ProdBundleCard, {
|
|
45
|
+
meta: newBundle,
|
|
46
|
+
variant: "pending",
|
|
47
|
+
expanded: !!expandedNotes[newBundle.id],
|
|
48
|
+
onToggleExpand: () => handleToggleExpand(newBundle.id),
|
|
49
|
+
onRestart: handleRestart
|
|
50
|
+
})) : null, activeBundle ? /*#__PURE__*/React.createElement(View, {
|
|
51
|
+
style: styles.sectionLast
|
|
52
|
+
}, /*#__PURE__*/React.createElement(SectionLabel, {
|
|
53
|
+
label: SECTION_LABELS.ACTIVE_BUNDLE
|
|
54
|
+
}), /*#__PURE__*/React.createElement(ProdBundleCard, {
|
|
55
|
+
meta: activeBundle,
|
|
56
|
+
variant: "active",
|
|
57
|
+
expanded: !!expandedNotes[activeBundle.id],
|
|
58
|
+
onToggleExpand: () => handleToggleExpand(activeBundle.id)
|
|
59
|
+
})) : null, !hasBundles ? /*#__PURE__*/React.createElement(StateCard, {
|
|
60
|
+
title: PROD_EMPTY_TITLE,
|
|
61
|
+
subtitle: PROD_EMPTY_SUBTITLE
|
|
62
|
+
}) : null);
|
|
63
|
+
};
|
|
64
|
+
export default Production;
|
|
65
|
+
//# sourceMappingURL=Production.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useCallback","useContext","useState","ScrollView","View","DeviceCard","ProdBundleCard","SectionLabel","StateCard","PROD_EMPTY_SUBTITLE","PROD_EMPTY_TITLE","SECTION_LABELS","GlobalContext","restart","styles","Production","configState","updateMetaState","expandedNotes","setExpandedNotes","newBundle","activeBundle","currentlyRunningBundle","hasBundles","handleToggleExpand","bundleId","previous","handleRestart","requestAnimationFrame","createElement","style","content","contentContainerStyle","screenPadding","showsVerticalScrollIndicator","section","label","THIS_DEVICE","appVersion","uid","sectionLast","NEW_BUNDLE","meta","variant","expanded","id","onToggleExpand","onRestart","ACTIVE_BUNDLE","title","subtitle"],"sourceRoot":"../../../../../../../src","sources":["main/components/modules/devMenu/screens/Production.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC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Q;IAChBC,QAAQ,EAAE,CAAC,CAAC1B,aAAa,CAACG,YAAY,CAACwB,EAAE,CAAE;IAC3CC,cAAc,EAAEA,CAAA,KAAMtB,kBAAkB,CAACH,YAAY,CAACwB,EAAE;EAAE,CAC3D,CACG,CAAC,GACL,IAAI,EACP,CAACtB,UAAU,gBACVxB,KAAA,CAAA8B,aAAA,CAACrB,SAAS;IAACyC,KAAK,EAAEvC,gBAAiB;IAACwC,QAAQ,EAAEzC;EAAoB,CAAE,CAAC,GACnE,IACM,CAAC;AAEjB,CAAC;AAED,eAAeM,UAAU"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import React, { useCallback, useContext, useEffect } from 'react';
|
|
2
|
+
import { ActivityIndicator, FlatList, RefreshControl, View } from 'react-native';
|
|
3
|
+
import BucketRow from '../components/BucketRow';
|
|
4
|
+
import SectionLabel from '../components/SectionLabel';
|
|
5
|
+
import StateCard from '../components/StateCard';
|
|
6
|
+
import { EMPTY_BUCKETS_SUBTITLE, EMPTY_BUCKETS_TITLE, EMPTY_ERROR_MESSAGE, GENERIC_ERROR_TITLE, IS_ANDROID, SECTION_LABELS } from '../../../../constants/appConstants';
|
|
7
|
+
import { DS_COLORS } from '../../../../constants/designTokens';
|
|
8
|
+
import { GlobalContext } from '../../../../state';
|
|
9
|
+
import styles from '../styles';
|
|
10
|
+
const Separator = () => /*#__PURE__*/React.createElement(View, {
|
|
11
|
+
style: styles.cardSeparator
|
|
12
|
+
});
|
|
13
|
+
const TestingBuckets = () => {
|
|
14
|
+
const {
|
|
15
|
+
bucketState,
|
|
16
|
+
actions: {
|
|
17
|
+
fetchBuckets,
|
|
18
|
+
selectBucket
|
|
19
|
+
}
|
|
20
|
+
} = useContext(GlobalContext);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (!bucketState.data) {
|
|
23
|
+
fetchBuckets();
|
|
24
|
+
}
|
|
25
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
26
|
+
}, []);
|
|
27
|
+
const handleBucketPress = useCallback(bucketId => {
|
|
28
|
+
requestAnimationFrame(() => selectBucket(bucketId));
|
|
29
|
+
}, [selectBucket]);
|
|
30
|
+
const renderItem = useCallback(_ref => {
|
|
31
|
+
let {
|
|
32
|
+
item
|
|
33
|
+
} = _ref;
|
|
34
|
+
return /*#__PURE__*/React.createElement(BucketRow, {
|
|
35
|
+
id: item.id,
|
|
36
|
+
name: item.name,
|
|
37
|
+
updatedAt: item.updatedAt,
|
|
38
|
+
latestVersion: (IS_ANDROID ? item.latestAndroidBundleVersion : item.latestIosBundleVersion) || 0,
|
|
39
|
+
onPress: handleBucketPress
|
|
40
|
+
});
|
|
41
|
+
}, [handleBucketPress]);
|
|
42
|
+
const buckets = bucketState.data || [];
|
|
43
|
+
if (bucketState.isLoading && !buckets.length) {
|
|
44
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
45
|
+
style: styles.centeredFill
|
|
46
|
+
}, /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
47
|
+
color: DS_COLORS.indigo
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
if (!buckets.length) {
|
|
51
|
+
const isEmpty = bucketState.error === EMPTY_ERROR_MESSAGE;
|
|
52
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
53
|
+
style: styles.screenPadding
|
|
54
|
+
}, /*#__PURE__*/React.createElement(SectionLabel, {
|
|
55
|
+
label: SECTION_LABELS.BUCKETS
|
|
56
|
+
}), /*#__PURE__*/React.createElement(StateCard, {
|
|
57
|
+
title: isEmpty ? EMPTY_BUCKETS_TITLE : GENERIC_ERROR_TITLE,
|
|
58
|
+
subtitle: isEmpty ? EMPTY_BUCKETS_SUBTITLE : bucketState.error || undefined,
|
|
59
|
+
onRetry: fetchBuckets
|
|
60
|
+
}));
|
|
61
|
+
}
|
|
62
|
+
return /*#__PURE__*/React.createElement(FlatList, {
|
|
63
|
+
style: styles.content,
|
|
64
|
+
contentContainerStyle: styles.screenPadding,
|
|
65
|
+
data: buckets,
|
|
66
|
+
keyExtractor: item => item.id,
|
|
67
|
+
renderItem: renderItem,
|
|
68
|
+
ItemSeparatorComponent: Separator,
|
|
69
|
+
ListHeaderComponent: /*#__PURE__*/React.createElement(SectionLabel, {
|
|
70
|
+
label: SECTION_LABELS.BUCKETS
|
|
71
|
+
}),
|
|
72
|
+
refreshControl: /*#__PURE__*/React.createElement(RefreshControl, {
|
|
73
|
+
refreshing: bucketState.isLoading,
|
|
74
|
+
onRefresh: fetchBuckets,
|
|
75
|
+
tintColor: DS_COLORS.indigo,
|
|
76
|
+
colors: [DS_COLORS.indigo]
|
|
77
|
+
})
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
export default TestingBuckets;
|
|
81
|
+
//# sourceMappingURL=TestingBuckets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useCallback","useContext","useEffect","ActivityIndicator","FlatList","RefreshControl","View","BucketRow","SectionLabel","StateCard","EMPTY_BUCKETS_SUBTITLE","EMPTY_BUCKETS_TITLE","EMPTY_ERROR_MESSAGE","GENERIC_ERROR_TITLE","IS_ANDROID","SECTION_LABELS","DS_COLORS","GlobalContext","styles","Separator","createElement","style","cardSeparator","TestingBuckets","bucketState","actions","fetchBuckets","selectBucket","data","handleBucketPress","bucketId","requestAnimationFrame","renderItem","_ref","item","id","name","updatedAt","latestVersion","latestAndroidBundleVersion","latestIosBundleVersion","onPress","buckets","isLoading","length","centeredFill","color","indigo","isEmpty","error","screenPadding","label","BUCKETS","title","subtitle","undefined","onRetry","content","contentContainerStyle","keyExtractor","ItemSeparatorComponent","ListHeaderComponent","refreshControl","refreshing","onRefresh","tintColor","colors"],"sourceRoot":"../../../../../../../src","sources":["main/components/modules/devMenu/screens/TestingBuckets.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,UAAU,EAAEC,SAAS,QAAQ,OAAO;AACjE,SACEC,iBAAiB,EACjBC,QAAQ,EACRC,cAAc,EACdC,I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SAAU;IAClC0C,mBAAmB,eAAE9D,KAAA,CAAAqB,aAAA,CAACZ,YAAY;MAAC2C,KAAK,EAAEpC,cAAc,CAACqC;IAAQ,CAAE,CAAE;IACrEU,cAAc,eACZ/D,KAAA,CAAAqB,aAAA,CAACf,cAAc;MACb0D,UAAU,EAAEvC,WAAW,CAACmB,SAAU;MAClCqB,SAAS,EAAEtC,YAAa;MACxBuC,SAAS,EAAEjD,SAAS,CAAC+B,MAAO;MAC5BmB,MAAM,EAAE,CAAClD,SAAS,CAAC+B,MAAM;IAAE,CAC5B;EACF,CACF,CAAC;AAEN,CAAC;AAED,eAAexB,cAAc"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { DS_COLORS, DS_SPACING } from '../../../constants/designTokens';
|
|
3
|
+
const styles = StyleSheet.create({
|
|
4
|
+
root: {
|
|
5
|
+
flex: 1,
|
|
6
|
+
backgroundColor: DS_COLORS.screenBg
|
|
7
|
+
},
|
|
8
|
+
headerSafeArea: {
|
|
9
|
+
backgroundColor: DS_COLORS.cardBg
|
|
10
|
+
},
|
|
11
|
+
// The wordmark header and the mode toggle share one slab; only the slab's
|
|
12
|
+
// bottom edge carries the hairline.
|
|
13
|
+
toggleArea: {
|
|
14
|
+
paddingHorizontal: DS_SPACING.screen,
|
|
15
|
+
paddingBottom: 18,
|
|
16
|
+
borderBottomWidth: 1,
|
|
17
|
+
paddingTop: DS_SPACING.cardGap,
|
|
18
|
+
borderBottomColor: DS_COLORS.headerHairline
|
|
19
|
+
},
|
|
20
|
+
content: {
|
|
21
|
+
flex: 1,
|
|
22
|
+
backgroundColor: DS_COLORS.contentBg
|
|
23
|
+
},
|
|
24
|
+
screenPadding: {
|
|
25
|
+
padding: DS_SPACING.screen
|
|
26
|
+
},
|
|
27
|
+
cardSeparator: {
|
|
28
|
+
height: DS_SPACING.cardGap
|
|
29
|
+
},
|
|
30
|
+
section: {
|
|
31
|
+
marginBottom: DS_SPACING.section
|
|
32
|
+
},
|
|
33
|
+
sectionLast: {
|
|
34
|
+
marginBottom: 0
|
|
35
|
+
},
|
|
36
|
+
bannerWrapper: {
|
|
37
|
+
paddingHorizontal: DS_SPACING.screen,
|
|
38
|
+
paddingTop: DS_SPACING.cardGap
|
|
39
|
+
},
|
|
40
|
+
centeredFill: {
|
|
41
|
+
flex: 1,
|
|
42
|
+
alignItems: 'center',
|
|
43
|
+
justifyContent: 'center'
|
|
44
|
+
},
|
|
45
|
+
listFooter: {
|
|
46
|
+
paddingVertical: DS_SPACING.cardGap
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
export default styles;
|
|
50
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["StyleSheet","DS_COLORS","DS_SPACING","styles","create","root","flex","backgroundColor","screenBg","headerSafeArea","cardBg","toggleArea","paddingHorizontal","screen","paddingBottom","borderBottomWidth","paddingTop","cardGap","borderBottomColor","headerHairline","content","contentBg","screenPadding","padding","cardSeparator","height","section","marginBottom","sectionLast","bannerWrapper","centeredFill","alignItems","justifyContent","listFooter","paddingVertical"],"sourceRoot":"../../../../../../src","sources":["main/components/modules/devMenu/styles.ts"],"mappings":"AAAA,SAASA,UAAU,QAAQ,cAAc;AAEzC,SAASC,SAAS,EAAEC,UAAU,QAAQ,iCAAiC;AAEvE,MAAMC,MAAM,GAAGH,UAAU,CAACI,MAAM,CAAC;EAC/BC,IAAI,EAAE;IACJC,IAAI,EAAE,CAAC;IACPC,eAAe,EAAEN,SAAS,CAACO;EAC7B,CAAC;EACDC,cAAc,EAAE;IACdF,eAAe,EAAEN,SAAS,CAACS;EAC7B,CAAC;EACD;EACA;EACAC,UAAU,EAAE;IACVC,iBAAiB,EAAEV,UAAU,CAACW,MAAM;IACpCC,aAAa,EAAE,EAAE;IACjBC,iBAAiB,EAAE,CAAC;IACpBC,UAAU,EAAEd,UAAU,CAACe,OAAO;IAC9BC,iBAAiB,EAAEjB,SAAS,CAACkB;EAC/B,CAAC;EACDC,OAAO,EAAE;IACPd,IAAI,EAAE,CAAC;IACPC,eAAe,EAAEN,SAAS,CAACoB;EAC7B,CAAC;EACDC,aAAa,EAAE;IACbC,OAAO,EAAErB,UAAU,CAACW;EACtB,CAAC;EACDW,aAAa,EAAE;IACbC,MAAM,EAAEvB,UAAU,CAACe;EACrB,CAAC;EACDS,OAAO,EAAE;IACPC,YAAY,EAAEzB,UAAU,CAACwB;EAC3B,CAAC;EACDE,WAAW,EAAE;IACXD,YAAY,EAAE;EAChB,CAAC;EACDE,aAAa,EAAE;IACbjB,iBAAiB,EAAEV,UAAU,CAACW,MAAM;IACpCG,UAAU,EAAEd,UAAU,CAACe;EACzB,CAAC;EACDa,YAAY,EAAE;IACZxB,IAAI,EAAE,CAAC;IACPyB,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDC,UAAU,EAAE;IACVC,eAAe,EAAEhC,UAAU,CAACe;EAC9B;AACF,CAAC,CAAC;AAEF,eAAed,MAAM"}
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
import React, { useContext } from 'react';
|
|
2
|
-
import { Modal, SafeAreaView, StyleSheet
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import Footer from '../../../components/common/Footer';
|
|
6
|
-
import { HEADER_TITLE } from '../../../constants/appConstants';
|
|
7
|
-
import { COLORS } from '../../../constants/colors';
|
|
8
|
-
import Listing from '../listing';
|
|
9
|
-
import useStallionModal from './hooks/useStallionModal';
|
|
10
|
-
import OverlayLoader from '../../../components/common/OverlayLoader';
|
|
11
|
-
import { SWITCH_STATES } from '../../../../types/meta.types';
|
|
12
|
-
import Prod from '../prod';
|
|
1
|
+
import React, { useCallback, useContext } from 'react';
|
|
2
|
+
import { Modal, SafeAreaView, StyleSheet } from 'react-native';
|
|
3
|
+
import StallionDevMenu from '../../StallionDevMenu';
|
|
4
|
+
import { DS_COLORS } from '../../../constants/designTokens';
|
|
13
5
|
import { GlobalContext } from '../../../state';
|
|
14
6
|
const StallionModal = () => {
|
|
15
7
|
const {
|
|
@@ -18,52 +10,24 @@ const StallionModal = () => {
|
|
|
18
10
|
setIsModalVisible
|
|
19
11
|
}
|
|
20
12
|
} = useContext(GlobalContext);
|
|
13
|
+
const onClosePress = useCallback(() => {
|
|
14
|
+
requestAnimationFrame(() => setIsModalVisible(false));
|
|
15
|
+
}, [setIsModalVisible]);
|
|
21
16
|
return /*#__PURE__*/React.createElement(Modal, {
|
|
22
|
-
transparent: true,
|
|
23
17
|
animationType: "slide",
|
|
18
|
+
presentationStyle: "fullScreen",
|
|
24
19
|
visible: isModalVisible,
|
|
25
20
|
onRequestClose: () => setIsModalVisible(false)
|
|
26
|
-
}, isModalVisible ? /*#__PURE__*/React.createElement(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
onClosePress,
|
|
32
|
-
loginRequired,
|
|
33
|
-
isBackEnabled,
|
|
34
|
-
isDownloading,
|
|
35
|
-
downloadProgress,
|
|
36
|
-
metaState,
|
|
37
|
-
downloadError,
|
|
38
|
-
handleSwitch,
|
|
39
|
-
internalIsRestartRequired
|
|
40
|
-
} = useStallionModal();
|
|
41
|
-
return /*#__PURE__*/React.createElement(SafeAreaView, {
|
|
42
|
-
style: styles.container
|
|
43
|
-
}, /*#__PURE__*/React.createElement(Header, {
|
|
44
|
-
title: loginRequired ? null : HEADER_TITLE,
|
|
45
|
-
onClosePress: onClosePress,
|
|
46
|
-
onBackPress: isBackEnabled ? onBackPress : null
|
|
47
|
-
}), /*#__PURE__*/React.createElement(View, {
|
|
48
|
-
style: styles.listingSection
|
|
49
|
-
}, loginRequired ? /*#__PURE__*/React.createElement(Login, null) : metaState.switchState === SWITCH_STATES.STAGE ? /*#__PURE__*/React.createElement(Listing, null) : /*#__PURE__*/React.createElement(Prod, null), isDownloading && /*#__PURE__*/React.createElement(OverlayLoader, {
|
|
50
|
-
currentDownloadFraction: downloadProgress
|
|
51
|
-
})), loginRequired ? null : /*#__PURE__*/React.createElement(Footer, {
|
|
52
|
-
switchIsOn: metaState.switchState === SWITCH_STATES.STAGE,
|
|
53
|
-
onSwitchToggle: handleSwitch,
|
|
54
|
-
errorMessage: downloadError,
|
|
55
|
-
isRestartRequired: internalIsRestartRequired
|
|
56
|
-
}));
|
|
21
|
+
}, isModalVisible ? /*#__PURE__*/React.createElement(SafeAreaView, {
|
|
22
|
+
style: styles.safeArea
|
|
23
|
+
}, /*#__PURE__*/React.createElement(StallionDevMenu, {
|
|
24
|
+
onClosePress: onClosePress
|
|
25
|
+
})) : null);
|
|
57
26
|
};
|
|
58
27
|
const styles = StyleSheet.create({
|
|
59
|
-
|
|
28
|
+
safeArea: {
|
|
60
29
|
flex: 1,
|
|
61
|
-
|
|
62
|
-
alignContent: 'center',
|
|
63
|
-
backgroundColor: COLORS.white
|
|
64
|
-
},
|
|
65
|
-
listingSection: {
|
|
66
|
-
flex: 1
|
|
30
|
+
backgroundColor: DS_COLORS.screenBg
|
|
67
31
|
}
|
|
68
32
|
});
|
|
69
33
|
export default StallionModal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useContext","Modal","SafeAreaView","StyleSheet","
|
|
1
|
+
{"version":3,"names":["React","useCallback","useContext","Modal","SafeAreaView","StyleSheet","StallionDevMenu","DS_COLORS","GlobalContext","StallionModal","isModalVisible","actions","setIsModalVisible","onClosePress","requestAnimationFrame","createElement","animationType","presentationStyle","visible","onRequestClose","style","styles","safeArea","create","flex","backgroundColor","screenBg"],"sourceRoot":"../../../../../../src","sources":["main/components/modules/modal/StallionModal.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,UAAU,QAAQ,OAAO;AACtD,SAASC,KAAK,EAAEC,YAAY,EAAEC,UAAU,QAAQ,cAAc;AAE9D,OAAOC,eAAe,MAAM,uBAAuB;AACnD,SAASC,SAAS,QAAQ,iCAAiC;AAC3D,SAASC,aAAa,QAAQ,gBAAgB;AAE9C,MAAMC,aAAuB,GAAGA,CAAA,KAAM;EACpC,MAAM;IACJC,cAAc;IACdC,OAAO,EAAE;MAAEC;IAAkB;EAC/B,CAAC,GAAGV,UAAU,CAACM,aAAa,CAAC;EAE7B,MAAMK,YAAY,GAAGZ,WAAW,CAAC,MAAM;IACrCa,qBAAqB,CAAC,MAAMF,iBAAiB,CAAC,KAAK,CAAC,CAAC;EACvD,CAAC,EAAE,CAACA,iBAAiB,CAAC,CAAC;EAEvB,oBACEZ,KAAA,CAAAe,aAAA,CAACZ,KAAK;IACJa,aAAa,EAAC,OAAO;IACrBC,iBAAiB,EAAC,YAAY;IAC9BC,OAAO,EAAER,cAAe;IACxBS,cAAc,EAAEA,CAAA,KAAMP,iBAAiB,CAAC,KAAK;EAAE,GAE9CF,cAAc,gBACbV,KAAA,CAAAe,aAAA,CAACX,YAAY;IAACgB,KAAK,EAAEC,MAAM,CAACC;EAAS,gBACnCtB,KAAA,CAAAe,aAAA,CAACT,eAAe;IAACO,YAAY,EAAEA;EAAa,CAAE,CAClC,CAAC,GACb,IACC,CAAC;AAEZ,CAAC;AAED,MAAMQ,MAAM,GAAGhB,UAAU,CAACkB,MAAM,CAAC;EAC/BD,QAAQ,EAAE;IACRE,IAAI,EAAE,CAAC;IACPC,eAAe,EAAElB,SAAS,CAACmB;EAC7B;AACF,CAAC,CAAC;AAEF,eAAejB,aAAa"}
|
|
@@ -2,12 +2,13 @@ import { useCallback, useContext, useMemo } from 'react';
|
|
|
2
2
|
import { GlobalContext } from '../../../../state';
|
|
3
3
|
import { toggleStallionSwitchNative } from '../../../../utils/StallionNativeUtils';
|
|
4
4
|
import { SWITCH_STATES } from '../../../../../types/meta.types';
|
|
5
|
+
import { BUNDLE_COUNT_SUFFIX, BUNDLE_COUNT_SUFFIX_SINGULAR, IS_ANDROID, META_SEPARATOR, SWITCH_TEXTS, VERSION_PREFIX } from '../../../../constants/appConstants';
|
|
5
6
|
const useStallionModal = () => {
|
|
6
|
-
var _downloadState$data2;
|
|
7
7
|
const {
|
|
8
8
|
isModalVisible,
|
|
9
9
|
configState,
|
|
10
10
|
metaState,
|
|
11
|
+
bucketState,
|
|
11
12
|
bundleState,
|
|
12
13
|
downloadState,
|
|
13
14
|
actions: {
|
|
@@ -24,14 +25,20 @@ const useStallionModal = () => {
|
|
|
24
25
|
requestAnimationFrame(() => setIsModalVisible(false));
|
|
25
26
|
}, [setIsModalVisible]);
|
|
26
27
|
const loginRequired = configState !== null && configState !== void 0 && configState.sdkToken ? false : true;
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
var
|
|
33
|
-
return ((
|
|
34
|
-
}, [
|
|
28
|
+
const isTesting = (metaState === null || metaState === void 0 ? void 0 : metaState.switchState) === SWITCH_STATES.STAGE;
|
|
29
|
+
|
|
30
|
+
/** Bundle history is a Testing-only push over the buckets list. */
|
|
31
|
+
const isBundleHistory = useMemo(() => isTesting && !!bundleState.selectedBucketId, [isTesting, bundleState.selectedBucketId]);
|
|
32
|
+
const selectedBucket = useMemo(() => {
|
|
33
|
+
var _bucketState$data;
|
|
34
|
+
return ((_bucketState$data = bucketState.data) === null || _bucketState$data === void 0 ? void 0 : _bucketState$data.find(bucket => bucket.id === bundleState.selectedBucketId)) || null;
|
|
35
|
+
}, [bucketState.data, bundleState.selectedBucketId]);
|
|
36
|
+
const bucketTitle = (selectedBucket === null || selectedBucket === void 0 ? void 0 : selectedBucket.name) || '';
|
|
37
|
+
const bucketSubtitle = useMemo(() => {
|
|
38
|
+
if (!selectedBucket) return SWITCH_TEXTS.ON;
|
|
39
|
+
const latestVersion = (IS_ANDROID ? selectedBucket.latestAndroidBundleVersion : selectedBucket.latestIosBundleVersion) || 0;
|
|
40
|
+
return [SWITCH_TEXTS.ON, `${VERSION_PREFIX}${latestVersion}`, `${latestVersion}${latestVersion === 1 ? BUNDLE_COUNT_SUFFIX_SINGULAR : BUNDLE_COUNT_SUFFIX}`].join(META_SEPARATOR);
|
|
41
|
+
}, [selectedBucket]);
|
|
35
42
|
const downloadError = useMemo(() => downloadState.error, [downloadState.error]);
|
|
36
43
|
const handleSwitch = useCallback(newSwitchStatus => {
|
|
37
44
|
setDownloadErrorMessage('');
|
|
@@ -41,22 +48,17 @@ const useStallionModal = () => {
|
|
|
41
48
|
selectBucket();
|
|
42
49
|
}
|
|
43
50
|
}, [refreshMeta, selectBucket, setDownloadErrorMessage]);
|
|
44
|
-
const internalIsRestartRequired = useMemo(() => {
|
|
45
|
-
var _metaState$prodSlot, _metaState$stageSlot;
|
|
46
|
-
return metaState.switchState === SWITCH_STATES.PROD && (_metaState$prodSlot = metaState.prodSlot) !== null && _metaState$prodSlot !== void 0 && _metaState$prodSlot.tempHash || metaState.switchState === SWITCH_STATES.STAGE && (_metaState$stageSlot = metaState.stageSlot) !== null && _metaState$stageSlot !== void 0 && _metaState$stageSlot.tempHash ? true : false;
|
|
47
|
-
}, [metaState]);
|
|
48
51
|
return {
|
|
49
52
|
isModalVisible,
|
|
50
53
|
onBackPress,
|
|
51
54
|
onClosePress,
|
|
52
55
|
loginRequired,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
isTesting,
|
|
57
|
+
isBundleHistory,
|
|
58
|
+
bucketTitle,
|
|
59
|
+
bucketSubtitle,
|
|
57
60
|
downloadError,
|
|
58
|
-
handleSwitch
|
|
59
|
-
internalIsRestartRequired
|
|
61
|
+
handleSwitch
|
|
60
62
|
};
|
|
61
63
|
};
|
|
62
64
|
export default useStallionModal;
|