react-native-stallion 1.0.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/README.md +36 -0
- package/android/build.gradle +100 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +8 -0
- package/android/src/main/java/com/stallion/Stallion.java +26 -0
- package/android/src/main/java/com/stallion/StallionConstants.java +27 -0
- package/android/src/main/java/com/stallion/StallionDefaultErrorActivity.java +27 -0
- package/android/src/main/java/com/stallion/StallionModule.java +250 -0
- package/android/src/main/java/com/stallion/StallionPackage.java +29 -0
- package/android/src/main/java/com/stallion/StallionStorage.java +54 -0
- package/android/src/main/java/com/stallion/StallionZip.java +127 -0
- package/android/src/main/res/layout/stallion_default_error_activity.xml +60 -0
- package/android/src/noop/java/com/stallion/Stallion.java +13 -0
- package/android/src/noop/java/com/stallion/StallionConstants.java +10 -0
- package/android/src/noop/java/com/stallion/StallionModule.java +26 -0
- package/android/src/noop/java/com/stallion/StallionPackage.java +29 -0
- package/ios/Stallion.xcodeproj/project.pbxproj +283 -0
- package/ios/main/Stallion-Bridging-Header.h +3 -0
- package/ios/main/Stallion.m +21 -0
- package/ios/main/Stallion.swift +69 -0
- package/ios/main/StallionConstants.swift +42 -0
- package/ios/main/StallionDownloader.swift +124 -0
- package/ios/main/StallionModule.h +13 -0
- package/ios/main/StallionModule.m +71 -0
- package/ios/main/StallionUtil.swift +29 -0
- package/ios/noop/Stallion-Bridging-Header.h +2 -0
- package/ios/noop/Stallion.m +12 -0
- package/ios/noop/Stallion.swift +7 -0
- package/ios/noop/StallionModule.h +13 -0
- package/ios/noop/StallionModule.m +20 -0
- package/package.json +62 -0
- package/react-native-stallion.podspec +50 -0
- package/src/StallionNativeModule.js +5 -0
- package/src/StallionNativeModule.js.map +1 -0
- package/src/index.js +29 -0
- package/src/index.js.map +1 -0
- package/src/main/components/common/ButtonFullWidth/index.js +20 -0
- package/src/main/components/common/ButtonFullWidth/index.js.map +1 -0
- package/src/main/components/common/ButtonFullWidth/styles.js +42 -0
- package/src/main/components/common/ButtonFullWidth/styles.js.map +1 -0
- package/src/main/components/common/ErrorView/index.js +18 -0
- package/src/main/components/common/ErrorView/index.js.map +1 -0
- package/src/main/components/common/ErrorView/styles.js +20 -0
- package/src/main/components/common/ErrorView/styles.js.map +1 -0
- package/src/main/components/common/Footer/index.js +49 -0
- package/src/main/components/common/Footer/index.js.map +1 -0
- package/src/main/components/common/Footer/styles.js +76 -0
- package/src/main/components/common/Footer/styles.js.map +1 -0
- package/src/main/components/common/Header/index.js +50 -0
- package/src/main/components/common/Header/index.js.map +1 -0
- package/src/main/components/common/Header/styles.js +63 -0
- package/src/main/components/common/Header/styles.js.map +1 -0
- package/src/main/components/common/OverlayLoader/index.js +26 -0
- package/src/main/components/common/OverlayLoader/index.js.map +1 -0
- package/src/main/components/common/OverlayLoader/styles.js +33 -0
- package/src/main/components/common/OverlayLoader/styles.js.map +1 -0
- package/src/main/components/common/ProfileOverlay/index.js +39 -0
- package/src/main/components/common/ProfileOverlay/index.js.map +1 -0
- package/src/main/components/common/ProfileOverlay/styles.js +37 -0
- package/src/main/components/common/ProfileOverlay/styles.js.map +1 -0
- package/src/main/components/common/Spinner/index.js +9 -0
- package/src/main/components/common/Spinner/index.js.map +1 -0
- package/src/main/components/modules/listing/components/BucketCard.js +33 -0
- package/src/main/components/modules/listing/components/BucketCard.js.map +1 -0
- package/src/main/components/modules/listing/components/BucketCardInfoSection.js +56 -0
- package/src/main/components/modules/listing/components/BucketCardInfoSection.js.map +1 -0
- package/src/main/components/modules/listing/components/BundleCard.js +36 -0
- package/src/main/components/modules/listing/components/BundleCard.js.map +1 -0
- package/src/main/components/modules/listing/components/BundleCardInfoSection.js +72 -0
- package/src/main/components/modules/listing/components/BundleCardInfoSection.js.map +1 -0
- package/src/main/components/modules/listing/components/CardDescriptionContent.js +34 -0
- package/src/main/components/modules/listing/components/CardDescriptionContent.js.map +1 -0
- package/src/main/components/modules/listing/components/styles/index.js +65 -0
- package/src/main/components/modules/listing/components/styles/index.js.map +1 -0
- package/src/main/components/modules/listing/hooks/useListing.js +71 -0
- package/src/main/components/modules/listing/hooks/useListing.js.map +1 -0
- package/src/main/components/modules/listing/index.js +39 -0
- package/src/main/components/modules/listing/index.js.map +1 -0
- package/src/main/components/modules/listing/styles.js +12 -0
- package/src/main/components/modules/listing/styles.js.map +1 -0
- package/src/main/components/modules/login/components/Email.js +37 -0
- package/src/main/components/modules/login/components/Email.js.map +1 -0
- package/src/main/components/modules/login/components/Otp.js +41 -0
- package/src/main/components/modules/login/components/Otp.js.map +1 -0
- package/src/main/components/modules/login/components/styles/index.js +24 -0
- package/src/main/components/modules/login/components/styles/index.js.map +1 -0
- package/src/main/components/modules/login/hooks/useLoginFlow.js +60 -0
- package/src/main/components/modules/login/hooks/useLoginFlow.js.map +1 -0
- package/src/main/components/modules/login/index.js +54 -0
- package/src/main/components/modules/login/index.js.map +1 -0
- package/src/main/components/modules/login/styles/index.js +34 -0
- package/src/main/components/modules/login/styles/index.js.map +1 -0
- package/src/main/components/modules/modal/StallionModal.js +73 -0
- package/src/main/components/modules/modal/StallionModal.js.map +1 -0
- package/src/main/components/modules/modal/hooks/useStallionModal.js +92 -0
- package/src/main/components/modules/modal/hooks/useStallionModal.js.map +1 -0
- package/src/main/constants/apiConstants.js +10 -0
- package/src/main/constants/apiConstants.js.map +1 -0
- package/src/main/constants/appConstants.js +71 -0
- package/src/main/constants/appConstants.js.map +1 -0
- package/src/main/constants/colors.js +14 -0
- package/src/main/constants/colors.js.map +1 -0
- package/src/main/index.js +7 -0
- package/src/main/index.js.map +1 -0
- package/src/main/state/actionCreators/useBucketActions.js +37 -0
- package/src/main/state/actionCreators/useBucketActions.js.map +1 -0
- package/src/main/state/actionCreators/useBundleActions.js +45 -0
- package/src/main/state/actionCreators/useBundleActions.js.map +1 -0
- package/src/main/state/actionCreators/useDownloadActions.js +47 -0
- package/src/main/state/actionCreators/useDownloadActions.js.map +1 -0
- package/src/main/state/actionCreators/useMetaActions.js +19 -0
- package/src/main/state/actionCreators/useMetaActions.js.map +1 -0
- package/src/main/state/actionCreators/useUserActions.js +97 -0
- package/src/main/state/actionCreators/useUserActions.js.map +1 -0
- package/src/main/state/actions/bucketActions.js +19 -0
- package/src/main/state/actions/bucketActions.js.map +1 -0
- package/src/main/state/actions/bundleActions.js +25 -0
- package/src/main/state/actions/bundleActions.js.map +1 -0
- package/src/main/state/actions/downloadActions.js +19 -0
- package/src/main/state/actions/downloadActions.js.map +1 -0
- package/src/main/state/actions/metaActions.js +8 -0
- package/src/main/state/actions/metaActions.js.map +1 -0
- package/src/main/state/actions/userActions.js +31 -0
- package/src/main/state/actions/userActions.js.map +1 -0
- package/src/main/state/index.js +70 -0
- package/src/main/state/index.js.map +1 -0
- package/src/main/state/reducers/bucketReducer.js +36 -0
- package/src/main/state/reducers/bucketReducer.js.map +1 -0
- package/src/main/state/reducers/bundleReducer.js +47 -0
- package/src/main/state/reducers/bundleReducer.js.map +1 -0
- package/src/main/state/reducers/downloadReducer.js +39 -0
- package/src/main/state/reducers/downloadReducer.js.map +1 -0
- package/src/main/state/reducers/metaReducer.js +17 -0
- package/src/main/state/reducers/metaReducer.js.map +1 -0
- package/src/main/state/reducers/userReducer.js +70 -0
- package/src/main/state/reducers/userReducer.js.map +1 -0
- package/src/main/utils/ErrorBoundary.js +13 -0
- package/src/main/utils/ErrorBoundary.js.map +1 -0
- package/src/main/utils/SharedDataManager.js +25 -0
- package/src/main/utils/SharedDataManager.js.map +1 -0
- package/src/main/utils/StallionNaitveUtils.js +7 -0
- package/src/main/utils/StallionNaitveUtils.js.map +1 -0
- package/src/main/utils/apiUtils.js +16 -0
- package/src/main/utils/apiUtils.js.map +1 -0
- package/src/main/utils/dateUtil.js +39 -0
- package/src/main/utils/dateUtil.js.map +1 -0
- package/src/main/utils/errorUtil.js +10 -0
- package/src/main/utils/errorUtil.js.map +1 -0
- package/src/main/utils/useStallionModal.js +18 -0
- package/src/main/utils/useStallionModal.js.map +1 -0
- package/src/main/utils/withStallion.js +16 -0
- package/src/main/utils/withStallion.js.map +1 -0
- package/src/nativeScripts/getStallionEnabled.js +8 -0
- package/src/nativeScripts/getStallionEnabled.js.map +1 -0
- package/src/noop/useStallionModal.js +12 -0
- package/src/noop/useStallionModal.js.map +1 -0
- package/src/noop/withStallion.js +13 -0
- package/src/noop/withStallion.js.map +1 -0
- package/src/types/bucket.types.js +7 -0
- package/src/types/bucket.types.js.map +1 -0
- package/src/types/bundle.types.js +8 -0
- package/src/types/bundle.types.js.map +1 -0
- package/src/types/download.types.js +7 -0
- package/src/types/download.types.js.map +1 -0
- package/src/types/globalProvider.types.js +2 -0
- package/src/types/globalProvider.types.js.map +1 -0
- package/src/types/meta.types.js +6 -0
- package/src/types/meta.types.js.map +1 -0
- package/src/types/user.types.js +9 -0
- package/src/types/user.types.js.map +1 -0
- package/src/types/utils.types.js +2 -0
- package/src/types/utils.types.js.map +1 -0
- package/types/StallionNativeModule.d.ts +4 -0
- package/types/StallionNativeModule.d.ts.map +1 -0
- package/types/__tests__/index.test.d.ts +1 -0
- package/types/__tests__/index.test.d.ts.map +1 -0
- package/types/index.d.ts +4 -0
- package/types/index.d.ts.map +1 -0
- package/types/main/components/common/ButtonFullWidth/index.d.ts +10 -0
- package/types/main/components/common/ButtonFullWidth/index.d.ts.map +1 -0
- package/types/main/components/common/ButtonFullWidth/styles.d.ts +39 -0
- package/types/main/components/common/ButtonFullWidth/styles.d.ts.map +1 -0
- package/types/main/components/common/ErrorView/index.d.ts +7 -0
- package/types/main/components/common/ErrorView/index.d.ts.map +1 -0
- package/types/main/components/common/ErrorView/styles.d.ts +17 -0
- package/types/main/components/common/ErrorView/styles.d.ts.map +1 -0
- package/types/main/components/common/Footer/index.d.ts +13 -0
- package/types/main/components/common/Footer/index.d.ts.map +1 -0
- package/types/main/components/common/Footer/styles.d.ts +73 -0
- package/types/main/components/common/Footer/styles.d.ts.map +1 -0
- package/types/main/components/common/Header/index.d.ts +11 -0
- package/types/main/components/common/Header/index.d.ts.map +1 -0
- package/types/main/components/common/Header/styles.d.ts +59 -0
- package/types/main/components/common/Header/styles.d.ts.map +1 -0
- package/types/main/components/common/OverlayLoader/index.d.ts +7 -0
- package/types/main/components/common/OverlayLoader/index.d.ts.map +1 -0
- package/types/main/components/common/OverlayLoader/styles.d.ts +30 -0
- package/types/main/components/common/OverlayLoader/styles.d.ts.map +1 -0
- package/types/main/components/common/ProfileOverlay/index.d.ts +10 -0
- package/types/main/components/common/ProfileOverlay/index.d.ts.map +1 -0
- package/types/main/components/common/ProfileOverlay/styles.d.ts +34 -0
- package/types/main/components/common/ProfileOverlay/styles.d.ts.map +1 -0
- package/types/main/components/common/Spinner/index.d.ts +4 -0
- package/types/main/components/common/Spinner/index.d.ts.map +1 -0
- package/types/main/components/modules/listing/components/BucketCard.d.ts +13 -0
- package/types/main/components/modules/listing/components/BucketCard.d.ts.map +1 -0
- package/types/main/components/modules/listing/components/BucketCardInfoSection.d.ts +11 -0
- package/types/main/components/modules/listing/components/BucketCardInfoSection.d.ts.map +1 -0
- package/types/main/components/modules/listing/components/BundleCard.d.ts +14 -0
- package/types/main/components/modules/listing/components/BundleCard.d.ts.map +1 -0
- package/types/main/components/modules/listing/components/BundleCardInfoSection.d.ts +12 -0
- package/types/main/components/modules/listing/components/BundleCardInfoSection.d.ts.map +1 -0
- package/types/main/components/modules/listing/components/CardDescriptionContent.d.ts +8 -0
- package/types/main/components/modules/listing/components/CardDescriptionContent.d.ts.map +1 -0
- package/types/main/components/modules/listing/components/styles/index.d.ts +62 -0
- package/types/main/components/modules/listing/components/styles/index.d.ts.map +1 -0
- package/types/main/components/modules/listing/hooks/useListing.d.ts +11 -0
- package/types/main/components/modules/listing/hooks/useListing.d.ts.map +1 -0
- package/types/main/components/modules/listing/index.d.ts +4 -0
- package/types/main/components/modules/listing/index.d.ts.map +1 -0
- package/types/main/components/modules/listing/styles.d.ts +10 -0
- package/types/main/components/modules/listing/styles.d.ts.map +1 -0
- package/types/main/components/modules/login/components/Email.d.ts +13 -0
- package/types/main/components/modules/login/components/Email.d.ts.map +1 -0
- package/types/main/components/modules/login/components/Otp.d.ts +12 -0
- package/types/main/components/modules/login/components/Otp.d.ts.map +1 -0
- package/types/main/components/modules/login/components/styles/index.d.ts +21 -0
- package/types/main/components/modules/login/components/styles/index.d.ts.map +1 -0
- package/types/main/components/modules/login/hooks/useLoginFlow.d.ts +18 -0
- package/types/main/components/modules/login/hooks/useLoginFlow.d.ts.map +1 -0
- package/types/main/components/modules/login/index.d.ts +4 -0
- package/types/main/components/modules/login/index.d.ts.map +1 -0
- package/types/main/components/modules/login/styles/index.d.ts +31 -0
- package/types/main/components/modules/login/styles/index.d.ts.map +1 -0
- package/types/main/components/modules/modal/StallionModal.d.ts +4 -0
- package/types/main/components/modules/modal/StallionModal.d.ts.map +1 -0
- package/types/main/components/modules/modal/hooks/useStallionModal.d.ts +23 -0
- package/types/main/components/modules/modal/hooks/useStallionModal.d.ts.map +1 -0
- package/types/main/constants/apiConstants.d.ts +9 -0
- package/types/main/constants/apiConstants.d.ts.map +1 -0
- package/types/main/constants/appConstants.d.ts +65 -0
- package/types/main/constants/appConstants.d.ts.map +1 -0
- package/types/main/constants/colors.d.ts +14 -0
- package/types/main/constants/colors.d.ts.map +1 -0
- package/types/main/index.d.ts +7 -0
- package/types/main/index.d.ts.map +1 -0
- package/types/main/state/actionCreators/useBucketActions.d.ts +7 -0
- package/types/main/state/actionCreators/useBucketActions.d.ts.map +1 -0
- package/types/main/state/actionCreators/useBundleActions.d.ts +8 -0
- package/types/main/state/actionCreators/useBundleActions.d.ts.map +1 -0
- package/types/main/state/actionCreators/useDownloadActions.d.ts +7 -0
- package/types/main/state/actionCreators/useDownloadActions.d.ts.map +1 -0
- package/types/main/state/actionCreators/useMetaActions.d.ts +7 -0
- package/types/main/state/actionCreators/useMetaActions.d.ts.map +1 -0
- package/types/main/state/actionCreators/useUserActions.d.ts +12 -0
- package/types/main/state/actionCreators/useUserActions.d.ts.map +1 -0
- package/types/main/state/actions/bucketActions.d.ts +5 -0
- package/types/main/state/actions/bucketActions.d.ts.map +1 -0
- package/types/main/state/actions/bundleActions.d.ts +6 -0
- package/types/main/state/actions/bundleActions.d.ts.map +1 -0
- package/types/main/state/actions/downloadActions.d.ts +5 -0
- package/types/main/state/actions/downloadActions.d.ts.map +1 -0
- package/types/main/state/actions/metaActions.d.ts +3 -0
- package/types/main/state/actions/metaActions.d.ts.map +1 -0
- package/types/main/state/actions/userActions.d.ts +7 -0
- package/types/main/state/actions/userActions.d.ts.map +1 -0
- package/types/main/state/index.d.ts +6 -0
- package/types/main/state/index.d.ts.map +1 -0
- package/types/main/state/reducers/bucketReducer.d.ts +4 -0
- package/types/main/state/reducers/bucketReducer.d.ts.map +1 -0
- package/types/main/state/reducers/bundleReducer.d.ts +4 -0
- package/types/main/state/reducers/bundleReducer.d.ts.map +1 -0
- package/types/main/state/reducers/downloadReducer.d.ts +4 -0
- package/types/main/state/reducers/downloadReducer.d.ts.map +1 -0
- package/types/main/state/reducers/metaReducer.d.ts +4 -0
- package/types/main/state/reducers/metaReducer.d.ts.map +1 -0
- package/types/main/state/reducers/userReducer.d.ts +4 -0
- package/types/main/state/reducers/userReducer.d.ts.map +1 -0
- package/types/main/utils/ErrorBoundary.d.ts +7 -0
- package/types/main/utils/ErrorBoundary.d.ts.map +1 -0
- package/types/main/utils/SharedDataManager.d.ts +14 -0
- package/types/main/utils/SharedDataManager.d.ts.map +1 -0
- package/types/main/utils/StallionNaitveUtils.d.ts +7 -0
- package/types/main/utils/StallionNaitveUtils.d.ts.map +1 -0
- package/types/main/utils/apiUtils.d.ts +7 -0
- package/types/main/utils/apiUtils.d.ts.map +1 -0
- package/types/main/utils/dateUtil.d.ts +3 -0
- package/types/main/utils/dateUtil.d.ts.map +1 -0
- package/types/main/utils/errorUtil.d.ts +10 -0
- package/types/main/utils/errorUtil.d.ts.map +1 -0
- package/types/main/utils/useStallionModal.d.ts +4 -0
- package/types/main/utils/useStallionModal.d.ts.map +1 -0
- package/types/main/utils/withStallion.d.ts +4 -0
- package/types/main/utils/withStallion.d.ts.map +1 -0
- package/types/noop/useStallionModal.d.ts +4 -0
- package/types/noop/useStallionModal.d.ts.map +1 -0
- package/types/noop/withStallion.d.ts +4 -0
- package/types/noop/withStallion.d.ts.map +1 -0
- package/types/types/bucket.types.d.ts +33 -0
- package/types/types/bucket.types.d.ts.map +1 -0
- package/types/types/bundle.types.d.ts +41 -0
- package/types/types/bundle.types.d.ts.map +1 -0
- package/types/types/download.types.d.ts +27 -0
- package/types/types/download.types.d.ts.map +1 -0
- package/types/types/globalProvider.types.d.ts +36 -0
- package/types/types/globalProvider.types.d.ts.map +1 -0
- package/types/types/meta.types.d.ts +15 -0
- package/types/types/meta.types.d.ts.map +1 -0
- package/types/types/user.types.d.ts +40 -0
- package/types/types/user.types.d.ts.map +1 -0
- package/types/types/utils.types.d.ts +26 -0
- package/types/types/utils.types.d.ts.map +1 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { StyleSheet, Text, View } from 'react-native';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { COLORS } from '../../../../constants/colors';
|
|
4
|
+
const CardDescriptionContent = _ref => {
|
|
5
|
+
let {
|
|
6
|
+
title,
|
|
7
|
+
subtitle
|
|
8
|
+
} = _ref;
|
|
9
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
10
|
+
style: styles.centerContainer
|
|
11
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
12
|
+
style: styles.title
|
|
13
|
+
}, title), /*#__PURE__*/React.createElement(Text, {
|
|
14
|
+
style: styles.subtitle
|
|
15
|
+
}, subtitle));
|
|
16
|
+
};
|
|
17
|
+
const styles = StyleSheet.create({
|
|
18
|
+
centerContainer: {
|
|
19
|
+
justifyContent: 'center',
|
|
20
|
+
alignItems: 'center'
|
|
21
|
+
},
|
|
22
|
+
title: {
|
|
23
|
+
fontSize: 12,
|
|
24
|
+
fontWeight: '500'
|
|
25
|
+
},
|
|
26
|
+
subtitle: {
|
|
27
|
+
fontSize: 14,
|
|
28
|
+
fontWeight: '600',
|
|
29
|
+
marginTop: 5,
|
|
30
|
+
color: COLORS.black
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
export default CardDescriptionContent;
|
|
34
|
+
//# sourceMappingURL=CardDescriptionContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["StyleSheet","Text","View","React","COLORS","CardDescriptionContent","_ref","title","subtitle","createElement","style","styles","centerContainer","create","justifyContent","alignItems","fontSize","fontWeight","marginTop","color","black"],"sourceRoot":"../../../../../../../src","sources":["main/components/modules/listing/components/CardDescriptionContent.tsx"],"mappings":"AAAA,SAASA,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACrD,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,MAAM,QAAQ,8BAA8B;AAMrD,MAAMC,sBAAyD,GAAGC,IAAA,IAG5D;EAAA,IAH6D;IACjEC,KAAK;IACLC;EACF,CAAC,GAAAF,IAAA;EACC,oBACEH,KAAA,CAAAM,aAAA,CAACP,IAAI;IAACQ,KAAK,EAAEC,MAAM,CAACC;EAAgB,gBAClCT,KAAA,CAAAM,aAAA,CAACR,IAAI;IAACS,KAAK,EAAEC,MAAM,CAACJ;EAAM,GAAEA,KAAY,CAAC,eACzCJ,KAAA,CAAAM,aAAA,CAACR,IAAI;IAACS,KAAK,EAAEC,MAAM,CAACH;EAAS,GAAEA,QAAe,CAC1C,CAAC;AAEX,CAAC;AAED,MAAMG,MAAM,GAAGX,UAAU,CAACa,MAAM,CAAC;EAC/BD,eAAe,EAAE;IAAEE,cAAc,EAAE,QAAQ;IAAEC,UAAU,EAAE;EAAS,CAAC;EACnER,KAAK,EAAE;IAAES,QAAQ,EAAE,EAAE;IAAEC,UAAU,EAAE;EAAM,CAAC;EAC1CT,QAAQ,EAAE;IACRQ,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBC,SAAS,EAAE,CAAC;IACZC,KAAK,EAAEf,MAAM,CAACgB;EAChB;AACF,CAAC,CAAC;AAEF,eAAef,sBAAsB"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { HEADER_SLAB_HEIGHT, STD_MARGIN } from '../../../../../constants/appConstants';
|
|
3
|
+
import { COLORS } from '../../../../../constants/colors';
|
|
4
|
+
const styles = StyleSheet.create({
|
|
5
|
+
cardContainer: {
|
|
6
|
+
margin: STD_MARGIN,
|
|
7
|
+
backgroundColor: COLORS.white,
|
|
8
|
+
borderRadius: 8,
|
|
9
|
+
shadowColor: COLORS.black,
|
|
10
|
+
shadowOffset: {
|
|
11
|
+
height: 4,
|
|
12
|
+
width: 4
|
|
13
|
+
},
|
|
14
|
+
shadowOpacity: 0.1,
|
|
15
|
+
elevation: 2,
|
|
16
|
+
shadowRadius: 8
|
|
17
|
+
},
|
|
18
|
+
infoSection: {
|
|
19
|
+
width: '100%'
|
|
20
|
+
},
|
|
21
|
+
actionSection: {
|
|
22
|
+
flex: 1,
|
|
23
|
+
alignItems: 'center'
|
|
24
|
+
},
|
|
25
|
+
rowContainer: {
|
|
26
|
+
flexDirection: 'row',
|
|
27
|
+
justifyContent: 'space-between',
|
|
28
|
+
alignItems: 'center'
|
|
29
|
+
},
|
|
30
|
+
appliedText: {
|
|
31
|
+
color: COLORS.green,
|
|
32
|
+
fontWeight: 'bold',
|
|
33
|
+
fontSize: 14
|
|
34
|
+
},
|
|
35
|
+
container: {
|
|
36
|
+
margin: 15
|
|
37
|
+
},
|
|
38
|
+
divider: {
|
|
39
|
+
borderBottomWidth: 0.5,
|
|
40
|
+
opacity: 0.2,
|
|
41
|
+
marginVertical: 10
|
|
42
|
+
},
|
|
43
|
+
subText: {
|
|
44
|
+
fontSize: HEADER_SLAB_HEIGHT / 3,
|
|
45
|
+
marginBottom: STD_MARGIN / 2
|
|
46
|
+
},
|
|
47
|
+
titleText: {
|
|
48
|
+
fontSize: 16
|
|
49
|
+
},
|
|
50
|
+
bold: {
|
|
51
|
+
fontWeight: 'bold'
|
|
52
|
+
},
|
|
53
|
+
releaseNoteText: {
|
|
54
|
+
fontSize: 12,
|
|
55
|
+
fontWeight: '500',
|
|
56
|
+
marginTop: 10
|
|
57
|
+
},
|
|
58
|
+
releaseNoteDescriptionText: {
|
|
59
|
+
fontSize: 14,
|
|
60
|
+
marginTop: 5,
|
|
61
|
+
color: COLORS.black
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
export default styles;
|
|
65
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["StyleSheet","HEADER_SLAB_HEIGHT","STD_MARGIN","COLORS","styles","create","cardContainer","margin","backgroundColor","white","borderRadius","shadowColor","black","shadowOffset","height","width","shadowOpacity","elevation","shadowRadius","infoSection","actionSection","flex","alignItems","rowContainer","flexDirection","justifyContent","appliedText","color","green","fontWeight","fontSize","container","divider","borderBottomWidth","opacity","marginVertical","subText","marginBottom","titleText","bold","releaseNoteText","marginTop","releaseNoteDescriptionText"],"sourceRoot":"../../../../../../../../src","sources":["main/components/modules/listing/components/styles/index.ts"],"mappings":"AAAA,SAASA,UAAU,QAAQ,cAAc;AAEzC,SACEC,kBAAkB,EAClBC,UAAU,QACL,uCAAuC;AAC9C,SAASC,MAAM,QAAQ,iCAAiC;AAExD,MAAMC,MAAM,GAAGJ,UAAU,CAACK,MAAM,CAAC;EAC/BC,aAAa,EAAE;IACbC,MAAM,EAAEL,UAAU;IAClBM,eAAe,EAAEL,MAAM,CAACM,KAAK;IAC7BC,YAAY,EAAE,CAAC;IACfC,WAAW,EAAER,MAAM,CAACS,KAAK;IACzBC,YAAY,EAAE;MAAEC,MAAM,EAAE,CAAC;MAAEC,KAAK,EAAE;IAAE,CAAC;IACrCC,aAAa,EAAE,GAAG;IAClBC,SAAS,EAAE,CAAC;IACZC,YAAY,EAAE;EAChB,CAAC;EACDC,WAAW,EAAE;IACXJ,KAAK,EAAE;EACT,CAAC;EACDK,aAAa,EAAE;IACbC,IAAI,EAAE,CAAC;IACPC,UAAU,EAAE;EACd,CAAC;EACDC,YAAY,EAAE;IACZC,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE,eAAe;IAC/BH,UAAU,EAAE;EACd,CAAC;EACDI,WAAW,EAAE;IAAEC,KAAK,EAAExB,MAAM,CAACyB,KAAK;IAAEC,UAAU,EAAE,MAAM;IAAEC,QAAQ,EAAE;EAAG,CAAC;EACtEC,SAAS,EAAE;IACTxB,MAAM,EAAE;EACV,CAAC;EACDyB,OAAO,EAAE;IACPC,iBAAiB,EAAE,GAAG;IACtBC,OAAO,EAAE,GAAG;IACZC,cAAc,EAAE;EAClB,CAAC;EACDC,OAAO,EAAE;IACPN,QAAQ,EAAE7B,kBAAkB,GAAG,CAAC;IAChCoC,YAAY,EAAEnC,UAAU,GAAG;EAC7B,CAAC;EACDoC,SAAS,EAAE;IACTR,QAAQ,EAAE;EACZ,CAAC;EACDS,IAAI,EAAE;IACJV,UAAU,EAAE;EACd,CAAC;EACDW,eAAe,EAAE;IAAEV,QAAQ,EAAE,EAAE;IAAED,UAAU,EAAE,KAAK;IAAEY,SAAS,EAAE;EAAG,CAAC;EACnEC,0BAA0B,EAAE;IAC1BZ,QAAQ,EAAE,EAAE;IACZW,SAAS,EAAE,CAAC;IACZd,KAAK,EAAExB,MAAM,CAACS;EAChB;AACF,CAAC,CAAC;AAEF,eAAeR,MAAM"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { useCallback, useContext, useEffect, useMemo } from 'react';
|
|
2
|
+
import { CARD_TYPES, IS_ANDROID, VERSION_PREFIX } from '../../../../constants/appConstants';
|
|
3
|
+
import { GlobalContext } from '../../../../state';
|
|
4
|
+
const useListing = () => {
|
|
5
|
+
const {
|
|
6
|
+
bucketState,
|
|
7
|
+
bundleState,
|
|
8
|
+
actions: {
|
|
9
|
+
fetchBuckets,
|
|
10
|
+
fetchBundles,
|
|
11
|
+
selectBucket,
|
|
12
|
+
getUserProfile
|
|
13
|
+
}
|
|
14
|
+
} = useContext(GlobalContext);
|
|
15
|
+
const bundlesListingEnabled = useMemo(() => bundleState.selectedBucketId ? true : false, [bundleState.selectedBucketId]);
|
|
16
|
+
const listingLoading = useMemo(() => {
|
|
17
|
+
if (bundlesListingEnabled) return bundleState.isLoading;
|
|
18
|
+
return bucketState.isLoading;
|
|
19
|
+
}, [bucketState.isLoading, bundleState.isLoading, bundlesListingEnabled]);
|
|
20
|
+
const listingData = useMemo(() => {
|
|
21
|
+
var _bucketState$data;
|
|
22
|
+
if (bundlesListingEnabled) {
|
|
23
|
+
var _bundleState$data;
|
|
24
|
+
return (bundleState === null || bundleState === void 0 ? void 0 : (_bundleState$data = bundleState.data) === null || _bundleState$data === void 0 ? void 0 : _bundleState$data.map(bundleData => ({
|
|
25
|
+
type: CARD_TYPES.BUNDLE,
|
|
26
|
+
id: bundleData.id,
|
|
27
|
+
version: bundleData.version,
|
|
28
|
+
name: `${VERSION_PREFIX}${bundleData.version}`,
|
|
29
|
+
description: bundleData.releaseNote,
|
|
30
|
+
updatedAt: bundleData.updatedAt,
|
|
31
|
+
author: bundleData.author.fullName
|
|
32
|
+
}))) || [];
|
|
33
|
+
}
|
|
34
|
+
return ((_bucketState$data = bucketState.data) === null || _bucketState$data === void 0 ? void 0 : _bucketState$data.map(bucketItem => ({
|
|
35
|
+
type: CARD_TYPES.BUCKET,
|
|
36
|
+
id: bucketItem.id,
|
|
37
|
+
name: bucketItem.name,
|
|
38
|
+
updatedAt: bucketItem.updatedAt,
|
|
39
|
+
bundleCount: (IS_ANDROID ? bucketItem === null || bucketItem === void 0 ? void 0 : bucketItem.latestAndroidBundleVersion : bucketItem === null || bucketItem === void 0 ? void 0 : bucketItem.latestIosBundleVersion) || 0
|
|
40
|
+
}))) || [];
|
|
41
|
+
}, [bucketState.data, bundleState.data, bundlesListingEnabled]);
|
|
42
|
+
const listingError = useMemo(() => {
|
|
43
|
+
if (bundlesListingEnabled) return bundleState.error;
|
|
44
|
+
return bucketState.error;
|
|
45
|
+
}, [bucketState.error, bundleState.error, bundlesListingEnabled]);
|
|
46
|
+
const fetchListing = useCallback(() => {
|
|
47
|
+
if (bundlesListingEnabled) {
|
|
48
|
+
fetchBundles();
|
|
49
|
+
} else {
|
|
50
|
+
fetchBuckets();
|
|
51
|
+
}
|
|
52
|
+
}, [fetchBuckets, fetchBundles, bundlesListingEnabled]);
|
|
53
|
+
const setBucketSelection = useCallback(bucketId => {
|
|
54
|
+
selectBucket(bucketId);
|
|
55
|
+
fetchBundles(bucketId);
|
|
56
|
+
}, [selectBucket, fetchBundles]);
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
fetchListing();
|
|
59
|
+
getUserProfile();
|
|
60
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
61
|
+
}, []);
|
|
62
|
+
return {
|
|
63
|
+
listingData,
|
|
64
|
+
listingError,
|
|
65
|
+
listingLoading,
|
|
66
|
+
fetchListing,
|
|
67
|
+
setBucketSelection
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
export default useListing;
|
|
71
|
+
//# sourceMappingURL=useListing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useCallback","useContext","useEffect","useMemo","CARD_TYPES","IS_ANDROID","VERSION_PREFIX","GlobalContext","useListing","bucketState","bundleState","actions","fetchBuckets","fetchBundles","selectBucket","getUserProfile","bundlesListingEnabled","selectedBucketId","listingLoading","isLoading","listingData","_bucketState$data","_bundleState$data","data","map","bundleData","type","BUNDLE","id","version","name","description","releaseNote","updatedAt","author","fullName","bucketItem","BUCKET","bundleCount","latestAndroidBundleVersion","latestIosBundleVersion","listingError","error","fetchListing","setBucketSelection","bucketId"],"sourceRoot":"../../../../../../../src","sources":["main/components/modules/listing/hooks/useListing.ts"],"mappings":"AAAA,SAASA,WAAW,EAAEC,UAAU,EAAEC,S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,YAAY,EAAED,YAAY,CAC7B,CAAC;EAEDX,SAAS,CAAC,MAAM;IACdyC,YAAY,CAAC,CAAC;IACd5B,cAAc,CAAC,CAAC;IAChB;EACF,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IACLK,WAAW;IACXqB,YAAY;IACZvB,cAAc;IACdyB,YAAY;IACZC;EACF,CAAC;AACH,CAAC;AAED,eAAepC,UAAU"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ScrollView, RefreshControl } from 'react-native';
|
|
4
|
+
import useListing from './hooks/useListing';
|
|
5
|
+
import ErrorView from '../../../components/common/ErrorView';
|
|
6
|
+
import styles from './styles';
|
|
7
|
+
import BucketCard from './components/BucketCard';
|
|
8
|
+
import { CARD_TYPES } from '../../../constants/appConstants';
|
|
9
|
+
import BundleCard from './components/BundleCard';
|
|
10
|
+
const Listing = () => {
|
|
11
|
+
const {
|
|
12
|
+
listingData,
|
|
13
|
+
listingLoading,
|
|
14
|
+
listingError,
|
|
15
|
+
fetchListing,
|
|
16
|
+
setBucketSelection
|
|
17
|
+
} = useListing();
|
|
18
|
+
if (listingError) {
|
|
19
|
+
return /*#__PURE__*/React.createElement(ErrorView, {
|
|
20
|
+
error: listingError
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return /*#__PURE__*/React.createElement(ScrollView, {
|
|
24
|
+
style: styles.mainContainer,
|
|
25
|
+
contentContainerStyle: styles.mainListContainer,
|
|
26
|
+
refreshControl: /*#__PURE__*/React.createElement(RefreshControl, {
|
|
27
|
+
refreshing: listingLoading,
|
|
28
|
+
onRefresh: fetchListing
|
|
29
|
+
})
|
|
30
|
+
}, listingData === null || listingData === void 0 ? void 0 : listingData.map(listItem => (listItem === null || listItem === void 0 ? void 0 : listItem.type) === CARD_TYPES.BUCKET ? /*#__PURE__*/React.createElement(BucketCard, _extends({
|
|
31
|
+
key: listItem.id
|
|
32
|
+
}, listItem, {
|
|
33
|
+
handlePress: () => setBucketSelection(listItem.id)
|
|
34
|
+
})) : (listItem === null || listItem === void 0 ? void 0 : listItem.type) === CARD_TYPES.BUNDLE && /*#__PURE__*/React.createElement(BundleCard, _extends({
|
|
35
|
+
key: listItem.id
|
|
36
|
+
}, listItem)) || null));
|
|
37
|
+
};
|
|
38
|
+
export default Listing;
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","ScrollView","RefreshControl","useListing","ErrorView","styles","BucketCard","CARD_TYPES","BundleCard","Listing","listingData","listingLoading","listingError","fetchListing","setBucketSelection","createElement","error","style","mainContainer","contentContainerStyle","mainListContainer","refreshControl","refreshing","onRefresh","map","listItem","type","BUCKET","_extends","key","id","handlePress","BUNDLE"],"sourceRoot":"../../../../../../src","sources":["main/components/modules/listing/index.tsx"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,EAAEC,cAAc,QAAQ,cAAc;AAEzD,OAAOC,UAAU,MAAM,oBAAoB;AAC3C,OAAOC,SAAS,MAAM,sCAAsC;AAE5D,OAAOC,MAAM,MAAM,UAAU;AAC7B,OAAOC,UAAU,MAAM,yBAAyB;AAChD,SAASC,UAAU,QAAQ,iCAAiC;AAC5D,OAAOC,UAAU,MAAM,yBAAyB;AAEhD,MAAMC,OAAiB,GAAGA,CAAA,KAAM;EAC9B,MAAM;IACJC,WAAW;IACXC,cAAc;IACdC,YAAY;IACZC,YAAY;IACZC;EACF,CAAC,GAAGX,UAAU,CAAC,CAAC;EAChB,IAAIS,YAAY,EAAE;IAChB,oBAAOZ,KAAA,CAAAe,aAAA,CAACX,SAAS;MAACY,KAAK,EAAEJ;IAAa,CAAE,CAAC;EAC3C;EACA,oBACEZ,KAAA,CAAAe,aAAA,CAACd,UAAU;IACTgB,KAAK,EAAEZ,MAAM,CAACa,aAAc;IAC5BC,qBAAqB,EAAEd,MAAM,CAACe,iBAAkB;IAChDC,cAAc,eACZrB,KAAA,CAAAe,aAAA,CAACb,cAAc;MAACoB,UAAU,EAAEX,cAAe;MAACY,SAAS,EAAEV;IAAa,CAAE;EACvE,GAEAH,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAEc,GAAG,CAAEC,QAAQ,IACzB,CAAAA,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAEC,IAAI,MAAKnB,UAAU,CAACoB,MAAM,gBAClC3B,KAAA,CAAAe,aAAA,CAACT,UAAU,EAAAsB,QAAA;IACTC,GAAG,EAAEJ,QAAQ,CAACK;EAAG,GACbL,QAAQ;IACZM,WAAW,EAAEA,CAAA,KAAMjB,kBAAkB,CAACW,QAAQ,CAACK,EAAE;EAAE,EACpD,CAAC,GAED,CAAAL,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAEC,IAAI,MAAKnB,UAAU,CAACyB,MAAM,iBACnChC,KAAA,CAAAe,aAAA,CAACP,UAAU,EAAAoB,QAAA;IAACC,GAAG,EAAEJ,QAAQ,CAACK;EAAG,GAAKL,QAAQ,CAAG,CAC9C,IACD,IAEJ,CACU,CAAC;AAEjB,CAAC;AAED,eAAehB,OAAO"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { COLORS } from '../../../constants/colors';
|
|
3
|
+
const styles = StyleSheet.create({
|
|
4
|
+
mainContainer: {
|
|
5
|
+
backgroundColor: COLORS.background_grey
|
|
6
|
+
},
|
|
7
|
+
mainListContainer: {
|
|
8
|
+
flexGrow: 1
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
export default styles;
|
|
12
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["StyleSheet","COLORS","styles","create","mainContainer","backgroundColor","background_grey","mainListContainer","flexGrow"],"sourceRoot":"../../../../../../src","sources":["main/components/modules/listing/styles.ts"],"mappings":"AAAA,SAASA,UAAU,QAAQ,cAAc;AAEzC,SAASC,MAAM,QAAQ,2BAA2B;AAElD,MAAMC,MAAM,GAAGF,UAAU,CAACG,MAAM,CAAC;EAC/BC,aAAa,EAAE;IACbC,eAAe,EAAEJ,MAAM,CAACK;EAC1B,CAAC;EACDC,iBAAiB,EAAE;IACjBC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;AAEF,eAAeN,MAAM"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React, { memo } from 'react';
|
|
2
|
+
import { TextInput, View } from 'react-native';
|
|
3
|
+
import ButtonFullWidth from '../../../../components/common/ButtonFullWidth';
|
|
4
|
+
import { LOGIN_PAGE_KEYS, SUBMIT_BUTTON_TEXT } from '../../../../constants/appConstants';
|
|
5
|
+
import styles from './styles';
|
|
6
|
+
const Email = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
email,
|
|
9
|
+
password,
|
|
10
|
+
isEditable,
|
|
11
|
+
handleEmailChange,
|
|
12
|
+
handlePasswordChange,
|
|
13
|
+
handleSubmitClick
|
|
14
|
+
} = _ref;
|
|
15
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TextInput, {
|
|
16
|
+
style: styles.textInp,
|
|
17
|
+
placeholder: LOGIN_PAGE_KEYS.email,
|
|
18
|
+
editable: isEditable,
|
|
19
|
+
value: email,
|
|
20
|
+
onChange: handleEmailChange
|
|
21
|
+
}), /*#__PURE__*/React.createElement(TextInput, {
|
|
22
|
+
secureTextEntry: true,
|
|
23
|
+
style: styles.textInp,
|
|
24
|
+
placeholder: LOGIN_PAGE_KEYS.password,
|
|
25
|
+
editable: isEditable,
|
|
26
|
+
value: password,
|
|
27
|
+
onChange: handlePasswordChange
|
|
28
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
29
|
+
style: styles.buttonContainer
|
|
30
|
+
}, /*#__PURE__*/React.createElement(ButtonFullWidth, {
|
|
31
|
+
onPress: handleSubmitClick,
|
|
32
|
+
buttonText: SUBMIT_BUTTON_TEXT,
|
|
33
|
+
enabled: isEditable && (email && password ? true : false)
|
|
34
|
+
})));
|
|
35
|
+
};
|
|
36
|
+
export default /*#__PURE__*/memo(Email);
|
|
37
|
+
//# sourceMappingURL=Email.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","memo","TextInput","View","ButtonFullWidth","LOGIN_PAGE_KEYS","SUBMIT_BUTTON_TEXT","styles","Email","_ref","email","password","isEditable","handleEmailChange","handlePasswordChange","handleSubmitClick","createElement","Fragment","style","textInp","placeholder","editable","value","onChange","secureTextEntry","buttonContainer","onPress","buttonText","enabled"],"sourceRoot":"../../../../../../../src","sources":["main/components/modules/login/components/Email.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,IAAI,QAAQ,OAAO;AACnC,SACEC,SAAS,EACTC,IAAI,QAGC,cAAc;AAErB,OAAOC,eAAe,MAAM,+CAA+C;AAC3E,SACEC,eAAe,EACfC,kBAAkB,QACb,oCAAoC;AAE3C,OAAOC,MAAM,MAAM,UAAU;AAe7B,MAAMC,KAAuB,GAAGC,IAAA,IAO1B;EAAA,IAP2B;IAC/BC,KAAK;IACLC,QAAQ;IACRC,UAAU;IACVC,iBAAiB;IACjBC,oBAAoB;IACpBC;EACF,CAAC,GAAAN,IAAA;EACC,oBACET,KAAA,CAAAgB,aAAA,CAAAhB,KAAA,CAAAiB,QAAA,qBACEjB,KAAA,CAAAgB,aAAA,CAACd,SAAS;IACRgB,KAAK,EAAEX,MAAM,CAACY,OAAQ;IACtBC,WAAW,EAAEf,eAAe,CAACK,KAAM;IACnCW,QAAQ,EAAET,UAAW;IACrBU,KAAK,EAAEZ,KAAM;IACba,QAAQ,EAAEV;EAAkB,CAC7B,CAAC,eACFb,KAAA,CAAAgB,aAAA,CAACd,SAAS;IACRsB,eAAe,EAAE,IAAK;IACtBN,KAAK,EAAEX,MAAM,CAACY,OAAQ;IACtBC,WAAW,EAAEf,eAAe,CAACM,QAAS;IACtCU,QAAQ,EAAET,UAAW;IACrBU,KAAK,EAAEX,QAAS;IAChBY,QAAQ,EAAET;EAAqB,CAChC,CAAC,eACFd,KAAA,CAAAgB,aAAA,CAACb,IAAI;IAACe,KAAK,EAAEX,MAAM,CAACkB;EAAgB,gBAClCzB,KAAA,CAAAgB,aAAA,CAACZ,eAAe;IACdsB,OAAO,EAAEX,iBAAkB;IAC3BY,UAAU,EAAErB,kBAAmB;IAC/BsB,OAAO,EAAEhB,UAAU,KAAKF,KAAK,IAAIC,QAAQ,GAAG,IAAI,GAAG,KAAK;EAAE,CAC3D,CACG,CACN,CAAC;AAEP,CAAC;AAED,4BAAeV,IAAI,CAACO,KAAK,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React, { memo, useCallback } from 'react';
|
|
2
|
+
import { TextInput, View, Text } from 'react-native';
|
|
3
|
+
import ButtonFullWidth from '../../../../components/common/ButtonFullWidth';
|
|
4
|
+
import { OTP_BACK_BUTTON_TEXT, OTP_INPUT_KEY, OTP_LENGTH, SUBMIT_BUTTON_TEXT } from '../../../../constants/appConstants';
|
|
5
|
+
import styles from './styles';
|
|
6
|
+
const Otp = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
email,
|
|
9
|
+
otp,
|
|
10
|
+
isEditable,
|
|
11
|
+
handleOtpChange,
|
|
12
|
+
handleSubmitClick,
|
|
13
|
+
handleBack
|
|
14
|
+
} = _ref;
|
|
15
|
+
const handleNumberFormating = useCallback(e => {
|
|
16
|
+
const text = e.nativeEvent.text;
|
|
17
|
+
handleOtpChange(text.replace(/[^0-9]/g, ''));
|
|
18
|
+
}, [handleOtpChange]);
|
|
19
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, null, "Otp is sent to ", email), /*#__PURE__*/React.createElement(TextInput, {
|
|
20
|
+
style: styles.textInp,
|
|
21
|
+
placeholder: OTP_INPUT_KEY,
|
|
22
|
+
value: otp,
|
|
23
|
+
onChange: handleNumberFormating,
|
|
24
|
+
maxLength: OTP_LENGTH,
|
|
25
|
+
keyboardType: 'numeric'
|
|
26
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
27
|
+
style: styles.buttonContainer
|
|
28
|
+
}, /*#__PURE__*/React.createElement(ButtonFullWidth, {
|
|
29
|
+
onPress: handleSubmitClick,
|
|
30
|
+
buttonText: SUBMIT_BUTTON_TEXT,
|
|
31
|
+
enabled: isEditable && (otp === null || otp === void 0 ? void 0 : otp.length) === OTP_LENGTH
|
|
32
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
33
|
+
style: styles.buttonContainer
|
|
34
|
+
}, /*#__PURE__*/React.createElement(ButtonFullWidth, {
|
|
35
|
+
primary: false,
|
|
36
|
+
onPress: handleBack,
|
|
37
|
+
buttonText: OTP_BACK_BUTTON_TEXT
|
|
38
|
+
})));
|
|
39
|
+
};
|
|
40
|
+
export default /*#__PURE__*/memo(Otp);
|
|
41
|
+
//# sourceMappingURL=Otp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","memo","useCallback","TextInput","View","Text","ButtonFullWidth","OTP_BACK_BUTTON_TEXT","OTP_INPUT_KEY","OTP_LENGTH","SUBMIT_BUTTON_TEXT","styles","Otp","_ref","email","otp","isEditable","handleOtpChange","handleSubmitClick","handleBack","handleNumberFormating","e","text","nativeEvent","replace","createElement","Fragment","style","textInp","placeholder","value","onChange","maxLength","keyboardType","buttonContainer","onPress","buttonText","enabled","length","primary"],"sourceRoot":"../../../../../../../src","sources":["main/components/modules/login/components/Otp.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,IAAI,EAAEC,WAAW,QAAQ,OAAO;AAChD,SACEC,SAAS,EACTC,IAAI,EACJC,IAAI,QAGC,cAAc;AAEr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IAAI;IAACuB,KAAK,EAAEhB,MAAM,CAACuB;EAAgB,gBAClClC,KAAA,CAAAyB,aAAA,CAACnB,eAAe;IACdiC,OAAO,EAAE,KAAM;IACfJ,OAAO,EAAEhB,UAAW;IACpBiB,UAAU,EAAE7B;EAAqB,CAClC,CACG,CACN,CAAC;AAEP,CAAC;AAED,4BAAeN,IAAI,CAACW,GAAG,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { HEADER_SLAB_HEIGHT, STD_MARGIN } from '../../../../../constants/appConstants';
|
|
3
|
+
import { COLORS } from '../../../../../constants/colors';
|
|
4
|
+
const styles = StyleSheet.create({
|
|
5
|
+
center: {
|
|
6
|
+
justifyContent: 'center',
|
|
7
|
+
alignItems: 'center'
|
|
8
|
+
},
|
|
9
|
+
textInp: {
|
|
10
|
+
width: '80%',
|
|
11
|
+
height: HEADER_SLAB_HEIGHT,
|
|
12
|
+
borderWidth: 1,
|
|
13
|
+
borderColor: COLORS.black2,
|
|
14
|
+
borderRadius: STD_MARGIN,
|
|
15
|
+
margin: STD_MARGIN,
|
|
16
|
+
paddingHorizontal: STD_MARGIN * 2
|
|
17
|
+
},
|
|
18
|
+
buttonContainer: {
|
|
19
|
+
width: '80%',
|
|
20
|
+
margin: STD_MARGIN
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
export default styles;
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["StyleSheet","HEADER_SLAB_HEIGHT","STD_MARGIN","COLORS","styles","create","center","justifyContent","alignItems","textInp","width","height","borderWidth","borderColor","black2","borderRadius","margin","paddingHorizontal","buttonContainer"],"sourceRoot":"../../../../../../../../src","sources":["main/components/modules/login/components/styles/index.ts"],"mappings":"AAAA,SAASA,UAAU,QAAQ,cAAc;AAEzC,SACEC,kBAAkB,EAClBC,UAAU,QACL,uCAAuC;AAC9C,SAASC,MAAM,QAAQ,iCAAiC;AAExD,MAAMC,MAAM,GAAGJ,UAAU,CAACK,MAAM,CAAC;EAC/BC,MAAM,EAAE;IACNC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd,CAAC;EACDC,OAAO,EAAE;IACPC,KAAK,EAAE,KAAK;IACZC,MAAM,EAAEV,kBAAkB;IAC1BW,WAAW,EAAE,CAAC;IACdC,WAAW,EAAEV,MAAM,CAACW,MAAM;IAC1BC,YAAY,EAAEb,UAAU;IACxBc,MAAM,EAAEd,UAAU;IAClBe,iBAAiB,EAAEf,UAAU,GAAG;EAClC,CAAC;EACDgB,eAAe,EAAE;IACfR,KAAK,EAAE,KAAK;IACZM,MAAM,EAAEd;EACV;AACF,CAAC,CAAC;AAEF,eAAeE,MAAM"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { useContext, useState, useCallback, useMemo } from 'react';
|
|
2
|
+
import { Keyboard } from 'react-native';
|
|
3
|
+
import { GlobalContext } from '../../../../state';
|
|
4
|
+
const useLoginFlow = () => {
|
|
5
|
+
const {
|
|
6
|
+
userState,
|
|
7
|
+
actions: {
|
|
8
|
+
loginUser,
|
|
9
|
+
verifyOtp,
|
|
10
|
+
retryLogin
|
|
11
|
+
}
|
|
12
|
+
} = useContext(GlobalContext);
|
|
13
|
+
const [email, setEmail] = useState();
|
|
14
|
+
const [password, setPassword] = useState();
|
|
15
|
+
const [otp, setOtp] = useState();
|
|
16
|
+
const handleEmailChange = useCallback(e => {
|
|
17
|
+
setEmail(e.nativeEvent.text);
|
|
18
|
+
}, [setEmail]);
|
|
19
|
+
const handlePasswordChange = useCallback(e => {
|
|
20
|
+
setPassword(e.nativeEvent.text);
|
|
21
|
+
}, [setPassword]);
|
|
22
|
+
const handleOtpChange = useCallback(newOtp => {
|
|
23
|
+
setOtp(newOtp);
|
|
24
|
+
}, [setOtp]);
|
|
25
|
+
const handleEmailSubmit = useCallback(() => {
|
|
26
|
+
Keyboard.dismiss();
|
|
27
|
+
email && password && loginUser({
|
|
28
|
+
email,
|
|
29
|
+
password
|
|
30
|
+
});
|
|
31
|
+
}, [loginUser, email, password]);
|
|
32
|
+
const handleOtpSubmit = useCallback(() => {
|
|
33
|
+
Keyboard.dismiss();
|
|
34
|
+
otp && verifyOtp({
|
|
35
|
+
otp
|
|
36
|
+
});
|
|
37
|
+
}, [verifyOtp, otp]);
|
|
38
|
+
const handleBack = useCallback(() => {
|
|
39
|
+
retryLogin();
|
|
40
|
+
}, [retryLogin]);
|
|
41
|
+
const isOtpRequested = useMemo(() => userState !== null && userState !== void 0 && userState.tempOtpToken ? true : false, [userState === null || userState === void 0 ? void 0 : userState.tempOtpToken]);
|
|
42
|
+
const userApiError = useMemo(() => userState === null || userState === void 0 ? void 0 : userState.error, [userState === null || userState === void 0 ? void 0 : userState.error]);
|
|
43
|
+
const userApiIsLoading = useMemo(() => userState === null || userState === void 0 ? void 0 : userState.isLoading, [userState === null || userState === void 0 ? void 0 : userState.isLoading]);
|
|
44
|
+
return {
|
|
45
|
+
email,
|
|
46
|
+
password,
|
|
47
|
+
otp,
|
|
48
|
+
handleEmailChange,
|
|
49
|
+
handlePasswordChange,
|
|
50
|
+
handleOtpChange,
|
|
51
|
+
isOtpRequested,
|
|
52
|
+
handleEmailSubmit,
|
|
53
|
+
userApiError,
|
|
54
|
+
userApiIsLoading,
|
|
55
|
+
handleOtpSubmit,
|
|
56
|
+
handleBack
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
export default useLoginFlow;
|
|
60
|
+
//# sourceMappingURL=useLoginFlow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useContext","useState","useCallback","useMemo","Keyboard","GlobalContext","useLoginFlow","userState","actions","loginUser","verifyOtp","retryLogin","email","setEmail","password","setPassword","otp","setOtp","handleEmailChange","e","nativeEvent","text","handlePasswordChange","handleOtpChange","newOtp","handleEmailSubmit","dismiss","handleOtpSubmit","handleBack","isOtpRequested","tempOtpToken","userApiError","error","userApiIsLoading","isLoading"],"sourceRoot":"../../../../../../../src","sources":["main/components/modules/login/hooks/useLoginFlow.ts"],"mappings":"AAAA,SAASA,UAAU,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAClE,SAGEC,QAAQ,QACH,cAAc;AAErB,SAASC,aAAa,QAAQ,mBAAmB;AAkBjD,MAAMC,YAAY,GAAGA,CAAA,KAAqB;EACxC,MAAM;IACJC,SAAS;IACTC,OAAO,EAAE;MAAEC,SAAS;MAAEC,SAAS;MAAEC;IAAW;EAC9C,CAAC,GAAGX,UAAU,CAACK,aAAa,CAAC;EAC7B,MAAM,CAACO,KAAK,EAAEC,QAAQ,CAAC,GAAGZ,QAAQ,CAAS,CAAC;EAC5C,MAAM,CAACa,QAAQ,EAAEC,WAAW,CAAC,GAAGd,QAAQ,CAAS,CAAC;EAClD,MAAM,CAACe,GAAG,EAAEC,MAAM,CAAC,GAAGhB,QAAQ,CAAS,CAAC;EAExC,MAAMiB,iBAAiB,GAAGhB,WAAW,CAClCiB,CAAiD,IAAK;IACrDN,QAAQ,CAACM,CAAC,CAACC,WAAW,CAACC,IAAI,CAAC;EAC9B,CAAC,EACD,CAACR,QAAQ,CACX,CAAC;EACD,MAAMS,oBAAoB,GAAGpB,WAAW,CACrCiB,CAAiD,IAAK;IACrDJ,WAAW,CAACI,CAAC,CAACC,WAAW,CAACC,IAAI,CAAC;EACjC,CAAC,EACD,CAACN,WAAW,CACd,CAAC;EACD,MAAMQ,eAAe,GAAGrB,WAAW,CAChCsB,MAAc,IAAK;IAClBP,MAAM,CAACO,MAAM,CAAC;EAChB,CAAC,EACD,CAACP,MAAM,CACT,CAAC;EACD,MAAMQ,iBAAiB,GAAGvB,WAAW,CAAC,MAAM;IAC1CE,QAAQ,CAACsB,OAAO,CAAC,CAAC;IAClBd,KAAK,IACHE,QAAQ,IACRL,SAAS,CAAC;MACRG,KAAK;MACLE;IACF,CAAC,CAAC;EACN,CAAC,EAAE,CAACL,SAAS,EAAEG,KAAK,EAAEE,QAAQ,CAAC,CAAC;EAChC,MAAMa,eAAe,GAAGzB,WAAW,CAAC,MAAM;IACxCE,QAAQ,CAACsB,OAAO,CAAC,CAAC;IAClBV,GAAG,IACDN,SAAS,CAAC;MACRM;IACF,CAAC,CAAC;EACN,CAAC,EAAE,CAACN,SAAS,EAAEM,GAAG,CAAC,CAAC;EACpB,MAAMY,UAAU,GAAG1B,WAAW,CAAC,MAAM;IACnCS,UAAU,CAAC,CAAC;EACd,CAAC,EAAE,CAACA,UAAU,CAAC,CAAC;EAChB,MAAMkB,cAAc,GAAG1B,OAAO,CAC5B,MAAOI,SAAS,aAATA,SAAS,eAATA,SAAS,CAAEuB,YAAY,GAAG,IAAI,GAAG,KAAM,EAC9C,CAACvB,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAEuB,YAAY,CAC1B,CAAC;EACD,MAAMC,YAAY,GAAG5B,OAAO,CAC1B,MAAMI,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAEyB,KAAK,EACtB,CAACzB,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAEyB,KAAK,CACnB,CAAC;EACD,MAAMC,gBAAgB,GAAG9B,OAAO,CAC9B,MAAMI,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAE2B,SAAS,EAC1B,CAAC3B,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAE2B,SAAS,CACvB,CAAC;EACD,OAAO;IACLtB,KAAK;IACLE,QAAQ;IACRE,GAAG;IACHE,iBAAiB;IACjBI,oBAAoB;IACpBC,eAAe;IACfM,cAAc;IACdJ,iBAAiB;IACjBM,YAAY;IACZE,gBAAgB;IAChBN,eAAe;IACfC;EACF,CAAC;AACH,CAAC;AAED,eAAetB,YAAY"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, Text, KeyboardAvoidingView } from 'react-native';
|
|
3
|
+
import Otp from './components/Otp';
|
|
4
|
+
import Email from './components/Email';
|
|
5
|
+
import { DEFAULT_ERROR_PREFIX, KEYBOARD_AVOIDING_BEHAVIOUR, Login_TITLE } from '../../../constants/appConstants';
|
|
6
|
+
import useLoginFlow from './hooks/useLoginFlow';
|
|
7
|
+
import styles from './styles';
|
|
8
|
+
import Spinner from '../../common/Spinner';
|
|
9
|
+
const Login = () => {
|
|
10
|
+
const {
|
|
11
|
+
email,
|
|
12
|
+
password,
|
|
13
|
+
otp,
|
|
14
|
+
handleEmailChange,
|
|
15
|
+
handlePasswordChange,
|
|
16
|
+
handleOtpChange,
|
|
17
|
+
handleEmailSubmit,
|
|
18
|
+
handleOtpSubmit,
|
|
19
|
+
isOtpRequested,
|
|
20
|
+
userApiError,
|
|
21
|
+
userApiIsLoading,
|
|
22
|
+
handleBack
|
|
23
|
+
} = useLoginFlow();
|
|
24
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
25
|
+
style: styles.pageContainer
|
|
26
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
27
|
+
style: [styles.logoContainer, styles.center]
|
|
28
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
29
|
+
style: styles.logoText
|
|
30
|
+
}, Login_TITLE)), /*#__PURE__*/React.createElement(KeyboardAvoidingView, {
|
|
31
|
+
behavior: KEYBOARD_AVOIDING_BEHAVIOUR,
|
|
32
|
+
style: [styles.center, styles.inputSection]
|
|
33
|
+
}, isOtpRequested ? /*#__PURE__*/React.createElement(Otp, {
|
|
34
|
+
otp: otp,
|
|
35
|
+
email: email,
|
|
36
|
+
handleOtpChange: handleOtpChange,
|
|
37
|
+
handleSubmitClick: handleOtpSubmit,
|
|
38
|
+
handleBack: handleBack,
|
|
39
|
+
isEditable: !userApiIsLoading
|
|
40
|
+
}) : /*#__PURE__*/React.createElement(Email, {
|
|
41
|
+
email: email,
|
|
42
|
+
password: password,
|
|
43
|
+
isEditable: !userApiIsLoading,
|
|
44
|
+
handleEmailChange: handleEmailChange,
|
|
45
|
+
handlePasswordChange: handlePasswordChange,
|
|
46
|
+
handleSubmitClick: handleEmailSubmit
|
|
47
|
+
}), userApiIsLoading ? /*#__PURE__*/React.createElement(View, {
|
|
48
|
+
style: styles.spinnerContainer
|
|
49
|
+
}, /*#__PURE__*/React.createElement(Spinner, null)) : null, userApiError ? /*#__PURE__*/React.createElement(Text, {
|
|
50
|
+
style: styles.errorText
|
|
51
|
+
}, DEFAULT_ERROR_PREFIX, userApiError) : null));
|
|
52
|
+
};
|
|
53
|
+
export default Login;
|
|
54
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","Text","KeyboardAvoidingView","Otp","Email","DEFAULT_ERROR_PREFIX","KEYBOARD_AVOIDING_BEHAVIOUR","Login_TITLE","useLoginFlow","styles","Spinner","Login","email","password","otp","handleEmailChange","handlePasswordChange","handleOtpChange","handleEmailSubmit","handleOtpSubmit","isOtpRequested","userApiError","userApiIsLoading","handleBack","createElement","style","pageContainer","logoContainer","center","logoText","behavior","inputSection","handleSubmitClick","isEditable","spinnerContainer","errorText"],"sourceRoot":"../../../../../../src","sources":["main/components/modules/login/index.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAEC,oBAAoB,QAAQ,cAAc;AAE/D,OAAOC,GAAG,MAAM,kBAAkB;AAClC,OAAOC,KAAK,MAAM,oBAAoB;AAEtC,SACEC,oBAAoB,EACpBC,2BAA2B,EAC3BC,WAAW,QACN,iCAAiC;AACxC,OAAOC,YAAY,MAAM,sBAAsB;AAC/C,OAAOC,MAAM,MAAM,UAAU;AAC7B,OAAOC,OAAO,MAAM,sBAAsB;AAE1C,MAAMC,KAAe,GAAGA,CAAA,KAAM;EAC5B,MAAM;IACJC,KAAK;IACLC,QAAQ;IACRC,GAAG;IACHC,iBAAiB;IACjBC,oBAAoB;IACpBC,eAAe;IACfC,iBAAiB;IACjBC,eAAe;IACfC,cAAc;IACdC,YAAY;IACZC,gBA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,EAAEhB,MAAM,CAAC0B;EAAU,GAC3B9B,oBAAoB,EACpBgB,YACG,CAAC,GACL,IACgB,CAClB,CAAC;AAEX,CAAC;AAED,eAAeV,KAAK"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { HEADER_SLAB_HEIGHT } from '../../../../constants/appConstants';
|
|
3
|
+
import { COLORS } from '../../../../constants/colors';
|
|
4
|
+
const styles = StyleSheet.create({
|
|
5
|
+
pageContainer: {
|
|
6
|
+
flex: 1,
|
|
7
|
+
backgroundColor: COLORS.white
|
|
8
|
+
},
|
|
9
|
+
center: {
|
|
10
|
+
justifyContent: 'center',
|
|
11
|
+
alignItems: 'center'
|
|
12
|
+
},
|
|
13
|
+
logoContainer: {
|
|
14
|
+
flex: 1
|
|
15
|
+
},
|
|
16
|
+
logoText: {
|
|
17
|
+
fontSize: HEADER_SLAB_HEIGHT
|
|
18
|
+
},
|
|
19
|
+
inputSection: {
|
|
20
|
+
flex: 2,
|
|
21
|
+
justifyContent: 'flex-start',
|
|
22
|
+
paddingTop: HEADER_SLAB_HEIGHT
|
|
23
|
+
},
|
|
24
|
+
errorText: {
|
|
25
|
+
fontSize: HEADER_SLAB_HEIGHT / 4,
|
|
26
|
+
color: COLORS.red,
|
|
27
|
+
padding: HEADER_SLAB_HEIGHT / 2
|
|
28
|
+
},
|
|
29
|
+
spinnerContainer: {
|
|
30
|
+
margin: HEADER_SLAB_HEIGHT / 2
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
export default styles;
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["StyleSheet","HEADER_SLAB_HEIGHT","COLORS","styles","create","pageContainer","flex","backgroundColor","white","center","justifyContent","alignItems","logoContainer","logoText","fontSize","inputSection","paddingTop","errorText","color","red","padding","spinnerContainer","margin"],"sourceRoot":"../../../../../../../src","sources":["main/components/modules/login/styles/index.ts"],"mappings":"AAAA,SAASA,UAAU,QAAQ,cAAc;AAEzC,SAASC,kBAAkB,QAAQ,oCAAoC;AACvE,SAASC,MAAM,QAAQ,8BAA8B;AAErD,MAAMC,MAAM,GAAGH,UAAU,CAACI,MAAM,CAAC;EAC/BC,aAAa,EAAE;IACbC,IAAI,EAAE,CAAC;IACPC,eAAe,EAAEL,MAAM,CAACM;EAC1B,CAAC;EACDC,MAAM,EAAE;IACNC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd,CAAC;EACDC,aAAa,EAAE;IACbN,IAAI,EAAE;EACR,CAAC;EACDO,QAAQ,EAAE;IACRC,QAAQ,EAAEb;EACZ,CAAC;EACDc,YAAY,EAAE;IACZT,IAAI,EAAE,CAAC;IACPI,cAAc,EAAE,YAAY;IAC5BM,UAAU,EAAEf;EACd,CAAC;EACDgB,SAAS,EAAE;IACTH,QAAQ,EAAEb,kBAAkB,GAAG,CAAC;IAChCiB,KAAK,EAAEhB,MAAM,CAACiB,GAAG;IACjBC,OAAO,EAAEnB,kBAAkB,GAAG;EAChC,CAAC;EACDoB,gBAAgB,EAAE;IAChBC,MAAM,EAAErB,kBAAkB,GAAG;EAC/B;AACF,CAAC,CAAC;AAEF,eAAeE,MAAM"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Modal, SafeAreaView, StyleSheet, View } from 'react-native';
|
|
3
|
+
import Login from '../login';
|
|
4
|
+
import Header from '../../../components/common/Header';
|
|
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 ProfileOverlay from '../../common/ProfileOverlay';
|
|
12
|
+
const StallionModal = () => {
|
|
13
|
+
var _userState$data, _userState$data2, _userState$data3;
|
|
14
|
+
const {
|
|
15
|
+
userState,
|
|
16
|
+
isModalVisible,
|
|
17
|
+
onBackPress,
|
|
18
|
+
onClosePress,
|
|
19
|
+
loginRequired,
|
|
20
|
+
metaState,
|
|
21
|
+
isBackEnabled,
|
|
22
|
+
activeBucketMeta,
|
|
23
|
+
toggleStallionSwitch,
|
|
24
|
+
isDownloading,
|
|
25
|
+
downloadProgress,
|
|
26
|
+
downloadError,
|
|
27
|
+
showProfileSection,
|
|
28
|
+
closeProfileSection,
|
|
29
|
+
presentProfileSection,
|
|
30
|
+
performLogout
|
|
31
|
+
} = useStallionModal();
|
|
32
|
+
return /*#__PURE__*/React.createElement(Modal, {
|
|
33
|
+
transparent: true,
|
|
34
|
+
animationType: "slide",
|
|
35
|
+
visible: isModalVisible,
|
|
36
|
+
onRequestClose: onClosePress
|
|
37
|
+
}, isModalVisible ? /*#__PURE__*/React.createElement(SafeAreaView, {
|
|
38
|
+
style: styles.container
|
|
39
|
+
}, /*#__PURE__*/React.createElement(Header, {
|
|
40
|
+
userName: showProfileSection ? null : (_userState$data = userState.data) === null || _userState$data === void 0 ? void 0 : _userState$data.fullName,
|
|
41
|
+
title: loginRequired ? null : HEADER_TITLE,
|
|
42
|
+
onClosePress: onClosePress,
|
|
43
|
+
onBackPress: isBackEnabled ? onBackPress : null,
|
|
44
|
+
onProfilePress: presentProfileSection
|
|
45
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
46
|
+
style: styles.listingSection
|
|
47
|
+
}, loginRequired ? /*#__PURE__*/React.createElement(Login, null) : /*#__PURE__*/React.createElement(Listing, null), isDownloading ? /*#__PURE__*/React.createElement(OverlayLoader, {
|
|
48
|
+
currentDownloadFraction: downloadProgress
|
|
49
|
+
}) : null, showProfileSection ? /*#__PURE__*/React.createElement(ProfileOverlay, {
|
|
50
|
+
fullName: (_userState$data2 = userState.data) === null || _userState$data2 === void 0 ? void 0 : _userState$data2.fullName,
|
|
51
|
+
email: (_userState$data3 = userState.data) === null || _userState$data3 === void 0 ? void 0 : _userState$data3.email,
|
|
52
|
+
onBackPress: closeProfileSection,
|
|
53
|
+
onLogoutPress: performLogout
|
|
54
|
+
}) : null), loginRequired ? null : /*#__PURE__*/React.createElement(Footer, {
|
|
55
|
+
switchIsOn: metaState.switchState,
|
|
56
|
+
activeBundle: activeBucketMeta,
|
|
57
|
+
onSwitchToggle: toggleStallionSwitch,
|
|
58
|
+
errorMessage: downloadError
|
|
59
|
+
})) : null);
|
|
60
|
+
};
|
|
61
|
+
const styles = StyleSheet.create({
|
|
62
|
+
container: {
|
|
63
|
+
flex: 1,
|
|
64
|
+
justifyContent: 'flex-start',
|
|
65
|
+
alignContent: 'center',
|
|
66
|
+
backgroundColor: COLORS.white
|
|
67
|
+
},
|
|
68
|
+
listingSection: {
|
|
69
|
+
flex: 1
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
export default StallionModal;
|
|
73
|
+
//# sourceMappingURL=StallionModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Modal","SafeAreaView","StyleSheet","View","Login","Header","Footer","HEADER_TITLE","COLORS","Listing","useStallionModal","OverlayLoader","ProfileOverlay","StallionModal","_userState$data","_userState$data2","_userState$data3","userState","isModalVisible","onBackPress","onClosePress","loginRequired","metaState","isBackEnabled","activeBucketMeta","toggleStallionSwitch","isDownloading","downloadProgress","downloadError","showProfileSection","closeProfileSection","presentProfileSection","performLogout","createElement","transparent","animationType","visible","onRequestClose","style","styles","container","userName","data","fullName","title","onProfilePress","listingSection","currentDownloadFraction","email","onLogoutPress","switchIsOn","switchState","activeBundle","onSwitchToggle","errorMessage","create","flex","justifyContent","alignContent","backgroundColor","white"],"sourceRoot":"../../../../../../src","sources":["main/components/modules/modal/StallionModal.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,KAAK,EAAEC,YAAY,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAEpE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