react-native-stallion 1.1.2 → 2.0.0-alpha.1
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/Stallion.java +94 -10
- package/android/src/main/java/com/stallion/StallionApiUtil.java +58 -0
- package/android/src/main/java/com/stallion/StallionCommonUtil.java +25 -0
- package/android/src/main/java/com/stallion/StallionConstants.java +51 -15
- package/android/src/main/java/com/stallion/StallionDownloadCallback.java +7 -0
- package/android/src/main/java/com/stallion/StallionDownloadManager.java +121 -0
- package/android/src/main/java/com/stallion/StallionErrorBoundary.java +28 -4
- package/android/src/main/java/com/stallion/StallionEventEmitter.java +144 -0
- package/android/src/main/java/com/stallion/StallionFileUtil.java +129 -0
- package/android/src/main/java/com/stallion/StallionModule.java +100 -154
- package/android/src/main/java/com/stallion/StallionRollbackManager.java +82 -0
- package/android/src/main/java/com/stallion/StallionStorage.java +16 -6
- package/android/src/main/java/com/stallion/StallionSynManager.java +142 -0
- package/ios/main/Stallion-Bridging-Header.h +4 -0
- package/ios/main/Stallion.m +7 -5
- package/ios/main/Stallion.swift +80 -39
- package/ios/main/StallionConstants.swift +52 -10
- package/ios/main/StallionDownloader.swift +39 -52
- package/ios/main/StallionErrorBoundary.h +1 -1
- package/ios/main/StallionErrorBoundary.m +45 -28
- package/ios/main/StallionEventEmitter.swift +20 -0
- package/ios/main/StallionEventManager.h +21 -0
- package/ios/main/StallionEventManager.m +57 -0
- package/ios/main/StallionModule.m +107 -23
- package/ios/main/StallionObjConstants.h +46 -0
- package/ios/main/StallionObjConstants.m +124 -0
- package/ios/main/StallionObjUtil.h +14 -0
- package/ios/main/StallionObjUtil.m +22 -0
- package/ios/main/StallionRollbackHandler.h +22 -0
- package/ios/main/StallionRollbackHandler.m +128 -0
- package/ios/main/StallionSyncManager.swift +149 -0
- package/ios/main/StallionUtil.swift +2 -12
- package/package.json +6 -2
- package/src/index.js +5 -15
- package/src/index.js.map +1 -1
- package/src/main/components/common/ButtonFullWidth/styles.js +2 -2
- package/src/main/components/common/ButtonFullWidth/styles.js.map +1 -1
- package/src/main/components/common/Footer/index.js +24 -31
- package/src/main/components/common/Footer/index.js.map +1 -1
- package/src/main/components/common/Footer/styles.js +34 -33
- package/src/main/components/common/Footer/styles.js.map +1 -1
- package/src/main/components/common/Header/index.js +12 -8
- package/src/main/components/common/Header/index.js.map +1 -1
- package/src/main/components/common/Header/styles.js +10 -5
- package/src/main/components/common/Header/styles.js.map +1 -1
- package/src/main/components/common/ProfileOverlay/index.js +18 -7
- package/src/main/components/common/ProfileOverlay/index.js.map +1 -1
- package/src/main/components/common/ProfileOverlay/styles.js +41 -8
- package/src/main/components/common/ProfileOverlay/styles.js.map +1 -1
- package/src/main/components/common/Spinner/index.js +3 -1
- package/src/main/components/common/Spinner/index.js.map +1 -1
- package/src/main/components/modules/listing/components/BucketCard.js +3 -3
- package/src/main/components/modules/listing/components/BucketCard.js.map +1 -1
- package/src/main/components/modules/listing/components/BundleCard.js +9 -5
- package/src/main/components/modules/listing/components/BundleCard.js.map +1 -1
- package/src/main/components/modules/listing/components/BundleCardInfoSection.js +20 -12
- package/src/main/components/modules/listing/components/BundleCardInfoSection.js.map +1 -1
- package/src/main/components/modules/listing/components/CardDescriptionContent.js +3 -2
- package/src/main/components/modules/listing/components/CardDescriptionContent.js.map +1 -1
- package/src/main/components/modules/listing/components/MetaCard.js +38 -0
- package/src/main/components/modules/listing/components/MetaCard.js.map +1 -0
- package/src/main/components/modules/listing/components/SlotView.js +82 -0
- package/src/main/components/modules/listing/components/SlotView.js.map +1 -0
- package/src/main/components/modules/listing/components/styles/index.js +28 -9
- package/src/main/components/modules/listing/components/styles/index.js.map +1 -1
- package/src/main/components/modules/listing/hooks/useListing.js +9 -2
- package/src/main/components/modules/listing/hooks/useListing.js.map +1 -1
- package/src/main/components/modules/listing/index.js +12 -4
- package/src/main/components/modules/listing/index.js.map +1 -1
- package/src/main/components/modules/login/components/styles/index.js +4 -4
- package/src/main/components/modules/login/components/styles/index.js.map +1 -1
- package/src/main/components/modules/login/index.js +1 -1
- package/src/main/components/modules/login/index.js.map +1 -1
- package/src/main/components/modules/login/styles/index.js +7 -6
- package/src/main/components/modules/login/styles/index.js.map +1 -1
- package/src/main/components/modules/modal/StallionModal.js +13 -11
- package/src/main/components/modules/modal/StallionModal.js.map +1 -1
- package/src/main/components/modules/modal/hooks/useStallionModal.js +87 -24
- package/src/main/components/modules/modal/hooks/useStallionModal.js.map +1 -1
- package/src/main/components/modules/prod/index.js +3 -0
- package/src/main/components/modules/prod/index.js.map +1 -0
- package/src/main/components/modules/prod/prod.js +35 -0
- package/src/main/components/modules/prod/prod.js.map +1 -0
- package/src/main/components/modules/prod/styles/index.js +20 -0
- package/src/main/components/modules/prod/styles/index.js.map +1 -0
- package/src/main/constants/apiConstants.js +3 -1
- package/src/main/constants/apiConstants.js.map +1 -1
- package/src/main/constants/appConstants.js +40 -4
- package/src/main/constants/appConstants.js.map +1 -1
- package/src/main/constants/colors.js +8 -6
- package/src/main/constants/colors.js.map +1 -1
- package/src/main/state/actionCreators/useDownloadActions.js +17 -37
- package/src/main/state/actionCreators/useDownloadActions.js.map +1 -1
- package/src/main/state/actionCreators/useMetaActions.js +4 -5
- package/src/main/state/actionCreators/useMetaActions.js.map +1 -1
- package/src/main/state/actionCreators/useUpdateMetaActions.js +100 -0
- package/src/main/state/actionCreators/useUpdateMetaActions.js.map +1 -0
- package/src/main/state/actionCreators/useUserActions.js +4 -4
- package/src/main/state/actionCreators/useUserActions.js.map +1 -1
- package/src/main/state/index.js +15 -2
- package/src/main/state/index.js.map +1 -1
- package/src/main/state/reducers/updateMetaReducer.js +36 -0
- package/src/main/state/reducers/updateMetaReducer.js.map +1 -0
- package/src/main/utils/ErrorBoundary.js +15 -14
- package/src/main/utils/ErrorBoundary.js.map +1 -1
- package/src/main/utils/EventUtil.js +28 -0
- package/src/main/utils/EventUtil.js.map +1 -0
- package/src/main/utils/SharedDataManager.js +15 -12
- package/src/main/utils/SharedDataManager.js.map +1 -1
- package/src/main/utils/StallionEventEmitter.js +20 -0
- package/src/main/utils/StallionEventEmitter.js.map +1 -0
- package/src/main/utils/StallionNativeUtils.js +60 -0
- package/src/main/utils/StallionNativeUtils.js.map +1 -0
- package/src/main/utils/apiUtils.js +8 -0
- package/src/main/utils/apiUtils.js.map +1 -1
- package/src/main/utils/useStallionModal.js +4 -3
- package/src/main/utils/useStallionModal.js.map +1 -1
- package/src/main/utils/useStallionUpdate.js +13 -0
- package/src/main/utils/useStallionUpdate.js.map +1 -0
- package/src/main/utils/withStallion.js +1 -4
- package/src/main/utils/withStallion.js.map +1 -1
- package/src/types/meta.types.js +13 -0
- package/src/types/meta.types.js.map +1 -1
- package/src/types/updateMeta.types.js +7 -0
- package/src/types/updateMeta.types.js.map +1 -0
- package/types/index.d.ts +3 -0
- package/types/index.d.ts.map +1 -1
- package/types/main/components/common/Footer/index.d.ts +1 -4
- package/types/main/components/common/Footer/index.d.ts.map +1 -1
- package/types/main/components/common/Footer/styles.d.ts +30 -29
- package/types/main/components/common/Footer/styles.d.ts.map +1 -1
- package/types/main/components/common/Header/index.d.ts.map +1 -1
- package/types/main/components/common/Header/styles.d.ts +6 -1
- package/types/main/components/common/Header/styles.d.ts.map +1 -1
- package/types/main/components/common/ProfileOverlay/index.d.ts.map +1 -1
- package/types/main/components/common/ProfileOverlay/styles.d.ts +38 -5
- package/types/main/components/common/ProfileOverlay/styles.d.ts.map +1 -1
- package/types/main/components/common/Spinner/index.d.ts.map +1 -1
- package/types/main/components/modules/listing/components/BucketCard.d.ts.map +1 -1
- package/types/main/components/modules/listing/components/BundleCard.d.ts.map +1 -1
- package/types/main/components/modules/listing/components/BundleCardInfoSection.d.ts +2 -0
- package/types/main/components/modules/listing/components/BundleCardInfoSection.d.ts.map +1 -1
- package/types/main/components/modules/listing/components/CardDescriptionContent.d.ts.map +1 -1
- package/types/main/components/modules/listing/components/MetaCard.d.ts +8 -0
- package/types/main/components/modules/listing/components/MetaCard.d.ts.map +1 -0
- package/types/main/components/modules/listing/components/SlotView.d.ts +5 -0
- package/types/main/components/modules/listing/components/SlotView.d.ts.map +1 -0
- package/types/main/components/modules/listing/components/styles/index.d.ts +24 -5
- package/types/main/components/modules/listing/components/styles/index.d.ts.map +1 -1
- package/types/main/components/modules/listing/hooks/useListing.d.ts +2 -0
- package/types/main/components/modules/listing/hooks/useListing.d.ts.map +1 -1
- package/types/main/components/modules/listing/index.d.ts.map +1 -1
- package/types/main/components/modules/login/components/styles/index.d.ts +1 -1
- package/types/main/components/modules/login/styles/index.d.ts +4 -3
- package/types/main/components/modules/login/styles/index.d.ts.map +1 -1
- package/types/main/components/modules/modal/StallionModal.d.ts.map +1 -1
- package/types/main/components/modules/modal/hooks/useStallionModal.d.ts +2 -5
- package/types/main/components/modules/modal/hooks/useStallionModal.d.ts.map +1 -1
- package/types/main/components/modules/prod/index.d.ts +3 -0
- package/types/main/components/modules/prod/index.d.ts.map +1 -0
- package/types/main/components/modules/prod/prod.d.ts +4 -0
- package/types/main/components/modules/prod/prod.d.ts.map +1 -0
- package/types/main/components/modules/prod/styles/index.d.ts +16 -0
- package/types/main/components/modules/prod/styles/index.d.ts.map +1 -0
- package/types/main/constants/apiConstants.d.ts +4 -2
- package/types/main/constants/apiConstants.d.ts.map +1 -1
- package/types/main/constants/appConstants.d.ts +37 -4
- package/types/main/constants/appConstants.d.ts.map +1 -1
- package/types/main/constants/colors.d.ts +2 -0
- package/types/main/constants/colors.d.ts.map +1 -1
- package/types/main/index.d.ts +1 -1
- package/types/main/state/actionCreators/useDownloadActions.d.ts +3 -1
- package/types/main/state/actionCreators/useDownloadActions.d.ts.map +1 -1
- package/types/main/state/actionCreators/useMetaActions.d.ts +1 -1
- package/types/main/state/actionCreators/useMetaActions.d.ts.map +1 -1
- package/types/main/state/actionCreators/useUpdateMetaActions.d.ts +7 -0
- package/types/main/state/actionCreators/useUpdateMetaActions.d.ts.map +1 -0
- package/types/main/state/index.d.ts.map +1 -1
- package/types/main/state/reducers/updateMetaReducer.d.ts +9 -0
- package/types/main/state/reducers/updateMetaReducer.d.ts.map +1 -0
- package/types/main/utils/ErrorBoundary.d.ts +1 -1
- package/types/main/utils/ErrorBoundary.d.ts.map +1 -1
- package/types/main/utils/EventUtil.d.ts +9 -0
- package/types/main/utils/EventUtil.d.ts.map +1 -0
- package/types/main/utils/SharedDataManager.d.ts +8 -6
- package/types/main/utils/SharedDataManager.d.ts.map +1 -1
- package/types/main/utils/StallionEventEmitter.d.ts +14 -0
- package/types/main/utils/StallionEventEmitter.d.ts.map +1 -0
- package/types/main/utils/StallionNativeUtils.d.ts +15 -0
- package/types/main/utils/StallionNativeUtils.d.ts.map +1 -0
- package/types/main/utils/apiUtils.d.ts +5 -0
- package/types/main/utils/apiUtils.d.ts.map +1 -1
- package/types/main/utils/useStallionUpdate.d.ts +3 -0
- package/types/main/utils/useStallionUpdate.d.ts.map +1 -0
- package/types/main/utils/withStallion.d.ts +1 -2
- package/types/main/utils/withStallion.d.ts.map +1 -1
- package/types/types/globalProvider.types.d.ts +5 -1
- package/types/types/globalProvider.types.d.ts.map +1 -1
- package/types/types/meta.types.d.ts +19 -3
- package/types/types/meta.types.d.ts.map +1 -1
- package/types/types/updateMeta.types.d.ts +35 -0
- package/types/types/updateMeta.types.d.ts.map +1 -0
- package/types/types/utils.types.d.ts +9 -7
- package/types/types/utils.types.d.ts.map +1 -1
- package/android/src/main/java/com/stallion/StallionZip.java +0 -127
- package/src/main/utils/StallionNaitveUtils.js +0 -7
- package/src/main/utils/StallionNaitveUtils.js.map +0 -1
- package/types/main/utils/StallionNaitveUtils.d.ts +0 -7
- package/types/main/utils/StallionNaitveUtils.d.ts.map +0 -1
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
//
|
|
2
|
+
// StallionSyncManager.swift
|
|
3
|
+
// Pods
|
|
4
|
+
//
|
|
5
|
+
// Created by Thor963 on 25/09/24.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
import Foundation
|
|
10
|
+
import UIKit
|
|
11
|
+
|
|
12
|
+
class StallionSyncManager: NSObject {
|
|
13
|
+
|
|
14
|
+
internal class func getAppVersion() -> String {
|
|
15
|
+
return Bundle.main.infoDictionary?[StallionConstants.APP_VERION_IDENTIFIER] as? String ?? ""
|
|
16
|
+
}
|
|
17
|
+
internal class func getProjectId() -> String {
|
|
18
|
+
return Bundle.main.infoDictionary?[StallionConstants.STALLION_PROJECT_ID_IDENTIFIER] as? String ?? ""
|
|
19
|
+
}
|
|
20
|
+
internal class func getAppToken() -> String {
|
|
21
|
+
return Bundle.main.infoDictionary?[StallionConstants.STALLION_APP_TOKEN_IDENTIFIER] as? String ?? ""
|
|
22
|
+
}
|
|
23
|
+
internal class func getSdkToken() -> String {
|
|
24
|
+
return StallionUtil.getLs(key: StallionConstants.STALLION_SDK_TOKEN_KEY)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
internal class func getUniqueId() -> String {
|
|
28
|
+
let cachedUid = StallionUtil.getLs(key: StallionConstants.UNIQUE_ID_IDENTIFIER)
|
|
29
|
+
if(!cachedUid.isEmpty) {
|
|
30
|
+
return cachedUid
|
|
31
|
+
} else {
|
|
32
|
+
var newUid = ""
|
|
33
|
+
if let deviceId = UIDevice.current.identifierForVendor?.uuidString {
|
|
34
|
+
newUid = deviceId
|
|
35
|
+
} else {
|
|
36
|
+
newUid = UUID().uuidString
|
|
37
|
+
}
|
|
38
|
+
StallionUtil.setLs(key: StallionConstants.UNIQUE_ID_IDENTIFIER, value: newUid)
|
|
39
|
+
return newUid
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
internal class func sync() -> Void {
|
|
44
|
+
let appVersion = getAppVersion()
|
|
45
|
+
let currentProdSlot = StallionUtil.getLs(key: StallionConstants.CURRENT_PROD_SLOT_KEY)
|
|
46
|
+
|
|
47
|
+
let appliedBundleHash = StallionUtil.getLs(key: "/" + StallionConstants.PROD_DIRECTORY + currentProdSlot)
|
|
48
|
+
|
|
49
|
+
let projectId = getProjectId()
|
|
50
|
+
let appToken = getAppToken()
|
|
51
|
+
let sdkToken = getSdkToken()
|
|
52
|
+
|
|
53
|
+
let params = [
|
|
54
|
+
"appVersion": appVersion,
|
|
55
|
+
"platform": StallionConstants.PlatformValue,
|
|
56
|
+
"projectId": projectId,
|
|
57
|
+
"appliedBundleHash": appliedBundleHash
|
|
58
|
+
] as Dictionary<String, String>
|
|
59
|
+
|
|
60
|
+
var request = URLRequest(url: URL(string: StallionConstants.STALLION_API_BASE + StallionConstants.STALLION_INFO_API_PATH)!);
|
|
61
|
+
request.httpMethod = "POST"
|
|
62
|
+
request.httpBody = try? JSONSerialization.data(withJSONObject: params, options: [])
|
|
63
|
+
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
|
|
64
|
+
request.addValue(appToken, forHTTPHeaderField: StallionConstants.STALLION_APP_TOKEN_KEY)
|
|
65
|
+
if(!sdkToken.isEmpty) {
|
|
66
|
+
request.addValue(sdkToken, forHTTPHeaderField: StallionConstants.STALLION_SDK_TOKEN_KEY)
|
|
67
|
+
}
|
|
68
|
+
request.addValue(getUniqueId(), forHTTPHeaderField: StallionConstants.STALLION_UID_KEY)
|
|
69
|
+
|
|
70
|
+
let session = URLSession.shared
|
|
71
|
+
let task = session.dataTask(with: request, completionHandler: { data, response, error -> Void in
|
|
72
|
+
do {
|
|
73
|
+
if let httpResponse = response as? HTTPURLResponse, let apiData = data {
|
|
74
|
+
if(httpResponse.statusCode == 200) {
|
|
75
|
+
let json = try JSONSerialization.jsonObject(with: apiData) as? Dictionary<String, AnyObject>
|
|
76
|
+
let successField = json?["success"] as? Bool
|
|
77
|
+
if(successField == true) {
|
|
78
|
+
let jsonData = json?["data"]
|
|
79
|
+
if(jsonData == nil) { return }
|
|
80
|
+
let newReleaseData = jsonData?["newBundleData"] as? Dictionary<String, Any>;
|
|
81
|
+
let appliedReleaseData = jsonData?["appliedBundleData"] as? Dictionary<String, Any>;
|
|
82
|
+
if(appliedReleaseData != nil) {
|
|
83
|
+
let isRolledBack = (appliedReleaseData?["isRolledBack"] as? Bool) ?? false
|
|
84
|
+
let targetAppVersion = (appliedReleaseData?["targetAppVersion"] as? String) ?? ""
|
|
85
|
+
if(isRolledBack && targetAppVersion == appVersion) {
|
|
86
|
+
StallionRollbackHandler.rollbackProd(false)
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if(newReleaseData != nil) {
|
|
90
|
+
let newReleaseUrl = (newReleaseData?["downloadUrl"] as? String) ?? ""
|
|
91
|
+
let newReleaseHash = (newReleaseData?["checksum"] as? String) ?? ""
|
|
92
|
+
let lastRolledBackHash = StallionUtil.getLs(key: StallionConstants.LAST_ROLLED_BACK_RELEASE_HASH_KEY)
|
|
93
|
+
if(newReleaseHash != lastRolledBackHash) {
|
|
94
|
+
StallionUtil.setLs(key: StallionConstants.NEW_RELEASE_HASH_ID, value: newReleaseHash)
|
|
95
|
+
StallionUtil.setLs(key: StallionConstants.NEW_RELEASE_URL_ID, value: newReleaseUrl)
|
|
96
|
+
checkAndDownload()
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
} catch {
|
|
103
|
+
StallionEventEmitter.sendEvent(eventType: StallionConstants.NativeEventTypesProd.SYNC_ERROR_PROD,
|
|
104
|
+
data: ["error": StallionConstants.DownloadPromiseResponses.SyncApiError]
|
|
105
|
+
)
|
|
106
|
+
}
|
|
107
|
+
})
|
|
108
|
+
task.resume()
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
internal class func checkAndDownload() -> Void {
|
|
112
|
+
let newReleaseHash = StallionUtil.getLs(key: StallionConstants.NEW_RELEASE_HASH_ID)
|
|
113
|
+
let newReleaseUrl = StallionUtil.getLs(key: StallionConstants.NEW_RELEASE_URL_ID)
|
|
114
|
+
guard let fromUrl = URL(string: newReleaseUrl + "?projectId=" + getProjectId()) else { return }
|
|
115
|
+
if(!newReleaseUrl.isEmpty && !newReleaseUrl.isEmpty) {
|
|
116
|
+
StallionUtil.setLs(key: StallionConstants.NEW_RELEASE_HASH_ID, value: "")
|
|
117
|
+
StallionUtil.setLs(key: StallionConstants.NEW_RELEASE_URL_ID, value: "")
|
|
118
|
+
let downloadEventPaylod = ["releaseHash": newReleaseHash]
|
|
119
|
+
StallionEventEmitter.sendEvent(eventType: StallionConstants.NativeEventTypesProd.DOWNLOAD_STARTED_PROD,
|
|
120
|
+
data: downloadEventPaylod
|
|
121
|
+
)
|
|
122
|
+
do {
|
|
123
|
+
try StallionDownloader().load(
|
|
124
|
+
url: fromUrl,
|
|
125
|
+
downloadPaths: [StallionConstants.PROD_DIRECTORY, StallionConstants.TEMP_FOLDER_SLOT],
|
|
126
|
+
onProgress: {progress in
|
|
127
|
+
StallionEventEmitter.sendEvent(
|
|
128
|
+
eventType: StallionConstants.NativeEventTypesProd.DOWNLOAD_PROGRESS_PROD,
|
|
129
|
+
data: ["releaseHash": newReleaseHash, "progress": progress]
|
|
130
|
+
)
|
|
131
|
+
},
|
|
132
|
+
resolve: {resOp in
|
|
133
|
+
StallionUtil.setLs(key: StallionConstants.CURRENT_PROD_SLOT_KEY, value: "/" + StallionConstants.TEMP_FOLDER_SLOT)
|
|
134
|
+
StallionUtil.setLs(key: "/" + StallionConstants.PROD_DIRECTORY + "/" + StallionConstants.TEMP_FOLDER_SLOT, value: newReleaseHash)
|
|
135
|
+
StallionEventEmitter.sendEvent(eventType: StallionConstants.NativeEventTypesProd.DOWNLOAD_COMPLETE_PROD, data: downloadEventPaylod
|
|
136
|
+
)
|
|
137
|
+
},
|
|
138
|
+
reject: {code, message, error in
|
|
139
|
+
StallionEventEmitter.sendEvent(eventType: StallionConstants.NativeEventTypesProd.DOWNLOAD_ERROR_PROD, data: downloadEventPaylod
|
|
140
|
+
)
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
} catch {
|
|
144
|
+
StallionEventEmitter.sendEvent(eventType: StallionConstants.NativeEventTypesProd.DOWNLOAD_ERROR_PROD, data: downloadEventPaylod
|
|
145
|
+
)
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
@@ -8,22 +8,12 @@
|
|
|
8
8
|
import Foundation
|
|
9
9
|
|
|
10
10
|
class StallionUtil {
|
|
11
|
-
public struct LSKeys {
|
|
12
|
-
static let bucketKey = "activeBucket"
|
|
13
|
-
static let versionKey = "activeVersion"
|
|
14
|
-
static let switchStateKey = "switchState"
|
|
15
|
-
static let apiKey = "apiKey"
|
|
16
|
-
}
|
|
17
|
-
public struct SwitchStates {
|
|
18
|
-
static let ON = "STALLION_ON"
|
|
19
|
-
static let OFF = "DEFAULT"
|
|
20
|
-
}
|
|
21
11
|
static func setLs(key: String, value: String) {
|
|
22
12
|
let defaults = UserDefaults.standard
|
|
23
13
|
defaults.set(value, forKey: key)
|
|
24
14
|
}
|
|
25
|
-
static func getLs(key: String) -> String
|
|
15
|
+
static func getLs(key: String) -> String {
|
|
26
16
|
let defaults = UserDefaults.standard
|
|
27
|
-
return defaults.string(forKey: key)
|
|
17
|
+
return defaults.string(forKey: key) ?? ""
|
|
28
18
|
}
|
|
29
19
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-stallion",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-alpha.1",
|
|
4
4
|
"description": "Offical React Native SDK for Stallion",
|
|
5
5
|
"main": "index",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -34,7 +34,11 @@
|
|
|
34
34
|
},
|
|
35
35
|
"release": {
|
|
36
36
|
"branches": [
|
|
37
|
-
"main"
|
|
37
|
+
"main",
|
|
38
|
+
{
|
|
39
|
+
"name": "alpha",
|
|
40
|
+
"prerelease": true
|
|
41
|
+
}
|
|
38
42
|
],
|
|
39
43
|
"plugins": [
|
|
40
44
|
"@semantic-release/commit-analyzer",
|
package/src/index.js
CHANGED
|
@@ -7,28 +7,18 @@ import useStallionModalNoop from './noop/useStallionModal';
|
|
|
7
7
|
// main imports
|
|
8
8
|
import withStallionMain from './main/utils/withStallion';
|
|
9
9
|
import useStallionModalMain from './main/utils/useStallionModal';
|
|
10
|
-
import
|
|
11
|
-
let isEnabled = true;
|
|
12
|
-
let projectId = '';
|
|
10
|
+
import { stallionEventEmitter } from './main/utils/StallionEventEmitter';
|
|
13
11
|
export let withStallion;
|
|
14
12
|
export let useStallionModal;
|
|
15
|
-
|
|
16
|
-
// const stallionConfigObj: IStallionConfig = require('../example/stallion.config.js'); // testing import
|
|
17
|
-
const stallionConfigObj = require('../../../stallion.config.js'); // prod import
|
|
18
|
-
isEnabled = (stallionConfigObj === null || stallionConfigObj === void 0 ? void 0 : stallionConfigObj.stallionEnabled) || false;
|
|
19
|
-
if ((stallionConfigObj === null || stallionConfigObj === void 0 ? void 0 : stallionConfigObj.stallionEnabled) === false) {
|
|
20
|
-
isEnabled = false;
|
|
21
|
-
}
|
|
22
|
-
projectId = (stallionConfigObj === null || stallionConfigObj === void 0 ? void 0 : stallionConfigObj.projectId) || '';
|
|
23
|
-
} catch (_) {}
|
|
24
|
-
if (isEnabled && StallionNativeModule !== null && StallionNativeModule !== void 0 && StallionNativeModule.getApiKey) {
|
|
25
|
-
var _SharedDataManager$ge;
|
|
13
|
+
if (StallionNativeModule !== null && StallionNativeModule !== void 0 && StallionNativeModule.getUniqueId) {
|
|
26
14
|
withStallion = withStallionMain;
|
|
27
15
|
useStallionModal = useStallionModalMain;
|
|
28
|
-
(_SharedDataManager$ge = SharedDataManager.getInstance()) === null || _SharedDataManager$ge === void 0 ? void 0 : _SharedDataManager$ge.setConfigProjectId(projectId);
|
|
29
16
|
} else {
|
|
30
17
|
console.warn(STALLION_DISABLED_ERROR);
|
|
31
18
|
withStallion = withStallionNoop;
|
|
32
19
|
useStallionModal = useStallionModalNoop;
|
|
33
20
|
}
|
|
21
|
+
export { sync } from './main/utils/StallionNativeUtils';
|
|
22
|
+
export { useStallionUpdate } from './main/utils/useStallionUpdate';
|
|
23
|
+
export const addEventListener = stallionEventEmitter.addEventListener.bind(stallionEventEmitter);
|
|
34
24
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StallionNativeModule","STALLION_DISABLED_ERROR","withStallionNoop","useStallionModalNoop","withStallionMain","useStallionModalMain","
|
|
1
|
+
{"version":3,"names":["StallionNativeModule","STALLION_DISABLED_ERROR","withStallionNoop","useStallionModalNoop","withStallionMain","useStallionModalMain","stallionEventEmitter","withStallion","useStallionModal","getUniqueId","console","warn","sync","useStallionUpdate","addEventListener","bind"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,OAAOA,oBAAoB,IACzBC,uBAAuB,QAClB,wBAAwB;;AAE/B;AACA,OAAOC,gBAAgB,MAAM,qBAAqB;AAClD,OAAOC,oBAAoB,MAAM,yBAAyB;;AAE1D;AACA,OAAOC,gBAAgB,MAAM,2BAA2B;AACxD,OAAOC,oBAAoB,MAAM,+BAA+B;AAGhE,SAASC,oBAAoB,QAAQ,mCAAmC;AAExE,OAAO,IAAIC,YAA2B;AACtC,OAAO,IAAIC,gBAAyC;AAEpD,IAAIR,oBAAoB,aAApBA,oBAAoB,eAApBA,oBAAoB,CAAES,WAAW,EAAE;EACrCF,YAAY,GAAGH,gBAAgB;EAC/BI,gBAAgB,GAAGH,oBAAoB;AACzC,CAAC,MAAM;EACLK,OAAO,CAACC,IAAI,CAACV,uBAAuB,CAAC;EACrCM,YAAY,GAAGL,gBAAgB;EAC/BM,gBAAgB,GAAGL,oBAAoB;AACzC;AAEA,SAASS,IAAI,QAAQ,kCAAkC;AACvD,SAASC,iBAAiB,QAAQ,gCAAgC;AAClE,OAAO,MAAMC,gBAAgB,GAC3BR,oBAAoB,CAACQ,gBAAgB,CAACC,IAAI,CAACT,oBAAoB,CAAC"}
|
|
@@ -10,7 +10,7 @@ const styles = StyleSheet.create({
|
|
|
10
10
|
alignItems: 'center'
|
|
11
11
|
},
|
|
12
12
|
primaryButton: {
|
|
13
|
-
backgroundColor: COLORS.
|
|
13
|
+
backgroundColor: COLORS.black,
|
|
14
14
|
elevation: 5,
|
|
15
15
|
zIndex: 5,
|
|
16
16
|
shadowColor: COLORS.black7,
|
|
@@ -35,7 +35,7 @@ const styles = StyleSheet.create({
|
|
|
35
35
|
color: COLORS.white
|
|
36
36
|
},
|
|
37
37
|
secondaryText: {
|
|
38
|
-
color: COLORS.
|
|
38
|
+
color: COLORS.black
|
|
39
39
|
}
|
|
40
40
|
});
|
|
41
41
|
export default styles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","HEADER_SLAB_HEIGHT","STD_MARGIN","COLORS","styles","create","buttonContainer","height","borderRadius","width","justifyContent","alignItems","primaryButton","backgroundColor","
|
|
1
|
+
{"version":3,"names":["StyleSheet","HEADER_SLAB_HEIGHT","STD_MARGIN","COLORS","styles","create","buttonContainer","height","borderRadius","width","justifyContent","alignItems","primaryButton","backgroundColor","black","elevation","zIndex","shadowColor","black7","shadowOpacity","shadowOffset","shadowRadius","disabled","opacity","transparentButton","borderWidth","borderColor","buttonText","fontSize","primaryText","color","white","secondaryText"],"sourceRoot":"../../../../../../src","sources":["main/components/common/ButtonFullWidth/styles.ts"],"mappings":"AAAA,SAASA,UAAU,QAAQ,cAAc;AAEzC,SACEC,kBAAkB,EAClBC,UAAU,QACL,iCAAiC;AACxC,SAASC,MAAM,QAAQ,2BAA2B;AAElD,MAAMC,MAAM,GAAGJ,UAAU,CAACK,MAAM,CAAC;EAC/BC,eAAe,EAAE;IACfC,MAAM,EAAEN,kBAAkB;IAC1BO,YAAY,EAAEN,UAAU;IACxBO,KAAK,EAAE,MAAM;IACbC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd,CAAC;EACDC,aAAa,EAAE;IACbC,eAAe,EAAEV,MAAM,CAACW,KAAK;IAC7BC,SAAS,EAAE,CAAC;IACZC,MAAM,EAAE,CAAC;IACTC,WAAW,EAAEd,MAAM,CAACe,MAAM;IAC1BC,aAAa,EAAE,GAAG;IAClBC,YAAY,EAAE;MAAEb,MAAM,EAAE,EAAE;MAAEE,KAAK,EAAE;IAAG,CAAC;IACvCY,YAAY,EAAE;EAChB,CAAC;EACDC,QAAQ,EAAE;IACRC,OAAO,EAAE;EACX,CAAC;EACDC,iBAAiB,EAAE;IACjBC,WAAW,EAAE,CAAC;IACdC,WAAW,EAAEvB,MAAM,CAACe;EACtB,CAAC;EACDS,UAAU,EAAE;IACVC,QAAQ,EAAE3B,kBAAkB,GAAG;EACjC,CAAC;EACD4B,WAAW,EAAE;IACXC,KAAK,EAAE3B,MAAM,CAAC4B;EAChB,CAAC;EACDC,aAAa,EAAE;IACbF,KAAK,EAAE3B,MAAM,CAACW;EAChB;AACF,CAAC,CAAC;AAEF,eAAeV,MAAM"}
|
|
@@ -1,49 +1,42 @@
|
|
|
1
1
|
import React, { useCallback, memo } from 'react';
|
|
2
|
-
import { View, Text,
|
|
3
|
-
import {
|
|
2
|
+
import { View, Text, TouchableOpacity } from 'react-native';
|
|
3
|
+
import { SWITCH_TEXTS, RESTART_REQUIRED_MESSAGE } from '../../../constants/appConstants';
|
|
4
4
|
import styles from './styles';
|
|
5
5
|
const Footer = _ref => {
|
|
6
6
|
let {
|
|
7
7
|
switchIsOn,
|
|
8
8
|
onSwitchToggle,
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
errorMessage,
|
|
10
|
+
isRestartRequired
|
|
11
11
|
} = _ref;
|
|
12
|
-
const handleToggle = useCallback(
|
|
13
|
-
onSwitchToggle === null || onSwitchToggle === void 0 ? void 0 : onSwitchToggle(
|
|
14
|
-
}, [
|
|
12
|
+
const handleToggle = useCallback(newSwitchStatus => {
|
|
13
|
+
onSwitchToggle === null || onSwitchToggle === void 0 ? void 0 : onSwitchToggle(newSwitchStatus);
|
|
14
|
+
}, [onSwitchToggle]);
|
|
15
15
|
return /*#__PURE__*/React.createElement(React.Fragment, null, errorMessage ? /*#__PURE__*/React.createElement(View, {
|
|
16
16
|
style: [styles.errorInfoSection]
|
|
17
17
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
18
|
-
style: styles.
|
|
19
|
-
numberOfLines: 1
|
|
20
|
-
}, errorMessage)) : null, /*#__PURE__*/React.createElement(View, {
|
|
21
|
-
style: [styles.footerContainer, styles.shadowContainer]
|
|
22
|
-
}, activeBundle !== null && activeBundle !== void 0 && activeBundle.bucketName ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, {
|
|
23
|
-
style: styles.dividerSection
|
|
24
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
25
|
-
style: styles.infoTitle,
|
|
18
|
+
style: styles.ribbonMessage,
|
|
26
19
|
numberOfLines: 1
|
|
20
|
+
}, errorMessage)) : null, isRestartRequired ? /*#__PURE__*/React.createElement(View, {
|
|
21
|
+
style: [styles.restartInfoSection]
|
|
27
22
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
28
|
-
style: styles.
|
|
29
|
-
}, FOOTER_INFO_TITLE), activeBundle === null || activeBundle === void 0 ? void 0 : activeBundle.bucketName), /*#__PURE__*/React.createElement(Text, {
|
|
30
|
-
style: styles.infoSubTitle,
|
|
23
|
+
style: styles.ribbonMessage,
|
|
31
24
|
numberOfLines: 1
|
|
25
|
+
}, RESTART_REQUIRED_MESSAGE)) : null, /*#__PURE__*/React.createElement(View, {
|
|
26
|
+
style: [styles.footerContainer, styles.shadowContainer]
|
|
27
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
28
|
+
style: styles.switchContainer
|
|
29
|
+
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
30
|
+
onPress: () => handleToggle(true),
|
|
31
|
+
style: [styles.tabContainer, switchIsOn ? styles.tabSelected : {}]
|
|
32
32
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
33
|
-
style: styles.
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
style: [styles.infoTitle, switchIsOn ? styles.greenColor : styles.redColor, styles.bold]
|
|
38
|
-
}, SWITCH_TITLE, switchIsOn ? SWITCH_TEXTS.ON : SWITCH_TEXTS.OFF), /*#__PURE__*/React.createElement(Switch, {
|
|
39
|
-
style: styles.switchButton,
|
|
40
|
-
onValueChange: handleToggle,
|
|
41
|
-
value: switchIsOn
|
|
42
|
-
}))) : /*#__PURE__*/React.createElement(View, {
|
|
43
|
-
style: [styles.noDownloadContainer]
|
|
33
|
+
style: [styles.titleBasic, switchIsOn ? styles.titleSelected : {}]
|
|
34
|
+
}, SWITCH_TEXTS.ON)), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
35
|
+
onPress: () => handleToggle(false),
|
|
36
|
+
style: [styles.tabContainer, !switchIsOn ? styles.tabSelected : {}]
|
|
44
37
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
45
|
-
style: styles.
|
|
46
|
-
},
|
|
38
|
+
style: [styles.titleBasic, !switchIsOn ? styles.titleSelected : {}]
|
|
39
|
+
}, SWITCH_TEXTS.OFF)))));
|
|
47
40
|
};
|
|
48
41
|
export default /*#__PURE__*/memo(Footer);
|
|
49
42
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","memo","View","Text","
|
|
1
|
+
{"version":3,"names":["React","useCallback","memo","View","Text","TouchableOpacity","SWITCH_TEXTS","RESTART_REQUIRED_MESSAGE","styles","Footer","_ref","switchIsOn","onSwitchToggle","errorMessage","isRestartRequired","handleToggle","newSwitchStatus","createElement","Fragment","style","errorInfoSection","ribbonMessage","numberOfLines","restartInfoSection","footerContainer","shadowContainer","switchContainer","onPress","tabContainer","tabSelected","titleBasic","titleSelected","ON","OFF"],"sourceRoot":"../../../../../../src","sources":["main/components/common/Footer/index.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,IAAI,QAAQ,OAAO;A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EA,CAAA,KAAMZ,YAAY,CAAC,IAAI,CAAE;IAClCI,KAAK,EAAE,CAACX,MAAM,CAACoB,YAAY,EAAEjB,UAAU,GAAGH,MAAM,CAACqB,WAAW,GAAG,CAAC,CAAC;EAAE,gBAEnE7B,KAAA,CAAAiB,aAAA,CAACb,IAAI;IACHe,KAAK,EAAE,CACLX,MAAM,CAACsB,UAAU,EACjBnB,UAAU,GAAGH,MAAM,CAACuB,aAAa,GAAG,CAAC,CAAC;EACtC,GAEDzB,YAAY,CAAC0B,EACV,CACU,CAAC,eACnBhC,KAAA,CAAAiB,aAAA,CAACZ,gBAAgB;IACfsB,OAAO,EAAEA,CAAA,KAAMZ,YAAY,CAAC,KAAK,CAAE;IACnCI,KAAK,EAAE,CAACX,MAAM,CAACoB,YAAY,EAAE,CAACjB,UAAU,GAAGH,MAAM,CAACqB,WAAW,GAAG,CAAC,CAAC;EAAE,gBAEpE7B,KAAA,CAAAiB,aAAA,CAACb,IAAI;IACHe,KAAK,EAAE,CACLX,MAAM,CAACsB,UAAU,EACjB,CAACnB,UAAU,GAAGH,MAAM,CAACuB,aAAa,GAAG,CAAC,CAAC;EACvC,GAEDzB,YAAY,CAAC2B,GACV,CACU,CACd,CACF,CACN,CAAC;AAEP,CAAC;AAED,4BAAe/B,IAAI,CAACO,MAAM,CAAC"}
|
|
@@ -25,54 +25,55 @@ const styles = StyleSheet.create({
|
|
|
25
25
|
alignItems: 'center',
|
|
26
26
|
justifyContent: 'center'
|
|
27
27
|
},
|
|
28
|
-
|
|
28
|
+
restartInfoSection: {
|
|
29
|
+
height: STD_MARGIN * 2.5,
|
|
30
|
+
backgroundColor: COLORS.indigo,
|
|
31
|
+
alignItems: 'center',
|
|
32
|
+
justifyContent: 'center'
|
|
33
|
+
},
|
|
34
|
+
ribbonMessage: {
|
|
29
35
|
fontSize: STD_MARGIN * 1.2,
|
|
30
36
|
color: COLORS.white,
|
|
31
|
-
marginHorizontal: STD_MARGIN / 2
|
|
37
|
+
marginHorizontal: STD_MARGIN / 2,
|
|
38
|
+
fontWeight: 'bold'
|
|
32
39
|
},
|
|
33
40
|
footerContainer: {
|
|
34
41
|
paddingHorizontal: STD_MARGIN,
|
|
35
42
|
paddingVertical: STD_MARGIN / 2,
|
|
36
43
|
flexDirection: 'row',
|
|
37
|
-
justifyContent: '
|
|
44
|
+
justifyContent: 'center',
|
|
38
45
|
alignItems: 'center',
|
|
39
46
|
backgroundColor: COLORS.white
|
|
40
47
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
alignCenter: {
|
|
51
|
-
alignItems: 'center'
|
|
48
|
+
switchContainer: {
|
|
49
|
+
borderWidth: 0.5,
|
|
50
|
+
borderColor: COLORS.black5,
|
|
51
|
+
padding: STD_MARGIN / 2,
|
|
52
|
+
flexDirection: 'row',
|
|
53
|
+
justifyContent: 'center',
|
|
54
|
+
alignItems: 'center',
|
|
55
|
+
borderRadius: STD_MARGIN
|
|
52
56
|
},
|
|
53
|
-
|
|
57
|
+
tabContainer: {
|
|
54
58
|
flex: 1,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
},
|
|
61
|
-
bold: {
|
|
62
|
-
fontWeight: 'bold'
|
|
63
|
-
},
|
|
64
|
-
noDownloadText: {
|
|
65
|
-
alignSelf: 'center',
|
|
66
|
-
color: COLORS.black5
|
|
59
|
+
flexDirection: 'column',
|
|
60
|
+
justifyContent: 'center',
|
|
61
|
+
alignContent: 'center',
|
|
62
|
+
padding: STD_MARGIN * 1.3,
|
|
63
|
+
borderRadius: STD_MARGIN
|
|
67
64
|
},
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
tabSelected: {
|
|
66
|
+
backgroundColor: COLORS.black
|
|
70
67
|
},
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
titleSelected: {
|
|
69
|
+
fontSize: STD_MARGIN * 1.2,
|
|
70
|
+
color: COLORS.white
|
|
73
71
|
},
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
titleBasic: {
|
|
73
|
+
textAlign: 'center',
|
|
74
|
+
fontSize: STD_MARGIN * 1.5,
|
|
75
|
+
color: COLORS.black,
|
|
76
|
+
fontWeight: 'bold'
|
|
76
77
|
}
|
|
77
78
|
});
|
|
78
79
|
export default styles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","STD_MARGIN","COLORS","styles","create","shadowContainer","elevation","zIndex","shadowOpacity","shadowOffset","height","width","shadowRadius","noDownloadContainer","justifyContent","alignItems","paddingHorizontal","paddingVertical","errorInfoSection","backgroundColor","error","
|
|
1
|
+
{"version":3,"names":["StyleSheet","STD_MARGIN","COLORS","styles","create","shadowContainer","elevation","zIndex","shadowOpacity","shadowOffset","height","width","shadowRadius","noDownloadContainer","justifyContent","alignItems","paddingHorizontal","paddingVertical","errorInfoSection","backgroundColor","error","restartInfoSection","indigo","ribbonMessage","fontSize","color","white","marginHorizontal","fontWeight","footerContainer","flexDirection","switchContainer","borderWidth","borderColor","black5","padding","borderRadius","tabContainer","flex","alignContent","tabSelected","black","titleSelected","titleBasic","textAlign"],"sourceRoot":"../../../../../../src","sources":["main/components/common/Footer/styles.ts"],"mappings":"AAAA,SAASA,UAAU,QAAQ,cAAc;AAEzC,SAASC,UAAU,QAAQ,iCAAiC;AAC5D,SAASC,MAAM,QAAQ,2BAA2B;AAElD,MAAMC,MAAM,GAAGH,UAAU,CAACI,MAAM,CAAC;EAC/BC,eAAe,EAAE;IACfC,SAAS,EAAE,CAAC;IACZC,MAAM,EAAE,CAAC;IACTC,aAAa,EAAE,GAAG;IAClBC,YAAY,EAAE;MAAEC,MAAM,EAAE,CAAC,EAAE;MAAEC,KAAK,EAAE;IAAE,CAAC;IACvCC,YAAY,EAAE;EAChB,CAAC;EACDC,mBAAmB,EAAE;IACnBC,cAAc,EAAE,Q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U,GAAG,GAAG;IACzBmC,YAAY,EAAEnC;EAChB,CAAC;EACDuC,WAAW,EAAE;IACXrB,eAAe,EAAEjB,MAAM,CAACuC;EAC1B,CAAC;EACDC,aAAa,EAAE;IACblB,QAAQ,EAAEvB,UAAU,GAAG,GAAG;IAC1BwB,KAAK,EAAEvB,MAAM,CAACwB;EAChB,CAAC;EACDiB,UAAU,EAAE;IACVC,SAAS,EAAE,QAAQ;IACnBpB,QAAQ,EAAEvB,UAAU,GAAG,GAAG;IAC1BwB,KAAK,EAAEvB,MAAM,CAACuC,KAAK;IACnBb,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAEF,eAAezB,MAAM"}
|
|
@@ -16,12 +16,14 @@ const Header = _ref => {
|
|
|
16
16
|
}, []);
|
|
17
17
|
return /*#__PURE__*/React.createElement(View, {
|
|
18
18
|
style: styles.headerContainer
|
|
19
|
-
}, onBackPress ? /*#__PURE__*/React.createElement(
|
|
20
|
-
style: [styles.headerSideSection, styles.alignStart]
|
|
21
|
-
|
|
19
|
+
}, onBackPress ? /*#__PURE__*/React.createElement(View, {
|
|
20
|
+
style: [styles.headerSideSection, styles.alignStart]
|
|
21
|
+
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
22
|
+
onPress: onBackPress,
|
|
23
|
+
style: styles.actionButtonClickable
|
|
22
24
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
23
25
|
style: styles.actionButtonText
|
|
24
|
-
}, BACK_BUTTON_TEXT)) : /*#__PURE__*/React.createElement(View, {
|
|
26
|
+
}, BACK_BUTTON_TEXT))) : /*#__PURE__*/React.createElement(View, {
|
|
25
27
|
style: [styles.headerSideSection, styles.alignStart]
|
|
26
28
|
}, userName && onProfilePress ? /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
27
29
|
style: styles.headerProfileButton,
|
|
@@ -30,7 +32,7 @@ const Header = _ref => {
|
|
|
30
32
|
style: styles.profileInitial
|
|
31
33
|
}, (userName === null || userName === void 0 ? void 0 : userName[0]) || '')) : null), /*#__PURE__*/React.createElement(View, {
|
|
32
34
|
style: styles.headerCenterSection
|
|
33
|
-
}, errorLogoLoading ? /*#__PURE__*/React.createElement(Text, {
|
|
35
|
+
}, title ? errorLogoLoading ? /*#__PURE__*/React.createElement(Text, {
|
|
34
36
|
style: styles.headerText
|
|
35
37
|
}, title) : /*#__PURE__*/React.createElement(Image, {
|
|
36
38
|
source: {
|
|
@@ -39,12 +41,14 @@ const Header = _ref => {
|
|
|
39
41
|
style: styles.headerLogo,
|
|
40
42
|
resizeMode: "contain",
|
|
41
43
|
onError: errorInLogoLoading
|
|
42
|
-
})), onClosePress ? /*#__PURE__*/React.createElement(
|
|
43
|
-
style: styles.headerSideSection
|
|
44
|
+
}) : null), onClosePress ? /*#__PURE__*/React.createElement(View, {
|
|
45
|
+
style: styles.headerSideSection
|
|
46
|
+
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
47
|
+
style: styles.actionButtonClickable,
|
|
44
48
|
onPress: onClosePress
|
|
45
49
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
46
50
|
style: styles.actionButtonText
|
|
47
|
-
}, CLOSE_BUTTON_TEXT)) : /*#__PURE__*/React.createElement(View, {
|
|
51
|
+
}, CLOSE_BUTTON_TEXT))) : /*#__PURE__*/React.createElement(View, {
|
|
48
52
|
style: styles.headerSideSection
|
|
49
53
|
}));
|
|
50
54
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","memo","useCallback","useState","View","TouchableOpacity","Text","Image","BACK_BUTTON_TEXT","CLOSE_BUTTON_TEXT","STALLION_LOGO_URL","styles","Header","_ref","userName","title","onBackPress","onClosePress","onProfilePress","errorLogoLoading","setErrorLogoLoading","errorInLogoLoading","createElement","style","headerContainer","headerSideSection","alignStart","onPress","actionButtonText","headerProfileButton","profileInitial","headerCenterSection","headerText","source","uri","headerLogo","resizeMode","onError"],"sourceRoot":"../../../../../../src","sources":["main/components/common/Header/index.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,IAAI,EAAEC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AAC1D,SAASC,IAAI,EAAEC,gBAAgB,EAAEC,IAAI,EAAEC,KAAK,QAAQ,cAAc;AAElE,SACEC,gBAAgB,EAChBC,iBAAiB,EACjBC,iBAAiB,QACZ,iCAAiC;AAExC,OAAOC,MAAM,MAAM,UAAU;AAU7B,MAAMC,MAAyB,GAAGC,IAAA,IAM5B;EAAA,IAN6B;IACjCC,QAAQ;IACRC,KAAK;IACLC,WAAW;IACXC,YAAY;IACZC;EACF,CAAC,GAAAL,IAAA;EACC,MAAM,CAACM,gBAAgB,EAAEC,mBAAmB,CAAC,GAAGjB,QAAQ,CAAC,KAAK,CAAC;EAC/D,MAAMkB,kBAAkB,GAAGnB,WAAW,CAAC,MAAM;IAC3CkB,mBAAmB,CAAC,IAAI,CAAC;EAC3B,CAAC,EAAE,EAAE,CAAC;EACN,oBACEpB,KAAA,CAAAsB,aAAA,CAAClB,IAAI;IAACmB,KAAK,EAAEZ,MAAM,CAACa;EAAgB,GACjCR,WAAW,gBACVhB,KAAA,CAAAsB,aAAA,
|
|
1
|
+
{"version":3,"names":["React","memo","useCallback","useState","View","TouchableOpacity","Text","Image","BACK_BUTTON_TEXT","CLOSE_BUTTON_TEXT","STALLION_LOGO_URL","styles","Header","_ref","userName","title","onBackPress","onClosePress","onProfilePress","errorLogoLoading","setErrorLogoLoading","errorInLogoLoading","createElement","style","headerContainer","headerSideSection","alignStart","onPress","actionButtonClickable","actionButtonText","headerProfileButton","profileInitial","headerCenterSection","headerText","source","uri","headerLogo","resizeMode","onError"],"sourceRoot":"../../../../../../src","sources":["main/components/common/Header/index.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,IAAI,EAAEC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AAC1D,SAASC,IAAI,EAAEC,gBAAgB,EAAEC,IAAI,EAAEC,KAAK,QAAQ,cAAc;AAElE,SACEC,gBAAgB,EA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,aAARA,QAAQ,uBAARA,QAAQ,CAAG,CAAC,CAAC,KAAI,EAAS,CAC/C,CAAC,GACjB,IACA,CACP,eACDd,KAAA,CAAAsB,aAAA,CAAClB,IAAI;IAACmB,KAAK,EAAEZ,MAAM,CAACqB;EAAoB,GACrCjB,KAAK,GACJI,gBAAgB,gBACdnB,KAAA,CAAAsB,aAAA,CAAChB,IAAI;IAACiB,KAAK,EAAEZ,MAAM,CAACsB;EAAW,GAAElB,KAAY,CAAC,gBAE9Cf,KAAA,CAAAsB,aAAA,CAACf,KAAK;IACJ2B,MAAM,EAAE;MACNC,GAAG,EAAEzB;IACP,CAAE;IACFa,KAAK,EAAEZ,MAAM,CAACyB,UAAW;IACzBC,UAAU,EAAC,SAAS;IACpBC,OAAO,EAAEjB;EAAmB,CAC7B,CACF,GACC,IACA,CAAC,EACNJ,YAAY,gBACXjB,KAAA,CAAAsB,aAAA,CAAClB,IAAI;IAACmB,KAAK,EAAEZ,MAAM,CAACc;EAAkB,gBACpCzB,KAAA,CAAAsB,aAAA,CAACjB,gBAAgB;IACfkB,KAAK,EAAEZ,MAAM,CAACiB,qBAAsB;IACpCD,OAAO,EAAEV;EAAa,gBAEtBjB,KAAA,CAAAsB,aAAA,CAAChB,IAAI;IAACiB,KAAK,EAAEZ,MAAM,CAACkB;EAAiB,GAAEpB,iBAAwB,CAC/C,CACd,CAAC,gBAEPT,KAAA,CAAAsB,aAAA,CAAClB,IAAI;IAACmB,KAAK,EAAEZ,MAAM,CAACc;EAAkB,CAAE,CAEtC,CAAC;AAEX,CAAC;AAED,4BAAexB,IAAI,CAACW,MAAM,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StyleSheet } from 'react-native';
|
|
2
|
-
import { HEADER_SLAB_HEIGHT } from '../../../constants/appConstants';
|
|
2
|
+
import { HEADER_SLAB_HEIGHT, STD_MARGIN } from '../../../constants/appConstants';
|
|
3
3
|
import { COLORS } from '../../../constants/colors';
|
|
4
4
|
const PROFILE_BUTTON_EDGE = HEADER_SLAB_HEIGHT / 1.7;
|
|
5
5
|
const styles = StyleSheet.create({
|
|
@@ -23,8 +23,7 @@ const styles = StyleSheet.create({
|
|
|
23
23
|
headerSideSection: {
|
|
24
24
|
flex: 1,
|
|
25
25
|
justifyContent: 'center',
|
|
26
|
-
alignItems: 'flex-end'
|
|
27
|
-
padding: HEADER_SLAB_HEIGHT / 5
|
|
26
|
+
alignItems: 'flex-end'
|
|
28
27
|
},
|
|
29
28
|
headerProfileButton: {
|
|
30
29
|
height: PROFILE_BUTTON_EDGE,
|
|
@@ -32,7 +31,8 @@ const styles = StyleSheet.create({
|
|
|
32
31
|
borderRadius: PROFILE_BUTTON_EDGE / 2,
|
|
33
32
|
justifyContent: 'center',
|
|
34
33
|
alignItems: 'center',
|
|
35
|
-
backgroundColor: COLORS.
|
|
34
|
+
backgroundColor: COLORS.black,
|
|
35
|
+
marginLeft: STD_MARGIN
|
|
36
36
|
},
|
|
37
37
|
headerCenterSection: {
|
|
38
38
|
flex: 2,
|
|
@@ -44,9 +44,14 @@ const styles = StyleSheet.create({
|
|
|
44
44
|
color: COLORS.black,
|
|
45
45
|
fontWeight: 'bold'
|
|
46
46
|
},
|
|
47
|
+
actionButtonClickable: {
|
|
48
|
+
padding: STD_MARGIN
|
|
49
|
+
},
|
|
47
50
|
actionButtonText: {
|
|
48
51
|
fontSize: HEADER_SLAB_HEIGHT / 3.5,
|
|
49
|
-
color: COLORS.
|
|
52
|
+
color: COLORS.black,
|
|
53
|
+
fontWeight: 'bold',
|
|
54
|
+
textDecorationLine: 'underline'
|
|
50
55
|
},
|
|
51
56
|
alignStart: {
|
|
52
57
|
alignItems: 'flex-start'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","HEADER_SLAB_HEIGHT","COLORS","PROFILE_BUTTON_EDGE","styles","create","headerContainer","height","width","flexDirection","justifyContent","alignItems","zIndex","elevation","shadowColor","black","shadowOpacity","shadowOffset","shadowRadius","backgroundColor","white","headerSideSection","flex","
|
|
1
|
+
{"version":3,"names":["StyleSheet","HEADER_SLAB_HEIGHT","STD_MARGIN","COLORS","PROFILE_BUTTON_EDGE","styles","create","headerContainer","height","width","flexDirection","justifyContent","alignItems","zIndex","elevation","shadowColor","black","shadowOpacity","shadowOffset","shadowRadius","backgroundColor","white","headerSideSection","flex","headerProfileButton","borderRadius","marginLeft","headerCenterSection","headerText","fontSize","color","fontWeight","actionButtonClickable","padding","actionButtonText","textDecorationLine","alignStart","headerLogo","profileInitial"],"sourceRoot":"../../../../../../src","sources":["main/components/common/Header/styles.ts"],"mappings":"AAAA,SAASA,UAAU,QAAQ,cAAc;AAEzC,SACEC,kBAAkB,EAClBC,UAAU,QACL,iCAAiC;AACxC,SAASC,MAAM,QAAQ,2BAA2B;AAElD,MAAMC,mBAAmB,GAAGH,kBAAkB,GAAG,GAAG;AAEpD,MAAMI,MAAM,GAAGL,UAAU,CAACM,MAAM,CAAC;EAC/BC,eAAe,EAAE;IACfC,MAAM,EAAEP,kBAAkB;IAC1BQ,KAAK,EAAE,MAAM;IACbC,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE,eAAe;IAC/BC,UAAU,EAAE,QAAQ;IACpBC,MAAM,EAAE,CAAC;IACTC,SAAS,EAAE,CAAC;IACZC,WAAW,EAAEZ,MAAM,CAACa,KAAK;IACzBC,aAAa,EAAE,IAAI;IACnBC,YAAY,EAAE;MAAEV,MAAM,EAAE,EAAE;MAAEC,KAAK,EAAE;IAAE,CAAC;IACtCU,YAAY,EAAE,EAAE;IAChBC,eAAe,EAAEjB,MAAM,CAACkB;EAC1B,CAAC;EACDC,iBAAiB,EAAE;IACjBC,IAAI,EAAE,CAAC;IACPZ,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd,CAAC;EACDY,mBAAmB,EAAE;IACnBhB,MAAM,EAAEJ,mBAAmB;IAC3BK,KAAK,EAAEL,mBAAmB;IAC1BqB,YAAY,EAAErB,mBAAmB,GAAG,C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