airbridge-react-native-sdk-restricted 2.8.9 → 2.9.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.
Files changed (142) hide show
  1. package/airbridge-react-native-sdk-restricted.podspec +1 -1
  2. package/android/build.gradle +1 -1
  3. package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgeInAppPurchase.java +32 -0
  4. package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgeRN.java +2 -1
  5. package/changelog.md +5 -0
  6. package/index.d.ts +40 -0
  7. package/ios/AirbridgeRN/AirbridgeInAppPurchase.h +16 -0
  8. package/ios/AirbridgeRN/AirbridgeInAppPurchase.m +30 -0
  9. package/ios/AirbridgeRN.xcodeproj/project.pbxproj +16 -0
  10. package/ios/copy-config.rb +1 -1
  11. package/package.json +1 -1
  12. package/src/Airbridge.js +25 -0
  13. package/src/InAppPurchase.js +38 -0
  14. package/src/WebInterface.js +1 -1
  15. package/.github/actions/add-github-check/action.yml +0 -78
  16. package/.github/actions/add-github-comment/action.yml +0 -48
  17. package/.github/actions/add-slack-message/action.yml +0 -32
  18. package/.github/actions/edit-github-check/action.yml +0 -59
  19. package/.github/actions/edit-github-comment/action.yml +0 -41
  20. package/.github/pull_request_template.md +0 -5
  21. package/.github/readme.md +0 -53
  22. package/.github/workflows/build.yml +0 -367
  23. package/.github/workflows/gitflow.yml +0 -20
  24. package/.github/workflows/release-restricted.yml +0 -35
  25. package/.github/workflows/release.yml +0 -32
  26. package/qa/.bundle/config +0 -2
  27. package/qa/.eslintrc.js +0 -4
  28. package/qa/.prettierrc.js +0 -7
  29. package/qa/.watchmanconfig +0 -1
  30. package/qa/Gemfile +0 -9
  31. package/qa/Gemfile.lock +0 -105
  32. package/qa/__tests__/App.test.tsx +0 -17
  33. package/qa/airbridge.json +0 -7
  34. package/qa/android/app/build.gradle +0 -130
  35. package/qa/android/app/debug.keystore +0 -0
  36. package/qa/android/app/google-services.json +0 -29
  37. package/qa/android/app/proguard-rules.pro +0 -10
  38. package/qa/android/app/src/debug/AndroidManifest.xml +0 -9
  39. package/qa/android/app/src/main/AndroidManifest.xml +0 -65
  40. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/ConfigurationLoader.kt +0 -49
  41. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/MainActivity.kt +0 -35
  42. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/MainApplication.kt +0 -46
  43. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/DeviceInfoInteractor.kt +0 -60
  44. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/DeviceInfoUtils.kt +0 -115
  45. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/IdentifiersInteractor.kt +0 -83
  46. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/InstallReferrerInteractor.kt +0 -91
  47. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/ModuleInjector.kt +0 -22
  48. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/PermissionInteractor.kt +0 -55
  49. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/UserInfoInteractor.kt +0 -74
  50. package/qa/android/app/src/main/res/drawable/rn_edit_text_material.xml +0 -37
  51. package/qa/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  52. package/qa/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  53. package/qa/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  54. package/qa/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  55. package/qa/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  56. package/qa/android/app/src/main/res/values/strings.xml +0 -3
  57. package/qa/android/app/src/main/res/values/styles.xml +0 -9
  58. package/qa/android/build.gradle +0 -28
  59. package/qa/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  60. package/qa/android/gradle/wrapper/gradle-wrapper.properties +0 -7
  61. package/qa/android/gradle.properties +0 -41
  62. package/qa/android/gradlew +0 -249
  63. package/qa/android/gradlew.bat +0 -92
  64. package/qa/android/settings.gradle +0 -4
  65. package/qa/app.json +0 -4
  66. package/qa/babel.config.js +0 -3
  67. package/qa/index.js +0 -5
  68. package/qa/ios/.xcode.env +0 -11
  69. package/qa/ios/AirbridgeQA/AirbridgeQA.entitlements +0 -17
  70. package/qa/ios/AirbridgeQA/AppDelegate.h +0 -6
  71. package/qa/ios/AirbridgeQA/AppDelegate.mm +0 -123
  72. package/qa/ios/AirbridgeQA/DeviceInfoInteractor.m +0 -14
  73. package/qa/ios/AirbridgeQA/DeviceInfoInteractor.swift +0 -151
  74. package/qa/ios/AirbridgeQA/IdentifiersInteractor.m +0 -14
  75. package/qa/ios/AirbridgeQA/IdentifiersInteractor.swift +0 -40
  76. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/Contents.json +0 -53
  77. package/qa/ios/AirbridgeQA/Images.xcassets/Contents.json +0 -6
  78. package/qa/ios/AirbridgeQA/Info.plist +0 -66
  79. package/qa/ios/AirbridgeQA/LaunchScreen.storyboard +0 -47
  80. package/qa/ios/AirbridgeQA/PermissionInteractor.m +0 -14
  81. package/qa/ios/AirbridgeQA/PermissionInteractor.swift +0 -19
  82. package/qa/ios/AirbridgeQA/PrivacyInfo.xcprivacy +0 -39
  83. package/qa/ios/AirbridgeQA/UserInfoInteractor.m +0 -57
  84. package/qa/ios/AirbridgeQA/UserInfoInteractor.swift +0 -49
  85. package/qa/ios/AirbridgeQA/main.m +0 -10
  86. package/qa/ios/AirbridgeQA.xcodeproj/project.pbxproj +0 -790
  87. package/qa/ios/AirbridgeQA.xcodeproj/xcshareddata/xcschemes/AirbridgeQA.xcscheme +0 -88
  88. package/qa/ios/AirbridgeQA.xcworkspace/contents.xcworkspacedata +0 -10
  89. package/qa/ios/AirbridgeQA.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  90. package/qa/ios/AirbridgeQATests/AirbridgeQATests.m +0 -66
  91. package/qa/ios/AirbridgeQATests/Info.plist +0 -24
  92. package/qa/ios/GoogleService-Info.plist +0 -30
  93. package/qa/ios/Library/airbridge-ios-sdk-qa-library.podspec +0 -26
  94. package/qa/ios/Podfile +0 -44
  95. package/qa/ios/Podfile.lock +0 -1634
  96. package/qa/jest.config.js +0 -3
  97. package/qa/metro.config.js +0 -67
  98. package/qa/package-lock.json +0 -14289
  99. package/qa/package.json +0 -47
  100. package/qa/resource/arrow_back.png +0 -0
  101. package/qa/resource/home.png +0 -0
  102. package/qa/resource/info.png +0 -0
  103. package/qa/resource/link.png +0 -0
  104. package/qa/resource/refresh.png +0 -0
  105. package/qa/resource/token.png +0 -0
  106. package/qa/source/App.js +0 -58
  107. package/qa/source/common/Colors.js +0 -20
  108. package/qa/source/common/FCMService.js +0 -94
  109. package/qa/source/common/Native.ts +0 -39
  110. package/qa/source/common/Storage.js +0 -13
  111. package/qa/source/common/Styles.js +0 -39
  112. package/qa/source/component/AttributeEntryInputDialog.js +0 -117
  113. package/qa/source/component/AttributeTypeInputDialog.js +0 -100
  114. package/qa/source/component/ConfirmDialog.js +0 -72
  115. package/qa/source/component/CustomButton.js +0 -50
  116. package/qa/source/component/CustomEventParamsDialog.js +0 -150
  117. package/qa/source/component/CustomTextInput.js +0 -40
  118. package/qa/source/component/EntryInputDialog.js +0 -89
  119. package/qa/source/component/HorizontalPreference.js +0 -46
  120. package/qa/source/component/ImageButton.js +0 -35
  121. package/qa/source/component/InjectInputDialog.js +0 -80
  122. package/qa/source/component/MessageDialog.js +0 -81
  123. package/qa/source/component/UrlInputDialog.js +0 -80
  124. package/qa/source/component/ValueInputDialog.js +0 -80
  125. package/qa/source/component/VerticalPreference.js +0 -42
  126. package/qa/source/navigations/Stack.js +0 -110
  127. package/qa/source/pages/Browse.js +0 -118
  128. package/qa/source/pages/DeviceInfo.js +0 -135
  129. package/qa/source/pages/Event.js +0 -171
  130. package/qa/source/pages/Home.js +0 -136
  131. package/qa/source/pages/Identifiers.js +0 -108
  132. package/qa/source/pages/InstallReferrer.js +0 -64
  133. package/qa/source/pages/Placement.js +0 -38
  134. package/qa/source/pages/RequestPermissions.tsx +0 -41
  135. package/qa/source/pages/UserInfo.js +0 -168
  136. package/qa/source/pages/appInfo.js +0 -22
  137. package/qa/tsconfig.json +0 -3
  138. package/scripts/addiOSFramework.js +0 -48
  139. package/scripts/build-qa.sh +0 -64
  140. package/scripts/change_restricted.sh +0 -21
  141. package/scripts/update_native_version.sh +0 -104
  142. package/source/module/Attribution.ts +0 -60
