Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit 0c8dbc7

Browse files
authored
Merge pull request #509 from lightninglabs/prop-types
Fix prop types for react native 0.55.4
2 parents 8e97a93 + c7e43c1 commit 0c8dbc7

File tree

16 files changed

+61
-73
lines changed

16 files changed

+61
-73
lines changed

src/component/background.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { View, StyleSheet, ImageBackground, ViewPropTypes } from 'react-native';
2+
import { View, StyleSheet, ImageBackground } from 'react-native';
33
import PropTypes from 'prop-types';
44

55
//
@@ -30,7 +30,7 @@ Background.propTypes = {
3030
image: PropTypes.string,
3131
color: PropTypes.string,
3232
children: PropTypes.node,
33-
style: ViewPropTypes.style,
33+
style: View.propTypes.style,
3434
};
3535

3636
//
@@ -66,7 +66,7 @@ SplitBackground.propTypes = {
6666
color: PropTypes.string,
6767
bottom: PropTypes.string,
6868
children: PropTypes.node,
69-
style: ViewPropTypes.style,
69+
style: View.propTypes.style,
7070
};
7171

7272
export default Background;

src/component/button.js

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import React from 'react';
22
import {
33
View,
44
TouchableOpacity,
5-
ViewPropTypes,
6-
TextPropTypes,
5+
Text as RNText,
76
StyleSheet,
87
} from 'react-native';
98
import PropTypes from 'prop-types';
@@ -38,7 +37,7 @@ Button.propTypes = {
3837
onPress: PropTypes.func.isRequired,
3938
disabled: PropTypes.bool,
4039
children: PropTypes.node,
41-
style: ViewPropTypes.style,
40+
style: View.propTypes.style,
4241
};
4342

