@momo-kits/calculator-keyboard 0.77.22 → 0.77.24
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/components/KeyButton.tsx +68 -60
- package/index.tsx +232 -239
- package/package.json +1 -1
- package/img/ic_calculator_division.png +0 -0
- package/img/ic_calculator_multiplication_btn.png +0 -0
- package/img/ic_calculator_plus_btn.png +0 -0
- package/img/ic_calculator_remove_btn.png +0 -0
- package/img/ic_calculator_subtraction_btn.png +0 -0
package/components/KeyButton.tsx
CHANGED
|
@@ -1,74 +1,82 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
2
|
+
import {StyleSheet, TouchableOpacity, View, Text} from 'react-native';
|
|
3
|
+
import {
|
|
4
|
+
Colors as ColorCore,
|
|
5
|
+
Image as FastImage,
|
|
6
|
+
scaleSize,
|
|
7
|
+
} from '@momo-kits/foundation';
|
|
8
|
+
import {Source} from 'react-native-fast-image';
|
|
5
9
|
|
|
6
10
|
interface KeyButtonProps {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
width: number;
|
|
11
|
-
height: number;
|
|
12
|
-
tintColor?: string;
|
|
13
|
-
};
|
|
14
|
-
backgroundColor?: string;
|
|
15
|
-
onLongPress?: (text: string) => void;
|
|
11
|
+
text: string;
|
|
12
|
+
icon?: number | Source;
|
|
13
|
+
size?: {
|
|
16
14
|
width: number;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
height: number;
|
|
16
|
+
tintColor?: string;
|
|
17
|
+
};
|
|
18
|
+
backgroundColor?: string;
|
|
19
|
+
onLongPress?: (text: string) => void;
|
|
20
|
+
width: number;
|
|
21
|
+
onPressOut?: () => void;
|
|
22
|
+
onPressIn?: (text: string) => void;
|
|
23
|
+
textStyle?: object;
|
|
20
24
|
}
|
|
21
25
|
|
|
22
26
|
const styles = StyleSheet.create({
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
container: {
|
|
28
|
+
marginVertical: 1.5,
|
|
29
|
+
marginHorizontal: 1.5,
|
|
30
|
+
borderRadius: 8,
|
|
31
|
+
},
|
|
32
|
+
button: {
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
justifyContent: 'center',
|
|
35
|
+
flex: 1,
|
|
36
|
+
borderRadius: 5,
|
|
37
|
+
},
|
|
38
|
+
text: {
|
|
39
|
+
fontSize: scaleSize(24),
|
|
40
|
+
lineHeight: scaleSize(32),
|
|
41
|
+
fontFamily: 'SFProText-Semibold',
|
|
42
|
+
color: ColorCore.black_20,
|
|
43
|
+
},
|
|
34
44
|
});
|
|
35
45
|
|
|
36
46
|
const KeyButton: React.FC<KeyButtonProps> = ({
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
text,
|
|
48
|
+
icon,
|
|
49
|
+
size,
|
|
50
|
+
backgroundColor = ColorCore.black_01,
|
|
51
|
+
onLongPress = () => {},
|
|
52
|
+
width,
|
|
53
|
+
onPressOut = () => {},
|
|
54
|
+
onPressIn = () => {},
|
|
55
|
+
textStyle = {},
|
|
46
56
|
}) => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
);
|
|
52
|
-
} else {
|
|
53
|
-
content = <Text style={textStyle}>{text}</Text>;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const buttonLongPress = () => onLongPress(text);
|
|
57
|
-
const buttonOnPressIn = () => onPressIn(text);
|
|
58
|
-
|
|
59
|
-
return (
|
|
60
|
-
<View
|
|
61
|
-
key={text}
|
|
62
|
-
style={[styles.container, { backgroundColor, width }]}>
|
|
63
|
-
<TouchableOpacity
|
|
64
|
-
onPressIn={buttonOnPressIn}
|
|
65
|
-
onPressOut={onPressOut}
|
|
66
|
-
onLongPress={buttonLongPress}
|
|
67
|
-
style={styles.button}>
|
|
68
|
-
{content}
|
|
69
|
-
</TouchableOpacity>
|
|
70
|
-
</View>
|
|
57
|
+
let content = null;
|
|
58
|
+
if (icon) {
|
|
59
|
+
content = (
|
|
60
|
+
<FastImage tintColor={ColorCore.black_20} source={icon} style={size} />
|
|
71
61
|
);
|
|
62
|
+
} else {
|
|
63
|
+
content = <Text style={[textStyle, styles.text]}>{text}</Text>;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const buttonLongPress = () => onLongPress(text);
|
|
67
|
+
const buttonOnPressIn = () => onPressIn(text);
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<View key={text} style={[styles.container, {backgroundColor, width}]}>
|
|
71
|
+
<TouchableOpacity
|
|
72
|
+
onPressIn={buttonOnPressIn}
|
|
73
|
+
onPressOut={onPressOut}
|
|
74
|
+
onLongPress={buttonLongPress}
|
|
75
|
+
style={styles.button}>
|
|
76
|
+
{content}
|
|
77
|
+
</TouchableOpacity>
|
|
78
|
+
</View>
|
|
79
|
+
);
|
|
72
80
|
};
|
|
73
81
|
|
|
74
|
-
export default KeyButton;
|
|
82
|
+
export default KeyButton;
|
package/index.tsx
CHANGED
|
@@ -1,276 +1,269 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, {useState, useEffect, useRef} from 'react';
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
DeviceEventEmitter,
|
|
4
|
+
Dimensions,
|
|
5
|
+
Keyboard,
|
|
6
|
+
NativeModules,
|
|
7
|
+
StyleSheet,
|
|
8
|
+
View,
|
|
9
|
+
Platform,
|
|
10
10
|
} from 'react-native';
|
|
11
|
-
import {
|
|
11
|
+
import {Keys} from './Keys';
|
|
12
12
|
import Row from './components/Row';
|
|
13
13
|
import KeyButton from './components/KeyButton';
|
|
14
|
-
import {
|
|
14
|
+
import {Colors as ColorCore, scaleSize} from '@momo-kits/foundation';
|
|
15
15
|
|
|
16
16
|
const SEPERATOR_WIDTH = 3;
|
|
17
17
|
const NUMBER_COLUMN = 4;
|
|
18
|
-
const {
|
|
18
|
+
const {width, height} = Dimensions.get('window');
|
|
19
19
|
const BUTTON_WIDTH =
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
((width > 0 ? width : 375) - (NUMBER_COLUMN + 1) * SEPERATOR_WIDTH) /
|
|
21
|
+
NUMBER_COLUMN;
|
|
22
22
|
|
|
23
23
|
const isIphoneX = (): boolean =>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
Platform.OS === 'ios' &&
|
|
25
|
+
!Platform.isPad &&
|
|
26
|
+
!Platform.isTVOS &&
|
|
27
|
+
(height === 812 ||
|
|
28
|
+
width === 812 ||
|
|
29
|
+
height === 896 ||
|
|
30
|
+
width === 896 ||
|
|
31
|
+
width === 844 ||
|
|
32
|
+
height === 844);
|
|
33
33
|
|
|
34
34
|
const styles = StyleSheet.create({
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
35
|
+
eqBtnWrapper: {
|
|
36
|
+
backgroundColor: ColorCore.black_06,
|
|
37
|
+
},
|
|
38
|
+
specialBtnWrapper: {
|
|
39
|
+
backgroundColor: '#FFF',
|
|
40
|
+
},
|
|
41
|
+
normalBtnWrapper: {
|
|
42
|
+
backgroundColor: ColorCore.black_01,
|
|
43
|
+
},
|
|
44
|
+
container: {flex: 1, backgroundColor: ColorCore.black_02},
|
|
45
|
+
keyboardView: {
|
|
46
|
+
flexDirection: 'row',
|
|
47
|
+
flex: 1,
|
|
48
|
+
paddingTop: 2,
|
|
49
|
+
paddingBottom: isIphoneX() ? 36 : 5,
|
|
50
|
+
paddingHorizontal: 1.5,
|
|
51
|
+
},
|
|
52
|
+
textNormal: {
|
|
53
|
+
color: ColorCore.black_17,
|
|
54
|
+
fontSize: scaleSize(24),
|
|
55
|
+
fontWeight: '500',
|
|
56
|
+
},
|
|
57
|
+
textPink: {
|
|
58
|
+
color: ColorCore.black_01,
|
|
59
|
+
fontSize: scaleSize(24),
|
|
60
|
+
fontWeight: 'bold',
|
|
61
|
+
},
|
|
62
|
+
textEqual: {
|
|
63
|
+
color: ColorCore.black_01,
|
|
64
|
+
fontSize: scaleSize(24),
|
|
65
|
+
fontWeight: '600',
|
|
66
|
+
},
|
|
67
67
|
});
|
|
68
68
|
|
|
69
|
-
const {
|
|
69
|
+
const {CalculatorKeyboardModule} = NativeModules;
|
|
70
70
|
|
|
71
|
-
const REMOVE_ICON =
|
|
72
|
-
|
|
71
|
+
const REMOVE_ICON = {
|
|
72
|
+
uri: 'https://cdn.mservice.com.vn/app/icon/kits/chat_back_space.png',
|
|
73
|
+
};
|
|
73
74
|
|
|
74
75
|
const CALCULATOR_BUTTONS = [
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
{ text: '5', icon: null, textStyle: styles.textNormal },
|
|
108
|
-
{ text: '6', icon: null, textStyle: styles.textNormal },
|
|
109
|
-
],
|
|
110
|
-
[
|
|
111
|
-
{ text: '1', icon: null, textStyle: styles.textNormal },
|
|
112
|
-
{ text: '2', icon: null, textStyle: styles.textNormal },
|
|
113
|
-
{ text: '3', icon: null, textStyle: styles.textNormal },
|
|
114
|
-
],
|
|
76
|
+
[
|
|
77
|
+
{
|
|
78
|
+
text: 'AC',
|
|
79
|
+
icon: null,
|
|
80
|
+
backgroundColor: ColorCore.black_06,
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
text: '÷',
|
|
84
|
+
size: {width: 18, height: 18},
|
|
85
|
+
backgroundColor: ColorCore.black_06,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
text: '×',
|
|
89
|
+
size: {width: 14, height: 14},
|
|
90
|
+
backgroundColor: ColorCore.black_06,
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
[
|
|
94
|
+
{text: '7', icon: null},
|
|
95
|
+
{text: '8', icon: null},
|
|
96
|
+
{text: '9', icon: null},
|
|
97
|
+
],
|
|
98
|
+
[
|
|
99
|
+
{text: '4', icon: null},
|
|
100
|
+
{text: '5', icon: null},
|
|
101
|
+
{text: '6', icon: null},
|
|
102
|
+
],
|
|
103
|
+
[
|
|
104
|
+
{text: '1', icon: null},
|
|
105
|
+
{text: '2', icon: null},
|
|
106
|
+
{text: '3', icon: null},
|
|
107
|
+
],
|
|
115
108
|
];
|
|
116
109
|
|
|
117
110
|
interface KeyboardCalculatorProps {
|
|
118
|
-
|
|
111
|
+
onPress?: (key: string) => void;
|
|
119
112
|
}
|
|
120
113
|
|
|
121
|
-
const KeyboardCalculator: React.FC<KeyboardCalculatorProps> = ({
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
114
|
+
const KeyboardCalculator: React.FC<KeyboardCalculatorProps> = ({onPress}) => {
|
|
115
|
+
const [isOnkeyboardIn, setIsOnkeyboardIn] = useState<boolean>(true);
|
|
116
|
+
const keyboardDidShowListener = useRef<any>(null);
|
|
117
|
+
const keyboardDidHideListener = useRef<any>(null);
|
|
125
118
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
119
|
+
useEffect(() => {
|
|
120
|
+
keyboardDidShowListener.current = Keyboard.addListener(
|
|
121
|
+
'keyboardDidShow',
|
|
122
|
+
_keyboardDidShow
|
|
123
|
+
);
|
|
124
|
+
keyboardDidHideListener.current = Keyboard.addListener(
|
|
125
|
+
'keyboardDidHide',
|
|
126
|
+
_keyboardDidHide
|
|
127
|
+
);
|
|
135
128
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
129
|
+
return () => {
|
|
130
|
+
keyboardDidShowListener.current?.remove();
|
|
131
|
+
keyboardDidHideListener.current?.remove();
|
|
132
|
+
};
|
|
133
|
+
}, []);
|
|
141
134
|
|
|
142
|
-
|
|
135
|
+
const _keyboardDidHide = () => {};
|
|
143
136
|
|
|
144
|
-
|
|
137
|
+
const _keyboardDidShow = () => {};
|
|
145
138
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
139
|
+
const onLongPressKeyboardBtn = (keyType: string) => {
|
|
140
|
+
if (keyType === 'REMOVE') {
|
|
141
|
+
autoBackSpace(keyType);
|
|
142
|
+
} else {
|
|
143
|
+
if (typeof onPress === 'function') {
|
|
144
|
+
onPress(keyType);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
};
|
|
155
148
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
149
|
+
const autoBackSpace = (keyType: string) => {
|
|
150
|
+
if (isOnkeyboardIn) {
|
|
151
|
+
onPressIn(keyType);
|
|
152
|
+
setTimeout(() => {
|
|
153
|
+
autoBackSpace(keyType);
|
|
154
|
+
}, 200);
|
|
155
|
+
}
|
|
156
|
+
};
|
|
164
157
|
|
|
165
|
-
|
|
166
|
-
|
|
158
|
+
const onPressIn = (txt: string) => {
|
|
159
|
+
setIsOnkeyboardIn(true);
|
|
167
160
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
if (txt === 'REMOVE') {
|
|
180
|
-
CalculatorKeyboardModule.backSpace();
|
|
181
|
-
} else if (txt === 'AC') {
|
|
182
|
-
CalculatorKeyboardModule.doDelete();
|
|
183
|
-
} else if (txt === 'CLOSE') {
|
|
184
|
-
DeviceEventEmitter.emit(Keys.CALCULATOR_DISMISS);
|
|
185
|
-
} else if (txt === '=') {
|
|
186
|
-
DeviceEventEmitter.emit(Keys.CALCULATOR_CALCULATE);
|
|
187
|
-
} else {
|
|
188
|
-
CalculatorKeyboardModule.insertText(txt);
|
|
189
|
-
}
|
|
190
|
-
};
|
|
161
|
+
if (
|
|
162
|
+
txt === '+' ||
|
|
163
|
+
txt === '-' ||
|
|
164
|
+
txt === '×' ||
|
|
165
|
+
txt === '÷' ||
|
|
166
|
+
txt === 'REMOVE' ||
|
|
167
|
+
txt === 'AC' ||
|
|
168
|
+
txt === '='
|
|
169
|
+
)
|
|
170
|
+
DeviceEventEmitter.emit(Keys.CALULATOR_PUSH_KEY, txt);
|
|
191
171
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}
|
|
172
|
+
if (txt === 'REMOVE') {
|
|
173
|
+
CalculatorKeyboardModule.backSpace();
|
|
174
|
+
} else if (txt === 'AC') {
|
|
175
|
+
CalculatorKeyboardModule.doDelete();
|
|
176
|
+
} else if (txt === 'CLOSE') {
|
|
177
|
+
DeviceEventEmitter.emit(Keys.CALCULATOR_DISMISS);
|
|
178
|
+
} else if (txt === '=') {
|
|
179
|
+
DeviceEventEmitter.emit(Keys.CALCULATOR_CALCULATE);
|
|
180
|
+
} else {
|
|
181
|
+
CalculatorKeyboardModule.insertText(txt);
|
|
182
|
+
}
|
|
183
|
+
};
|
|
195
184
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
185
|
+
const onPressOut = () => {
|
|
186
|
+
setIsOnkeyboardIn(false);
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
const renderBtn = (params: any) => (
|
|
190
|
+
<KeyButton
|
|
191
|
+
key={params.text}
|
|
192
|
+
onPressIn={onPressIn}
|
|
193
|
+
onPressOut={onPressOut}
|
|
194
|
+
onLongPress={onLongPressKeyboardBtn}
|
|
195
|
+
width={BUTTON_WIDTH}
|
|
196
|
+
{...params}
|
|
197
|
+
/>
|
|
198
|
+
);
|
|
206
199
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
</View>
|
|
259
|
-
<View style={{ flex: 0.4 }}>
|
|
260
|
-
<Row>
|
|
261
|
-
{renderBtn({
|
|
262
|
-
width: BUTTON_WIDTH,
|
|
263
|
-
text: '=',
|
|
264
|
-
backgroundColor: ColorCore.pink_03,
|
|
265
|
-
textStyle: styles.textEqual,
|
|
266
|
-
})}
|
|
267
|
-
</Row>
|
|
268
|
-
</View>
|
|
269
|
-
</View>
|
|
200
|
+
const renderContent = () => (
|
|
201
|
+
<View style={styles.keyboardView}>
|
|
202
|
+
<View style={{width: BUTTON_WIDTH * 3 + 2 * SEPERATOR_WIDTH}}>
|
|
203
|
+
<Row>{CALCULATOR_BUTTONS[0].map(renderBtn)}</Row>
|
|
204
|
+
<Row>{CALCULATOR_BUTTONS[1].map(renderBtn)}</Row>
|
|
205
|
+
<Row>{CALCULATOR_BUTTONS[2].map(renderBtn)}</Row>
|
|
206
|
+
<Row>{CALCULATOR_BUTTONS[3].map(renderBtn)}</Row>
|
|
207
|
+
<Row>
|
|
208
|
+
{renderBtn({
|
|
209
|
+
width: BUTTON_WIDTH * 2 + 3,
|
|
210
|
+
text: '000',
|
|
211
|
+
textStyle: styles.textNormal,
|
|
212
|
+
})}
|
|
213
|
+
{renderBtn({
|
|
214
|
+
width: BUTTON_WIDTH,
|
|
215
|
+
text: '0',
|
|
216
|
+
textStyle: styles.textNormal,
|
|
217
|
+
})}
|
|
218
|
+
</Row>
|
|
219
|
+
</View>
|
|
220
|
+
<View style={{width: BUTTON_WIDTH, marginLeft: 3}}>
|
|
221
|
+
<View style={{flex: 0.6}}>
|
|
222
|
+
<Row>
|
|
223
|
+
{renderBtn({
|
|
224
|
+
width: BUTTON_WIDTH,
|
|
225
|
+
text: 'REMOVE',
|
|
226
|
+
backgroundColor: ColorCore.black_06,
|
|
227
|
+
icon: REMOVE_ICON,
|
|
228
|
+
size: {
|
|
229
|
+
width: 24,
|
|
230
|
+
height: 24,
|
|
231
|
+
tintColor: ColorCore.black_20,
|
|
232
|
+
},
|
|
233
|
+
})}
|
|
234
|
+
</Row>
|
|
235
|
+
<Row>
|
|
236
|
+
{renderBtn({
|
|
237
|
+
width: BUTTON_WIDTH,
|
|
238
|
+
text: '-',
|
|
239
|
+
backgroundColor: ColorCore.black_06,
|
|
240
|
+
textStyle: styles.textPink,
|
|
241
|
+
})}
|
|
242
|
+
</Row>
|
|
243
|
+
<Row>
|
|
244
|
+
{renderBtn({
|
|
245
|
+
width: BUTTON_WIDTH,
|
|
246
|
+
text: '+',
|
|
247
|
+
backgroundColor: ColorCore.black_06,
|
|
248
|
+
textStyle: styles.textPink,
|
|
249
|
+
})}
|
|
250
|
+
</Row>
|
|
270
251
|
</View>
|
|
271
|
-
|
|
252
|
+
<View style={{flex: 0.4}}>
|
|
253
|
+
<Row>
|
|
254
|
+
{renderBtn({
|
|
255
|
+
width: BUTTON_WIDTH,
|
|
256
|
+
text: '=',
|
|
257
|
+
backgroundColor: ColorCore.black_06,
|
|
258
|
+
textStyle: styles.textEqual,
|
|
259
|
+
})}
|
|
260
|
+
</Row>
|
|
261
|
+
</View>
|
|
262
|
+
</View>
|
|
263
|
+
</View>
|
|
264
|
+
);
|
|
272
265
|
|
|
273
|
-
|
|
266
|
+
return <View style={styles.container}>{renderContent()}</View>;
|
|
274
267
|
};
|
|
275
268
|
|
|
276
|
-
export default KeyboardCalculator;
|
|
269
|
+
export default KeyboardCalculator;
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|