package/qa/package.json DELETED
@@ -1,47 +0,0 @@
1
- {
2
- "name": "co.ab180.airbridge.qa.application",
3
- "version": "0.0.1",
4
- "private": true,
5
- "scripts": {
6
- "android": "react-native run-android --port=9000",
7
- "ios": "react-native run-ios --port=9000",
8
- "lint": "eslint .",
9
- "start": "react-native start --port=9000",
10
- "test": "jest"
11
- },
12
- "dependencies": {
13
- "@react-native-firebase/app": "^20.1.0",
14
- "@react-native-firebase/messaging": "^20.1.0",
15
- "@react-native-masked-view/masked-view": "^0.3.1",
16
- "@react-navigation/native": "^6.1.17",
17
- "@react-navigation/stack": "^6.3.29",
18
- "airbridge-react-native-sdk": "file:..",
19
- "react": "18.2.0",
20
- "react-native": "0.74.2",
21
- "react-native-gesture-handler": "^2.17.1",
22
- "react-native-safe-area-context": "^4.10.5",
23
- "react-native-screens": "^3.32.0",
24
- "react-native-simple-toast": "^3.3.1",
25
- "react-native-webview": "^13.10.4"
26
- },
27
- "devDependencies": {
28
- "@babel/core": "^7.20.0",
29
- "@babel/preset-env": "^7.20.0",
30
- "@babel/runtime": "^7.20.0",
31
- "@react-native/babel-preset": "0.74.84",
32
- "@react-native/eslint-config": "0.74.84",
33
- "@react-native/metro-config": "0.74.84",
34
- "@react-native/typescript-config": "0.74.84",
35
- "@types/react": "^18.2.6",
36
- "@types/react-test-renderer": "^18.0.0",
37
- "babel-jest": "^29.6.3",
38
- "eslint": "^8.19.0",
39
- "jest": "^29.6.3",
40
- "prettier": "2.8.8",
41
- "react-test-renderer": "18.2.0",
42
- "typescript": "5.5.2"
43
- },
44
- "engines": {
45
- "node": ">=18"
46
- }
47
- }
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/qa/source/App.js DELETED
@@ -1,58 +0,0 @@
1
- import React, { useEffect, useRef, useState } from 'react'
2
- import { View } from 'react-native'
3
-
4
- import { storage } from './common/Storage'
5
- import { fcmService } from './common/FCMService'
6
- import { NavigationContainer } from '@react-navigation/native'
7
- import StackNavigation from './navigations/Stack'
8
- import airbridge from 'airbridge-react-native-sdk'
9
-
10
- import MessageDialog from './component/MessageDialog'
11
-
12
- export default function App() {
13
-
14
- useEffect(() => {
15
- prepare()
16
- }, [])
17
-
18
- prepare = async () => {
19
- fcmService.prepare()
20
-
21
- storage.set('attributeResult', 'N/A')
22
- storage.set('deviceUUID', (await airbridge.state.deviceUUID()))
23
-
24
- airbridge.state.setAttributionListener((result) => {
25
- console.log('setAttributionListener : ' + result)
26
- if (result == null) {
27
- storage.set('attributeResult', 'N/A');
28
- } else {
29
- storage.set('attributeResult', JSON.stringify(result));
30
- }
31
- })
32
-
33
- airbridge.deeplink.setDeeplinkListener((result) => {
34
- console.log(`[DeepLink] ${result}`)
35
- setDeeplink(result)
36
- deeplinkRef.current?.show()
37
- })
38
- }
39
-
40
- const deeplinkRef = useRef();
41
- const [deeplink, setDeeplink] = useState('');
42
-
43
- return (
44
- <View style={{flex:1}}>
45
-
46
- <NavigationContainer>
47
- <StackNavigation />
48
- </NavigationContainer>
49
-
50
- <MessageDialog
51
- ref={deeplinkRef}
52
- title={'Deeplink'}
53
- accessibilityLabel={'deeplink'}
54
- message={deeplink} />
55
-
56
- </View>
57
- )
58
- }
@@ -1,20 +0,0 @@
1
- export const Colors = {
2
- red: '#f44336',
3
- pink: '#e91e63',
4
- purple: '#9c27b0',
5
- deepPurple: '#673ab7',
6
- indigo: '#3f51b5',
7
- blue: '#2196f3',
8
- lightBlue: '#03a9f4',
9
- cyan: '#00bcd4',
10
- teal: '#009688',
11
- green: '#4caf50',
12
- lime: '#cddc39',
13
- yellow: '#ffeb3b',
14
-
15
- grey: '#9e9e9e',
16
- deepBlue: '#0a69ff',
17
-
18
- white: '#ffffff',
19
- black: '#000000',
20
- }
@@ -1,94 +0,0 @@
1
- import { Platform } from 'react-native'
2
-
3
- import messaging from '@react-native-firebase/messaging'
4
- import Airbridge from 'airbridge-react-native-sdk'
5
-
6
- import { storage } from './Storage'
7
-
8
- class FCMService {
9
-
10
- prepare = async () => {
11
- if (Platform.OS === 'android') {
12
- this.androidRequestPermission()
13
- } else if (Platform.OS === 'ios') {
14
- this.iosRequestPermission()
15
- }
16
-
17
- this.onMessageReceived()
18
-
19
- return () => {
20
- console.log('[App] unRegister')
21
- }
22
- }
23
-
24
- updateToken = async () => {
25
- if (Platform.OS === 'android') {
26
- await this.androidRequestPermission()
27
- } else if (Platform.OS === 'ios') {
28
- await this.iosRequestPermission()
29
- }
30
- }
31
-
32
- deleteToken = async () => {
33
- await messaging().deleteToken()
34
- }
35
-
36
- iosRequestPermission = async () => {
37
- console.log('[App] onRegister iosRequestPermission')
38
-
39
- try {
40
- if (!messaging().isDeviceRegisteredForRemoteMessages) {
41
- await messaging().registerDeviceForRemoteMessages()
42
- }
43
-
44
- const apnsToken = await messaging().getAPNSToken()
45
- console.log('[App] apns token :' + apnsToken)
46
- if (apnsToken) {
47
- storage.set('apnsToken', apnsToken);
48
- Airbridge.registerPushToken(apnsToken)
49
- }
50
- else {
51
- console.log('[App] apnsToken is null')
52
- }
53
- }
54
- catch (error) {
55
- console.log('[App] ios error::', error)
56
- }
57
- }
58
-
59
- androidRequestPermission = async () => {
60
- console.log('[App] onRegister androidRequestPermission')
61
-
62
- const fcmToken = await messaging().getToken()
63
- if (fcmToken != null) {
64
- storage.set('fcmToken', fcmToken);
65
- Airbridge.registerPushToken(fcmToken)
66
- }
67
- console.log('[App] fcmToken :' + fcmToken)
68
- }
69
-
70
- onMessageReceived = async () => {
71
- const onReceived = async (remoteMessage) => {
72
-
73
- //let remoteMessage =
74
- console.log('[FCM] onMessageReceived: ' + JSON.stringify(remoteMessage))
75
-
76
- // Check if message contains a data payload
77
- if (remoteMessage.data != null) {
78
- console.log("[FCM] Message data payload: " + JSON.stringify(remoteMessage.data))
79
- }
80
- // Check if message contains a notification payload
81
- if (remoteMessage.notification != null) {
82
- console.log("[FCM] Message notification body: " + JSON.stringify(remoteMessage.notification.body))
83
- }
84
- }
85
-
86
- // 활성 상태 및 포그라운드 상태일때 FCM 메시지 수신
87
- const unsubscribe = messaging().onMessage(async remoteMessage => onReceived(remoteMessage));
88
-
89
- // 앱이 종료된 상태일 때 FCM 메시지 수신
90
- messaging().setBackgroundMessageHandler(async remoteMessage => onReceived(remoteMessage));
91
- }
92
- }
93
-
94
- export const fcmService = new FCMService()
@@ -1,39 +0,0 @@
1
- import { NativeModules } from 'react-native'
2
-
3
- export type Native = {
4
- permission: {
5
- android: {
6
- accessFineLocation: () => void
7
- accessCoarseLocation: () => void
8
- }
9
- ios: {
10
- aceessTracking: () => void
11
- }
12
- }
13
- }
14
-
15
- export const createNativeDependency = () => ({
16
- PermissionInteractor: NativeModules.PermissionInteractor,
17
- })
18
-
19
- export const createNative = (): Native => {
20
- const {
21
- PermissionInteractor,
22
- } = createNativeDependency()
23
-
24
- return {
25
- permission: createInteractor(PermissionInteractor),
26
- }
27
- }
28
-
29
- const createInteractor = <Interactor extends object> (interactor: Interactor) => {
30
- return Object.assign(interactor, {
31
- ios: interactor,
32
- android: interactor,
33
- })
34
- }
35
-
36
- // Originally, in order to write Unit-Testable code, the instance should not be exported
37
- // and instead be injected at the createDependency part using the createNative.
38
- // However, since this is a QA app, for convenience, the instance is exported.
39
- export const native = createNative()
@@ -1,13 +0,0 @@
1
- class Storage {
2
- _map = []
3
-
4
- set = (key, object) => {
5
- this._map[key] = object
6
- }
7
-
8
- get = (key) => {
9
- return this._map[key]
10
- }
11
- }
12
-
13
- export const storage = new Storage()
@@ -1,39 +0,0 @@
1
- import { StyleSheet } from 'react-native'
2
- import { Colors } from './Colors'
3
-
4
- export const Styles = StyleSheet.create({
5
- container: {
6
- margin: 16,
7
- },
8
- centeredView: {
9
- flex: 1,
10
- justifyContent: 'center',
11
- alignContent: 'center',
12
- backgroundColor: 'rgba(0, 0, 0, 0.5)'
13
- },
14
- modalView: {
15
- padding: 12,
16
- margin: 16,
17
- backgroundColor: 'white',
18
- borderRadius: 16,
19
- alignItems: 'center',
20
- shadowColor: '#000',
21
- shadowOffset: {
22
- width: 0,
23
- height: 2,
24
- },
25
- shadowOpacity: 0.25,
26
- shadowRadius: 4,
27
- elevation: 5,
28
- },
29
- h2: {
30
- fontWeight: '900',
31
- fontSize: 18,
32
- },
33
- line: {
34
- backgroundColor: Colors.grey,
35
- width:'100%',
36
- borderWidth: 0.5,
37
- margin: 4
38
- }
39
- })
@@ -1,117 +0,0 @@
1
- import React, { Component } from 'react'
2
-
3
- import { View, Modal, Text } from 'react-native'
4
- import { Styles } from '../common/Styles'
5
- import CustomButton from './CustomButton'
6
- import { Colors } from '../common/Colors'
7
-
8
- import AttributeTypeInputDialog from './AttributeTypeInputDialog'
9
- import CustomTextInput from './CustomTextInput'
10
-
11
- export default class AttributeEntryInputDialog extends Component {
12
-
13
- constructor(props) {
14
- super(props)
15
- this.state = {
16
- visible: false,
17
- key: '',
18
- value: '',
19
- type: 'string'
20
- }
21
-
22
- this.typeRef = React.createRef()
23
- }
24
-
25
- show = () => {
26
- this.setState({ visible: true })
27
- }
28
-
29
- close = () => {
30
- this.setState({
31
- visible: false,
32
- key: '',
33
- value: '',
34
- type: 'string'
35
- })
36
- }
37
-
38
- confirm = () => {
39
- if (this.props.onConfirm != null) {
40
- this.props.onConfirm(this.state.key, this.state.value, this.state.type)
41
- }
42
- this.close()
43
- }
44
-
45
- render() {
46
- return (
47
- <Modal
48
- visible={this.state.visible}
49
- transparent={true}>
50
- <View style={Styles.centeredView}>
51
- <View style={Styles.modalView}>
52
- <Text style={ Styles.h2 }>Input Attribute Entry</Text>
53
- <View style={{ margin: 4 }} />
54
- <CustomTextInput
55
- title={'KEY'}
56
- placeholder={'Enter key'}
57
- accessibilityLabel={'key'}
58
- onChangeText={newText => this.setState({ key: newText })}
59
- value={this.state.key} />
60
- <View style={{ margin: 4 }} />
61
- <CustomTextInput
62
- title={'VALUE'}
63
- placeholder={'Enter value'}
64
- accessibilityLabel={'value'}
65
- onChangeText={newText => this.setState({ value: newText })}
66
- value={this.state.value} />
67
- <View style={{ margin: 4 }} />
68
- <CustomTextInput
69
- title={'TYPE'}
70
- placeholder={'Enter type'}
71
- accessibilityLabel={'type'}
72
- onChangeText={newText => this.setState({ type: newText })}
73
- value={this.state.type} />
74
- <View style={{ margin: 4 }} />
75
-
76
- <View style={{
77
- flexDirection: 'row',
78
- alignItems: 'center'
79
- }}>
80
- <Text>Type</Text>
81
- <View style={{ margin: 4 }} />
82
- <View style={{ flex:1 }}>
83
- <CustomButton
84
- style={{flex:8}}
85
- buttonColor={Colors.grey}
86
- title={this.state.type}
87
- titleColor='white'
88
- onPress={() => this.typeRef.current.show()} />
89
- </View>
90
- </View>
91
-
92
- <View style={{ margin: 4 }} />
93
- <View style={{ flexDirection: 'row'}}>
94
- <CustomButton
95
- buttonColor={Colors.deepBlue}
96
- title={'cancel'}
97
- titleColor='white'
98
- accessibilityLabel={'cancel'}
99
- onPress={() => this.close()} />
100
- <View style={{ margin: 4 }} />
101
- <CustomButton
102
- buttonColor={Colors.deepBlue}
103
- title={'save'}
104
- titleColor='white'
105
- accessibilityLabel={'save'}
106
- onPress={() => this.confirm()} />
107
- </View>
108
- </View>
109
-
110
- <AttributeTypeInputDialog
111
- ref={this.typeRef}
112
- onConfirm={(type) => this.setState({type:type})} />
113
- </View>
114
- </Modal>
115
- )
116
- }
117
- }
@@ -1,100 +0,0 @@
1
- import React, { Component } from 'react'
2
- import propTypes from 'prop-types'
3
-
4
- import { View, Modal, Text } from 'react-native'
5
- import { Styles } from '../common/Styles'
6
- import CustomButton from './CustomButton'
7
- import { Colors } from '../common/Colors'
8
-
9
- export default class AttributeTypeInputDialog extends Component {
10
-
11
- constructor(props) {
12
- super(props)
13
- this.state = {
14
- visible: false
15
- }
16
- }
17
-
18
- show = () => {
19
- this.setState({ visible: true })
20
- }
21
-
22
- close = () => {
23
- this.setState({
24
- visible: false
25
- })
26
- }
27
-
28
- confirm = (type) => {
29
- if (this.props.onConfirm != null) {
30
- this.props.onConfirm(type)
31
- }
32
- this.close()
33
- }
34
-
35
- render() {
36
- return (
37
- <Modal
38
- visible={this.state.visible}
39
- transparent={true}>
40
- <View style={Styles.centeredView}>
41
- <View style={Styles.modalView}>
42
- <Text style={ Styles.h2 }>Select attribute type</Text>
43
- <View style={{ margin: 4 }} />
44
- <View style={{width:'100%'}}>
45
- <CustomButton
46
- buttonColor={Colors.grey}
47
- title={'Int'}
48
- titleColor='white'
49
- accessibilityLabel={'int'}
50
- onPress={() => this.confirm('int')} />
51
- <CustomButton
52
- buttonColor={Colors.grey}
53
- title={'Long'}
54
- titleColor='white'
55
- accessibilityLabel={'long'}
56
- onPress={() => this.confirm('long')} />
57
- <CustomButton
58
- buttonColor={Colors.grey}
59
- title={'Float'}
60
- titleColor='white'
61
- accessibilityLabel={'float'}
62
- onPress={() => this.confirm('float')} />
63
- <CustomButton
64
- buttonColor={Colors.grey}
65
- title={'Double'}
66
- titleColor='white'
67
- accessibilityLabel={'double'}
68
- onPress={() => this.confirm('double')} />
69
- <CustomButton
70
- buttonColor={Colors.grey}
71
- title={'Boolean'}
72
- titleColor='white'
73
- accessibilityLabel={'boolean'}
74
- onPress={() => this.confirm('boolean')} />
75
- <CustomButton
76
- buttonColor={Colors.grey}
77
- title={'String'}
78
- titleColor='white'
79
- accessibilityLabel={'string'}
80
- onPress={() => this.confirm('string')} />
81
- </View>
82
-
83
- <View style={{margin: 4}} />
84
-
85
- <CustomButton
86
- buttonColor={Colors.grey}
87
- title={'cancel'}
88
- titleColor='white'
89
- accessibilityLabel={'cancel'}
90
- onPress={() => this.close()} />
91
- </View>
92
- </View>
93
- </Modal>
94
- )
95
- }
96
- }
97
-
98
- AttributeTypeInputDialog.propTypes = {
99
- onConfirm: propTypes.func.isRequired
100
- }
@@ -1,72 +0,0 @@
1
- import React, { Component } from 'react'
2
- import propTypes from 'prop-types'
3
-
4
- import { View, Modal, Text } from 'react-native'
5
- import { Styles } from '../common/Styles'
6
- import CustomButton from './CustomButton'
7
- import { Colors } from '../common/Colors'
8
-
9
- import CustomTextInput from './CustomTextInput'
10
-
11
- export default class ConfirmDialog extends Component {
12
-
13
- constructor(props) {
14
- super(props)
15
- this.state = {
16
- visible: false,
17
- }
18
- }
19
-
20
- show = () => {
21
- this.setState({ visible: true })
22
- }
23
-
24
- close = () => {
25
- this.setState({
26
- visible: false,
27
- value: ''
28
- })
29
- }
30
-
31
- confirm = () => {
32
- if (this.props.onConfirm != null) {
33
- this.props.onConfirm()
34
- }
35
- this.close()
36
- }
37
-
38
- render() {
39
- return (
40
- <Modal
41
- visible={this.state.visible}
42
- transparent={true}>
43
- <View style={Styles.centeredView}>
44
- <View style={Styles.modalView}>
45
- <Text style={ Styles.h2 }>{this.props.message}</Text>
46
- <View style={{ margin: 4 }} />
47
- <View style={{ flexDirection: 'row'}}>
48
- <CustomButton
49
- buttonColor={Colors.grey}
50
- title={'cancel'}
51
- titleColor='white'
52
- accessibilityLabel={'cancel'}
53
- onPress={() => this.close()} />
54
- <View style={{ margin: 4 }} />
55
- <CustomButton
56
- buttonColor={Colors.deepBlue}
57
- title={'ok'}
58
- titleColor='white'
59
- accessibilityLabel={'ok'}
60
- onPress={() => this.confirm()} />
61
- </View>
62
- </View>
63
- </View>
64
- </Modal>
65
- )
66
- }
67
- }
68
-
69
- ConfirmDialog.propTypes = {
70
- message: propTypes.string,
71
- onConfirm: propTypes.func.isRequired
72
- }
@@ -1,50 +0,0 @@
1
- import React, { Component } from 'react'
2
- import {
3
- Pressable,
4
- Text
5
- } from 'react-native'
6
-
7
- export default class CustomButton extends Component{
8
-
9
- constructor(props){
10
- super(props)
11
- }
12
-
13
- render() {
14
- return (
15
- <Pressable
16
- accessibilityLabel={this.props.accessibilityLabel}
17
- style={
18
- {
19
- backgroundColor: this.props.buttonColor,
20
- flexDirection: 'row',
21
- alignItems: 'center',
22
- borderRadius: 8,
23
- paddingHorizontal: 16,
24
- marginVertical: 4,
25
- marginHorizontal: 0,
26
- height: this.props.height ?? 32
27
- }
28
- }
29
- onPress={this.props.onPress}>
30
- <Text
31
- style={{
32
- color: this.props.titleColor,
33
- flex: this.props.arrow ? 1 : 0,
34
- color: '#fff',
35
- fontSize: 14,
36
- }
37
- }>{this.props.title}</Text>
38
- {this.props.arrow == true &&
39
- <Text
40
- style={{
41
- color: this.props.titleColor,
42
- color: '#fff',
43
- fontSize: 14,
44
- }
45
- }>{'>'}</Text>
46
- }
47
- </Pressable>
48
- )
49
- }
50
- }