4443
//
@@ -58,7 +57,7 @@ export const ButtonText = ({ children, style }) => (
5857

5958
ButtonText.propTypes = {
6059
children: PropTypes.string.isRequired,
61-
style: TextPropTypes.style,
60+
style: RNText.propTypes.style,
6261
};
6362

6463
//
@@ -98,7 +97,7 @@ GlasButton.propTypes = {
9897
onPress: PropTypes.func.isRequired,
9998
disabled: PropTypes.bool,
10099
children: PropTypes.string.isRequired,
101-
style: ViewPropTypes.style,
100+
style: View.propTypes.style,
102101
};
103102

104103
//
@@ -134,7 +133,7 @@ PillButton.propTypes = {
134133
onPress: PropTypes.func.isRequired,
135134
disabled: PropTypes.bool,
136135
children: PropTypes.string.isRequired,
137-
style: ViewPropTypes.style,
136+
style: View.propTypes.style,
138137
};
139138

140139
//
@@ -209,7 +208,7 @@ SmallButton.propTypes = {
209208
border: PropTypes.bool,
210209
alert: PropTypes.string,
211210
children: PropTypes.node,
212-
style: ViewPropTypes.style,
211+
style: View.propTypes.style,
213212
};
214213

215214
//
@@ -255,7 +254,7 @@ SmallPillButton.propTypes = {
255254
text: PropTypes.string,
256255
onPress: PropTypes.func.isRequired,
257256
disabled: PropTypes.bool,
258-
style: ViewPropTypes.style,
257+
style: View.propTypes.style,
259258
};
260259

261260
//
@@ -278,7 +277,7 @@ export const BackButton = ({ onPress, disabled, style }) => (
278277
BackButton.propTypes = {
279278
onPress: PropTypes.func,
280279
disabled: PropTypes.bool,
281-
style: ViewPropTypes.style,
280+
style: View.propTypes.style,
282281
};
283282

284283
//
@@ -301,7 +300,7 @@ export const CancelButton = ({ onPress, disabled, style }) => (
301300
CancelButton.propTypes = {
302301
onPress: PropTypes.func,
303302
disabled: PropTypes.bool,
304-
style: ViewPropTypes.style,
303+
style: View.propTypes.style,
305304
};
306305

307306
//
@@ -339,7 +338,7 @@ export const QrButton = ({ onPress, disabled, style, children }) => (
339338
QrButton.propTypes = {
340339
onPress: PropTypes.func.isRequired,
341340
disabled: PropTypes.bool,
342-
style: ViewPropTypes.style,
341+
style: View.propTypes.style,
343342
children: PropTypes.string,
344343
};
345344

@@ -368,7 +367,7 @@ export const DownButton = ({ onPress, disabled, style, children }) => (
368367
DownButton.propTypes = {
369368
onPress: PropTypes.func,
370369
disabled: PropTypes.bool,
371-
style: ViewPropTypes.style,
370+
style: View.propTypes.style,
372371
children: PropTypes.string,
373372
};
374373

@@ -419,7 +418,7 @@ CopyButton.propTypes = {
419418
onPress: PropTypes.func,
420419
icon: PropTypes.string,
421420
children: PropTypes.string,
422-
style: ViewPropTypes.style,
421+
style: View.propTypes.style,
423422
};
424423

425424
//

src/component/card.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { View, ViewPropTypes, StyleSheet } from 'react-native';
2+
import { View, StyleSheet } from 'react-native';
33
import PropTypes from 'prop-types';
44
import { color } from './style';
55

@@ -22,7 +22,7 @@ const Card = ({ children, style }) => (
2222

2323
Card.propTypes = {
2424
children: PropTypes.node,
25-
style: ViewPropTypes.style,
25+
style: View.propTypes.style,
2626
};
2727

2828
export default Card;

src/component/container.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { View, ViewPropTypes, StyleSheet } from 'react-native';
2+
import { View, StyleSheet } from 'react-native';
33
import PropTypes from 'prop-types';
44

55
const styles = StyleSheet.create({
@@ -15,7 +15,7 @@ const Container = ({ children, style }) => (
1515

1616
Container.propTypes = {
1717
children: PropTypes.node,
18-
style: ViewPropTypes.style,
18+
style: View.propTypes.style,
1919
};
2020

2121
export default Container;

src/component/field.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { TextPropTypes, ViewPropTypes, StyleSheet, View } from 'react-native';
2+
import { Text as RNText, StyleSheet, View } from 'react-native';
33
import PropTypes from 'prop-types';
44
import Text from './text';
55
import { TextInput, HorizontalExpandingTextInput } from './input';
@@ -29,7 +29,7 @@ export const AmountInputField = ({ style, ...props }) => (
2929
);
3030

3131
AmountInputField.propTypes = {
32-
style: TextPropTypes.style,
32+
style: RNText.propTypes.style,
3333
};
3434

3535
//
@@ -50,7 +50,7 @@ export const InputField = ({ style, ...props }) => (
5050

5151
InputField.propTypes = {
5252
children: PropTypes.string,
53-
style: TextPropTypes.style,
53+
style: RNText.propTypes.style,
5454
};
5555

5656
//
@@ -93,7 +93,7 @@ export const NamedField = ({ name, children, style }) => (
9393
NamedField.propTypes = {
9494
name: PropTypes.string,
9595
children: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
96-
style: ViewPropTypes.style,
96+
style: View.propTypes.style,
9797
};
9898

9999
//
@@ -130,5 +130,5 @@ export const DetailField = ({ name, children, style }) => (
130130
DetailField.propTypes = {
131131
name: PropTypes.string,
132132
children: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
133-
style: ViewPropTypes.style,
133+
style: View.propTypes.style,
134134
};

src/component/form.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { View, TextPropTypes, ViewPropTypes, StyleSheet } from 'react-native';
2+
import { View, Text as RNText, StyleSheet } from 'react-native';
33
import PropTypes from 'prop-types';
44
import Text from './text';
55
import { color, font } from './style';
@@ -25,7 +25,7 @@ export const FormStretcher = ({ children, style }) => (
2525

2626
FormStretcher.propTypes = {
2727
children: PropTypes.node,
28-
style: ViewPropTypes.style,
28+
style: View.propTypes.style,
2929
};
3030

3131
//
@@ -46,7 +46,7 @@ export const FormText = ({ children, style }) => (
4646

4747
FormText.propTypes = {
4848
children: PropTypes.string,
49-
style: TextPropTypes.style,
49+
style: RNText.propTypes.style,
5050
};
5151

5252
//
@@ -68,5 +68,5 @@ export const FormSubText = ({ children, style }) => (
6868

6969
FormSubText.propTypes = {
7070
children: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
71-
style: TextPropTypes.style,
71+
style: RNText.propTypes.style,
7272
};

src/component/header.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { View, ViewPropTypes, StyleSheet } from 'react-native';
2+
import { View, StyleSheet } from 'react-native';
33
import PropTypes from 'prop-types';
44
import Text from './text';
55
import { color } from './style';
@@ -43,7 +43,7 @@ export const Header = ({ style, children, color, shadow, separator }) => (
4343
);
4444

4545
Header.propTypes = {
46-
style: ViewPropTypes.style,
46+
style: View.propTypes.style,
4747
children: PropTypes.node,
4848
color: PropTypes.string,
4949
shadow: PropTypes.bool,
@@ -86,7 +86,7 @@ export const Title = ({ title = '', style, children }) => (
8686

8787
Title.propTypes = {
8888
title: PropTypes.string,
89-
style: ViewPropTypes.style,
89+
style: View.propTypes.style,
9090
children: PropTypes.node,
9191
};
9292

src/component/icon.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { Image, ViewPropTypes } from 'react-native';
2+
import { Image, View } from 'react-native';
33
import PropTypes from 'prop-types';
44

55
const Icon = ({ image, style }) => (
@@ -8,7 +8,7 @@ const Icon = ({ image, style }) => (
88

99
Icon.propTypes = {
1010
image: PropTypes.string.isRequired,
11-
style: ViewPropTypes.style,
11+
style: View.propTypes.style,
1212
};
1313

1414
export default Icon;

src/component/input.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { Component } from 'react';
22
import {
33
TextInput as RNTextInput,
4-
TextPropTypes,
4+
Text as RNText,
55
StyleSheet,
66
} from 'react-native';
77
import PropTypes from 'prop-types';
@@ -33,7 +33,7 @@ export const TextInput = ({ style, ...props }) => (
3333
);
3434

3535
TextInput.propTypes = {
36-
style: TextPropTypes.style,
36+
style: RNText.propTypes.style,
3737
};
3838

3939
//
@@ -73,7 +73,7 @@ HorizontalExpandingTextInput.propTypes = {
7373
value: PropTypes.string,
7474
charWidth: PropTypes.number.isRequired,
7575
onChangeText: PropTypes.func,
76-
style: TextPropTypes.style,
76+
style: RNText.propTypes.style,
7777
};
7878

7979
export default TextInput;

src/component/label.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { View, ViewPropTypes, TextPropTypes, StyleSheet } from 'react-native';
2+
import { View, Text as RNText, StyleSheet } from 'react-native';
33
import PropTypes from 'prop-types';
44
import Text from './text';
55
import { font } from './style';
@@ -31,7 +31,7 @@ export const BalanceLabel = ({ children, style }) => (
3131

3232
BalanceLabel.propTypes = {
3333
children: PropTypes.node.isRequired,
34-
style: ViewPropTypes.style,
34+
style: View.propTypes.style,
3535
};
3636

3737
export const BalanceLabelNumeral = ({ children, style }) => (
@@ -40,15 +40,15 @@ export const BalanceLabelNumeral = ({ children, style }) => (
4040

4141
BalanceLabelNumeral.propTypes = {
4242
children: PropTypes.string.isRequired,
43-
style: TextPropTypes.style,
43+
style: RNText.propTypes.style,
4444
};
4545

4646
export const BalanceLabelUnit = ({ children, style }) =>
4747
children ? <Text style={[balanceStyles.unit, style]}>{children}</Text> : null;
4848

4949
BalanceLabelUnit.propTypes = {
5050
children: PropTypes.string,
51-
style: TextPropTypes.style,
51+
style: RNText.propTypes.style,
5252
};
5353

5454
//
@@ -82,5 +82,5 @@ export const SmallBalanceLabel = ({ children, unit, style }) => (
8282
SmallBalanceLabel.propTypes = {
8383
children: PropTypes.string.isRequired,
8484
unit: PropTypes.string,
85-
style: TextPropTypes.style,
85+
style: RNText.propTypes.style,
8686
};

0 commit comments

Comments
 (0)