react-native-flyy 1.4.21 → 1.4.22

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.
@@ -3,13 +3,156 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = void 0;
6
+ exports.FlyyWidget = exports.default = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
7
9
 
8
10
  var _reactNative = require("react-native");
9
11
 
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
10
14
  const {
11
15
  Flyy
12
16
  } = _reactNative.NativeModules;
13
17
  var _default = Flyy;
14
18
  exports.default = _default;
19
+
20
+ const FlyyWidget = ({
21
+ widgetStyle = {
22
+ rewardsButtonIcon: require('./assets/images/rewardwidget.png'),
23
+ offersButtonIcon: require('./assets/images/offerswidget.png'),
24
+ walletButtonIcon: require('./assets/images/walletwidget.png'),
25
+ rewardButtonTitle: 'Rewards',
26
+ offerButtonTitle: 'Offers',
27
+ walletButtonTitle: 'Wallet',
28
+ buttonTitleFontFamily: 'Montserrat-Bold',
29
+ buttonBorderWidth: 0.5,
30
+ buttonTitleTextSize: 16.0,
31
+ iconCornerRadius: 30.0,
32
+ buttonCornerRadius: 15.0,
33
+ buttonTitleTextColor: 'black',
34
+ buttonBorderColor: 'white',
35
+ containerBackgroundColor: '#ebedeb',
36
+ buttonIconBackgroundColor: '#654EA3',
37
+ buttonBackgroundColor: 'white'
38
+ }
39
+ }) => {
40
+ var _widgetStyle$buttonBa, _widgetStyle$buttonCo, _widgetStyle$buttonBo, _widgetStyle$buttonBo2, _widgetStyle$containe, _widgetStyle$offerBut, _widgetStyle$offersBu, _widgetStyle$rewardBu, _widgetStyle$rewardsB, _widgetStyle$walletBu, _widgetStyle$walletBu2;
41
+
42
+ const buttonStyle = {
43
+ backgroundColor: (_widgetStyle$buttonBa = widgetStyle.buttonBackgroundColor) !== null && _widgetStyle$buttonBa !== void 0 ? _widgetStyle$buttonBa : 'white',
44
+ height: 110,
45
+ flex: 1,
46
+ elevation: 1,
47
+ borderRadius: (_widgetStyle$buttonCo = widgetStyle.buttonCornerRadius) !== null && _widgetStyle$buttonCo !== void 0 ? _widgetStyle$buttonCo : 15.0,
48
+ borderColor: (_widgetStyle$buttonBo = widgetStyle.buttonBorderColor) !== null && _widgetStyle$buttonBo !== void 0 ? _widgetStyle$buttonBo : 'white',
49
+ borderWidth: (_widgetStyle$buttonBo2 = widgetStyle.buttonBorderWidth) !== null && _widgetStyle$buttonBo2 !== void 0 ? _widgetStyle$buttonBo2 : 0.5
50
+ };
51
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
52
+ style: {
53
+ backgroundColor: (_widgetStyle$containe = widgetStyle.containerBackgroundColor) !== null && _widgetStyle$containe !== void 0 ? _widgetStyle$containe : '#ebedeb',
54
+ height: 160,
55
+ width: '100%',
56
+ flexDirection: 'row',
57
+ justifyContent: 'center',
58
+ alignItems: 'center'
59
+ }
60
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
61
+ style: {
62
+ width: 20
63
+ }
64
+ }), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
65
+ onPress: () => {
66
+ Flyy.openOffersScreen();
67
+ },
68
+ style: buttonStyle
69
+ }, /*#__PURE__*/_react.default.createElement(FlyyCardView, {
70
+ cardStyle: widgetStyle,
71
+ buttonTitle: (_widgetStyle$offerBut = widgetStyle.offerButtonTitle) !== null && _widgetStyle$offerBut !== void 0 ? _widgetStyle$offerBut : 'Offers',
72
+ buttonIcon: (_widgetStyle$offersBu = widgetStyle.offersButtonIcon) !== null && _widgetStyle$offersBu !== void 0 ? _widgetStyle$offersBu : require('./assets/images/offerswidget.png')
73
+ })), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
74
+ style: {
75
+ width: 15
76
+ }
77
+ }), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
78
+ onPress: () => {
79
+ Flyy.openRewardsScreen();
80
+ },
81
+ style: buttonStyle
82
+ }, /*#__PURE__*/_react.default.createElement(FlyyCardView, {
83
+ cardStyle: widgetStyle,
84
+ buttonTitle: (_widgetStyle$rewardBu = widgetStyle.rewardButtonTitle) !== null && _widgetStyle$rewardBu !== void 0 ? _widgetStyle$rewardBu : 'Rewards',
85
+ buttonIcon: (_widgetStyle$rewardsB = widgetStyle.rewardsButtonIcon) !== null && _widgetStyle$rewardsB !== void 0 ? _widgetStyle$rewardsB : require('./assets/images/rewardwidget.png')
86
+ })), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
87
+ style: {
88
+ width: 15
89
+ }
90
+ }), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
91
+ onPress: () => {
92
+ Flyy.openWalletScreen();
93
+ },
94
+ style: buttonStyle
95
+ }, /*#__PURE__*/_react.default.createElement(FlyyCardView, {
96
+ cardStyle: widgetStyle,
97
+ buttonTitle: (_widgetStyle$walletBu = widgetStyle.walletButtonTitle) !== null && _widgetStyle$walletBu !== void 0 ? _widgetStyle$walletBu : 'Wallet',
98
+ buttonIcon: (_widgetStyle$walletBu2 = widgetStyle.walletButtonIcon) !== null && _widgetStyle$walletBu2 !== void 0 ? _widgetStyle$walletBu2 : require('./assets/images/walletwidget.png')
99
+ })), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
100
+ style: {
101
+ width: 20
102
+ }
103
+ }));
104
+ }; // @ts-ignore
105
+
106
+
107
+ exports.FlyyWidget = FlyyWidget;
108
+
109
+ const FlyyCardView = ({
110
+ cardStyle,
111
+ buttonTitle,
112
+ buttonIcon
113
+ }) => {
114
+ var _cardStyle$buttonIcon, _cardStyle$iconCorner, _cardStyle$buttonTitl, _cardStyle$buttonTitl2;
115
+
116
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, null, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
117
+ style: {
118
+ height: 10
119
+ }
120
+ }), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
121
+ style: {
122
+ backgroundColor: (_cardStyle$buttonIcon = cardStyle.buttonIconBackgroundColor) !== null && _cardStyle$buttonIcon !== void 0 ? _cardStyle$buttonIcon : '#654EA3',
123
+ height: 50,
124
+ width: 50,
125
+ borderRadius: (_cardStyle$iconCorner = cardStyle.iconCornerRadius) !== null && _cardStyle$iconCorner !== void 0 ? _cardStyle$iconCorner : 30.0,
126
+ alignSelf: 'center',
127
+ justifyContent: 'center',
128
+ alignItems: 'center'
129
+ }
130
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
131
+ source: buttonIcon,
132
+ style: {
133
+ height: 28,
134
+ width: 28
135
+ }
136
+ })), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
137
+ style: {
138
+ height: 10
139
+ }
140
+ }), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
141
+ style: {
142
+ alignSelf: 'center',
143
+ flexShrink: 1,
144
+ color: (_cardStyle$buttonTitl = cardStyle.buttonTitleTextColor) !== null && _cardStyle$buttonTitl !== void 0 ? _cardStyle$buttonTitl : 'black',
145
+ fontSize: cardStyle.buttonTitleTextSize != null ? cardStyle.buttonTitleTextSize < 30 ? cardStyle.buttonTitleTextSize : 30 : 16,
146
+ fontFamily: (_cardStyle$buttonTitl2 = cardStyle.buttonTitleFontFamily) !== null && _cardStyle$buttonTitl2 !== void 0 ? _cardStyle$buttonTitl2 : 'Montserrat-Bold',
147
+ textAlign: 'center',
148
+ paddingLeft: 5,
149
+ paddingRight: 5
150
+ },
151
+ numberOfLines: 1
152
+ }, buttonTitle), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
153
+ style: {
154
+ height: 10
155
+ }
156
+ }));
157
+ };
15
158
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.tsx"],"names":["Flyy","NativeModules"],"mappings":";;;;;;;AAAA;;AAMA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,0BAAjB;eAEeD,I","sourcesContent":["import { NativeModules } from 'react-native';\n\ntype FlyyType = {\n multiply(a: number, b: number): Promise<number>;\n};\n\nconst { Flyy } = NativeModules;\n\nexport default Flyy as FlyyType;\n"]}
1
+ {"version":3,"sources":["index.tsx"],"names":["Flyy","NativeModules","FlyyWidget","widgetStyle","rewardsButtonIcon","require","offersButtonIcon","walletButtonIcon","rewardButtonTitle","offerButtonTitle","walletButtonTitle","buttonTitleFontFamily","buttonBorderWidth","buttonTitleTextSize","iconCornerRadius","buttonCornerRadius","buttonTitleTextColor","buttonBorderColor","containerBackgroundColor","buttonIconBackgroundColor","buttonBackgroundColor","buttonStyle","backgroundColor","height","flex","elevation","borderRadius","borderColor","borderWidth","width","flexDirection","justifyContent","alignItems","openOffersScreen","openRewardsScreen","openWalletScreen","FlyyCardView","cardStyle","buttonTitle","buttonIcon","alignSelf","flexShrink","color","fontSize","fontFamily","textAlign","paddingLeft","paddingRight"],"mappings":";;;;;;;AAAA;;AACA;;;;AAYA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,0BAAjB;eAEeD,I;;;AACR,MAAME,UAAU,GAAG,CAAC;AACzBC,EAAAA,WAAW,GAAG;AACZC,IAAAA,iBAAiB,EAAEC,OAAO,CAAC,kCAAD,CADd;AAEZC,IAAAA,gBAAgB,EAAED,OAAO,CAAC,kCAAD,CAFb;AAGZE,IAAAA,gBAAgB,EAAEF,OAAO,CAAC,kCAAD,CAHb;AAIZG,IAAAA,iBAAiB,EAAE,SAJP;AAKZC,IAAAA,gBAAgB,EAAE,QALN;AAMZC,IAAAA,iBAAiB,EAAE,QANP;AAOZC,IAAAA,qBAAqB,EAAE,iBAPX;AAQZC,IAAAA,iBAAiB,EAAE,GARP;AASZC,IAAAA,mBAAmB,EAAE,IATT;AAUZC,IAAAA,gBAAgB,EAAE,IAVN;AAWZC,IAAAA,kBAAkB,EAAE,IAXR;AAYZC,IAAAA,oBAAoB,EAAE,OAZV;AAaZC,IAAAA,iBAAiB,EAAE,OAbP;AAcZC,IAAAA,wBAAwB,EAAE,SAdd;AAeZ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native';\n\ntype FlyyType = {\n multiply(a: number, b: number): Promise<number>;\n};\n\nconst { Flyy } = NativeModules;\n\nexport default Flyy as FlyyType;\nexport const FlyyWidget = ({\n widgetStyle = {\n rewardsButtonIcon: require('./assets/images/rewardwidget.png'),\n offersButtonIcon: require('./assets/images/offerswidget.png'),\n walletButtonIcon: require('./assets/images/walletwidget.png'),\n rewardButtonTitle: 'Rewards',\n offerButtonTitle: 'Offers',\n walletButtonTitle: 'Wallet',\n buttonTitleFontFamily: 'Montserrat-Bold',\n buttonBorderWidth: 0.5,\n buttonTitleTextSize: 16.0,\n iconCornerRadius: 30.0,\n buttonCornerRadius: 15.0,\n buttonTitleTextColor: 'black',\n buttonBorderColor: 'white',\n containerBackgroundColor: '#ebedeb',\n buttonIconBackgroundColor: '#654EA3',\n buttonBackgroundColor: 'white',\n },\n}) => {\n const buttonStyle = {\n backgroundColor: widgetStyle.buttonBackgroundColor ?? 'white',\n height: 110,\n flex: 1,\n elevation: 1,\n borderRadius: widgetStyle.buttonCornerRadius ?? 15.0,\n borderColor: widgetStyle.buttonBorderColor ?? 'white',\n borderWidth: widgetStyle.buttonBorderWidth ?? 0.5,\n };\n return (\n <View\n style={{\n backgroundColor: widgetStyle.containerBackgroundColor ?? '#ebedeb',\n height: 160,\n width: '100%',\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n }}\n >\n <View style={{ width: 20 }} />\n <TouchableOpacity\n onPress={() => {\n Flyy.openOffersScreen();\n }}\n style={buttonStyle}\n >\n <FlyyCardView\n cardStyle={widgetStyle}\n buttonTitle={widgetStyle.offerButtonTitle ?? 'Offers'}\n buttonIcon={\n widgetStyle.offersButtonIcon ??\n require('./assets/images/offerswidget.png')\n }\n />\n </TouchableOpacity>\n <View style={{ width: 15 }} />\n <TouchableOpacity\n onPress={() => {\n Flyy.openRewardsScreen();\n }}\n style={buttonStyle}\n >\n <FlyyCardView\n cardStyle={widgetStyle}\n buttonTitle={widgetStyle.rewardButtonTitle ?? 'Rewards'}\n buttonIcon={\n widgetStyle.rewardsButtonIcon ??\n require('./assets/images/rewardwidget.png')\n }\n />\n </TouchableOpacity>\n <View style={{ width: 15 }} />\n <TouchableOpacity\n onPress={() => {\n Flyy.openWalletScreen();\n }}\n style={buttonStyle}\n >\n <FlyyCardView\n cardStyle={widgetStyle}\n buttonTitle={widgetStyle.walletButtonTitle ?? 'Wallet'}\n buttonIcon={\n widgetStyle.walletButtonIcon ??\n require('./assets/images/walletwidget.png')\n }\n />\n </TouchableOpacity>\n <View style={{ width: 20 }} />\n </View>\n );\n};\n\n// @ts-ignore\nconst FlyyCardView = ({ cardStyle, buttonTitle, buttonIcon }) => {\n return (\n <View>\n <View style={{ height: 10 }} />\n <View\n style={{\n backgroundColor: cardStyle.buttonIconBackgroundColor ?? '#654EA3',\n height: 50,\n width: 50,\n borderRadius: cardStyle.iconCornerRadius ?? 30.0,\n alignSelf: 'center',\n justifyContent: 'center',\n alignItems: 'center',\n }}\n >\n <Image source={buttonIcon} style={{ height: 28, width: 28 }} />\n </View>\n <View style={{ height: 10 }} />\n <Text\n style={{\n alignSelf: 'center',\n flexShrink: 1,\n color: cardStyle.buttonTitleTextColor ?? 'black',\n fontSize:\n cardStyle.buttonTitleTextSize != null\n ? cardStyle.buttonTitleTextSize < 30\n ? cardStyle.buttonTitleTextSize\n : 30\n : 16,\n fontFamily: cardStyle.buttonTitleFontFamily ?? 'Montserrat-Bold',\n textAlign: 'center',\n paddingLeft: 5,\n paddingRight: 5,\n }}\n numberOfLines={1}\n >\n {buttonTitle}\n </Text>\n <View style={{ height: 10 }} />\n </View>\n );\n};\n"]}
@@ -1,6 +1,142 @@
1
- import { NativeModules } from 'react-native';
1
+ import React from 'react';
2
+ import { Image, NativeModules, Text, TouchableOpacity, View } from 'react-native';
2
3
  const {
3
4
  Flyy
4
5
  } = NativeModules;
5
6
  export default Flyy;
7
+ export const FlyyWidget = ({
8
+ widgetStyle = {
9
+ rewardsButtonIcon: require('./assets/images/rewardwidget.png'),
10
+ offersButtonIcon: require('./assets/images/offerswidget.png'),
11
+ walletButtonIcon: require('./assets/images/walletwidget.png'),
12
+ rewardButtonTitle: 'Rewards',
13
+ offerButtonTitle: 'Offers',
14
+ walletButtonTitle: 'Wallet',
15
+ buttonTitleFontFamily: 'Montserrat-Bold',
16
+ buttonBorderWidth: 0.5,
17
+ buttonTitleTextSize: 16.0,
18
+ iconCornerRadius: 30.0,
19
+ buttonCornerRadius: 15.0,
20
+ buttonTitleTextColor: 'black',
21
+ buttonBorderColor: 'white',
22
+ containerBackgroundColor: '#ebedeb',
23
+ buttonIconBackgroundColor: '#654EA3',
24
+ buttonBackgroundColor: 'white'
25
+ }
26
+ }) => {
27
+ var _widgetStyle$buttonBa, _widgetStyle$buttonCo, _widgetStyle$buttonBo, _widgetStyle$buttonBo2, _widgetStyle$containe, _widgetStyle$offerBut, _widgetStyle$offersBu, _widgetStyle$rewardBu, _widgetStyle$rewardsB, _widgetStyle$walletBu, _widgetStyle$walletBu2;
28
+
29
+ const buttonStyle = {
30
+ backgroundColor: (_widgetStyle$buttonBa = widgetStyle.buttonBackgroundColor) !== null && _widgetStyle$buttonBa !== void 0 ? _widgetStyle$buttonBa : 'white',
31
+ height: 110,
32
+ flex: 1,
33
+ elevation: 1,
34
+ borderRadius: (_widgetStyle$buttonCo = widgetStyle.buttonCornerRadius) !== null && _widgetStyle$buttonCo !== void 0 ? _widgetStyle$buttonCo : 15.0,
35
+ borderColor: (_widgetStyle$buttonBo = widgetStyle.buttonBorderColor) !== null && _widgetStyle$buttonBo !== void 0 ? _widgetStyle$buttonBo : 'white',
36
+ borderWidth: (_widgetStyle$buttonBo2 = widgetStyle.buttonBorderWidth) !== null && _widgetStyle$buttonBo2 !== void 0 ? _widgetStyle$buttonBo2 : 0.5
37
+ };
38
+ return /*#__PURE__*/React.createElement(View, {
39
+ style: {
40
+ backgroundColor: (_widgetStyle$containe = widgetStyle.containerBackgroundColor) !== null && _widgetStyle$containe !== void 0 ? _widgetStyle$containe : '#ebedeb',
41
+ height: 160,
42
+ width: '100%',
43
+ flexDirection: 'row',
44
+ justifyContent: 'center',
45
+ alignItems: 'center'
46
+ }
47
+ }, /*#__PURE__*/React.createElement(View, {
48
+ style: {
49
+ width: 20
50
+ }
51
+ }), /*#__PURE__*/React.createElement(TouchableOpacity, {
52
+ onPress: () => {
53
+ Flyy.openOffersScreen();
54
+ },
55
+ style: buttonStyle
56
+ }, /*#__PURE__*/React.createElement(FlyyCardView, {
57
+ cardStyle: widgetStyle,
58
+ buttonTitle: (_widgetStyle$offerBut = widgetStyle.offerButtonTitle) !== null && _widgetStyle$offerBut !== void 0 ? _widgetStyle$offerBut : 'Offers',
59
+ buttonIcon: (_widgetStyle$offersBu = widgetStyle.offersButtonIcon) !== null && _widgetStyle$offersBu !== void 0 ? _widgetStyle$offersBu : require('./assets/images/offerswidget.png')
60
+ })), /*#__PURE__*/React.createElement(View, {
61
+ style: {
62
+ width: 15
63
+ }
64
+ }), /*#__PURE__*/React.createElement(TouchableOpacity, {
65
+ onPress: () => {
66
+ Flyy.openRewardsScreen();
67
+ },
68
+ style: buttonStyle
69
+ }, /*#__PURE__*/React.createElement(FlyyCardView, {
70
+ cardStyle: widgetStyle,
71
+ buttonTitle: (_widgetStyle$rewardBu = widgetStyle.rewardButtonTitle) !== null && _widgetStyle$rewardBu !== void 0 ? _widgetStyle$rewardBu : 'Rewards',
72
+ buttonIcon: (_widgetStyle$rewardsB = widgetStyle.rewardsButtonIcon) !== null && _widgetStyle$rewardsB !== void 0 ? _widgetStyle$rewardsB : require('./assets/images/rewardwidget.png')
73
+ })), /*#__PURE__*/React.createElement(View, {
74
+ style: {
75
+ width: 15
76
+ }
77
+ }), /*#__PURE__*/React.createElement(TouchableOpacity, {
78
+ onPress: () => {
79
+ Flyy.openWalletScreen();
80
+ },
81
+ style: buttonStyle
82
+ }, /*#__PURE__*/React.createElement(FlyyCardView, {
83
+ cardStyle: widgetStyle,
84
+ buttonTitle: (_widgetStyle$walletBu = widgetStyle.walletButtonTitle) !== null && _widgetStyle$walletBu !== void 0 ? _widgetStyle$walletBu : 'Wallet',
85
+ buttonIcon: (_widgetStyle$walletBu2 = widgetStyle.walletButtonIcon) !== null && _widgetStyle$walletBu2 !== void 0 ? _widgetStyle$walletBu2 : require('./assets/images/walletwidget.png')
86
+ })), /*#__PURE__*/React.createElement(View, {
87
+ style: {
88
+ width: 20
89
+ }
90
+ }));
91
+ }; // @ts-ignore
92
+
93
+ const FlyyCardView = ({
94
+ cardStyle,
95
+ buttonTitle,
96
+ buttonIcon
97
+ }) => {
98
+ var _cardStyle$buttonIcon, _cardStyle$iconCorner, _cardStyle$buttonTitl, _cardStyle$buttonTitl2;
99
+
100
+ return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(View, {
101
+ style: {
102
+ height: 10
103
+ }
104
+ }), /*#__PURE__*/React.createElement(View, {
105
+ style: {
106
+ backgroundColor: (_cardStyle$buttonIcon = cardStyle.buttonIconBackgroundColor) !== null && _cardStyle$buttonIcon !== void 0 ? _cardStyle$buttonIcon : '#654EA3',
107
+ height: 50,
108
+ width: 50,
109
+ borderRadius: (_cardStyle$iconCorner = cardStyle.iconCornerRadius) !== null && _cardStyle$iconCorner !== void 0 ? _cardStyle$iconCorner : 30.0,
110
+ alignSelf: 'center',
111
+ justifyContent: 'center',
112
+ alignItems: 'center'
113
+ }
114
+ }, /*#__PURE__*/React.createElement(Image, {
115
+ source: buttonIcon,
116
+ style: {
117
+ height: 28,
118
+ width: 28
119
+ }
120
+ })), /*#__PURE__*/React.createElement(View, {
121
+ style: {
122
+ height: 10
123
+ }
124
+ }), /*#__PURE__*/React.createElement(Text, {
125
+ style: {
126
+ alignSelf: 'center',
127
+ flexShrink: 1,
128
+ color: (_cardStyle$buttonTitl = cardStyle.buttonTitleTextColor) !== null && _cardStyle$buttonTitl !== void 0 ? _cardStyle$buttonTitl : 'black',
129
+ fontSize: cardStyle.buttonTitleTextSize != null ? cardStyle.buttonTitleTextSize < 30 ? cardStyle.buttonTitleTextSize : 30 : 16,
130
+ fontFamily: (_cardStyle$buttonTitl2 = cardStyle.buttonTitleFontFamily) !== null && _cardStyle$buttonTitl2 !== void 0 ? _cardStyle$buttonTitl2 : 'Montserrat-Bold',
131
+ textAlign: 'center',
132
+ paddingLeft: 5,
133
+ paddingRight: 5
134
+ },
135
+ numberOfLines: 1
136
+ }, buttonTitle), /*#__PURE__*/React.createElement(View, {
137
+ style: {
138
+ height: 10
139
+ }
140
+ }));
141
+ };
6
142
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.tsx"],"names":["NativeModules","Flyy"],"mappings":"AAAA,SAASA,aAAT,QAA8B,cAA9B;AAMA,MAAM;AAAEC,EAAAA;AAAF,IAAWD,aAAjB;AAEA,eAAeC,IAAf","sourcesContent":["import { NativeModules } from 'react-native';\n\ntype FlyyType = {\n multiply(a: number, b: number): Promise<number>;\n};\n\nconst { Flyy } = NativeModules;\n\nexport default Flyy as FlyyType;\n"]}
1
+ {"version":3,"sources":["index.tsx"],"names":["React","Image","NativeModules","Text","TouchableOpacity","View","Flyy","FlyyWidget","widgetStyle","rewardsButtonIcon","require","offersButtonIcon","walletButtonIcon","rewardButtonTitle","offerButtonTitle","walletButtonTitle","buttonTitleFontFamily","buttonBorderWidth","buttonTitleTextSize","iconCornerRadius","buttonCornerRadius","buttonTitleTextColor","buttonBorderColor","containerBackgroundColor","buttonIconBackgroundColor","buttonBackgroundColor","buttonStyle","backgroundColor","height","flex","elevation","borderRadius","borderColor","borderWidth","width","flexDirection","justifyContent","alignItems","openOffersScreen","openRewardsScreen","openWalletScreen","FlyyCardView","cardStyle","buttonTitle","buttonIcon","alignSelf","flexShrink","color","fontSize","fontFamily","textAlign","paddingLeft","paddingRight"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SACEC,KADF,EAEEC,aAFF,EAGEC,IAHF,EAIEC,gBAJF,EAKEC,IALF,QAMO,cANP;AAYA,MAAM;A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EAAE,CAFP;AAGLC,MAAAA,KAAK,2BAAEL,SAAS,CAACrB,oBAAZ,yEAAoC,OAHpC;AAIL2B,MAAAA,QAAQ,EACNN,SAAS,CAACxB,mBAAV,IAAiC,IAAjC,GACIwB,SAAS,CAACxB,mBAAV,GAAgC,EAAhC,GACEwB,SAAS,CAACxB,mBADZ,GAEE,EAHN,GAII,EATD;AAUL+B,MAAAA,UAAU,4BAAEP,SAAS,CAAC1B,qBAAZ,2EAAqC,iBAV1C;AAWLkC,MAAAA,SAAS,EAAE,QAXN;AAYLC,MAAAA,WAAW,EAAE,CAZR;AAaLC,MAAAA,YAAY,EAAE;AAbT,KADT;AAgBE,IAAA,aAAa,EAAE;AAhBjB,KAkBGT,WAlBH,CAhBF,eAoCE,oBAAC,IAAD;AAAM,IAAA,KAAK,EAAE;AAAEf,MAAAA,MAAM,EAAE;AAAV;AAAb,IApCF,CADF;AAwCD,CAzCD","sourcesContent":["import React from 'react';\nimport {\n Image,\n NativeModules,\n Text,\n TouchableOpacity,\n View,\n} from 'react-native';\n\ntype FlyyType = {\n multiply(a: number, b: number): Promise<number>;\n};\n\nconst { Flyy } = NativeModules;\n\nexport default Flyy as FlyyType;\nexport const FlyyWidget = ({\n widgetStyle = {\n rewardsButtonIcon: require('./assets/images/rewardwidget.png'),\n offersButtonIcon: require('./assets/images/offerswidget.png'),\n walletButtonIcon: require('./assets/images/walletwidget.png'),\n rewardButtonTitle: 'Rewards',\n offerButtonTitle: 'Offers',\n walletButtonTitle: 'Wallet',\n buttonTitleFontFamily: 'Montserrat-Bold',\n buttonBorderWidth: 0.5,\n buttonTitleTextSize: 16.0,\n iconCornerRadius: 30.0,\n buttonCornerRadius: 15.0,\n buttonTitleTextColor: 'black',\n buttonBorderColor: 'white',\n containerBackgroundColor: '#ebedeb',\n buttonIconBackgroundColor: '#654EA3',\n buttonBackgroundColor: 'white',\n },\n}) => {\n const buttonStyle = {\n backgroundColor: widgetStyle.buttonBackgroundColor ?? 'white',\n height: 110,\n flex: 1,\n elevation: 1,\n borderRadius: widgetStyle.buttonCornerRadius ?? 15.0,\n borderColor: widgetStyle.buttonBorderColor ?? 'white',\n borderWidth: widgetStyle.buttonBorderWidth ?? 0.5,\n };\n return (\n <View\n style={{\n backgroundColor: widgetStyle.containerBackgroundColor ?? '#ebedeb',\n height: 160,\n width: '100%',\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n }}\n >\n <View style={{ width: 20 }} />\n <TouchableOpacity\n onPress={() => {\n Flyy.openOffersScreen();\n }}\n style={buttonStyle}\n >\n <FlyyCardView\n cardStyle={widgetStyle}\n buttonTitle={widgetStyle.offerButtonTitle ?? 'Offers'}\n buttonIcon={\n widgetStyle.offersButtonIcon ??\n require('./assets/images/offerswidget.png')\n }\n />\n </TouchableOpacity>\n <View style={{ width: 15 }} />\n <TouchableOpacity\n onPress={() => {\n Flyy.openRewardsScreen();\n }}\n style={buttonStyle}\n >\n <FlyyCardView\n cardStyle={widgetStyle}\n buttonTitle={widgetStyle.rewardButtonTitle ?? 'Rewards'}\n buttonIcon={\n widgetStyle.rewardsButtonIcon ??\n require('./assets/images/rewardwidget.png')\n }\n />\n </TouchableOpacity>\n <View style={{ width: 15 }} />\n <TouchableOpacity\n onPress={() => {\n Flyy.openWalletScreen();\n }}\n style={buttonStyle}\n >\n <FlyyCardView\n cardStyle={widgetStyle}\n buttonTitle={widgetStyle.walletButtonTitle ?? 'Wallet'}\n buttonIcon={\n widgetStyle.walletButtonIcon ??\n require('./assets/images/walletwidget.png')\n }\n />\n </TouchableOpacity>\n <View style={{ width: 20 }} />\n </View>\n );\n};\n\n// @ts-ignore\nconst FlyyCardView = ({ cardStyle, buttonTitle, buttonIcon }) => {\n return (\n <View>\n <View style={{ height: 10 }} />\n <View\n style={{\n backgroundColor: cardStyle.buttonIconBackgroundColor ?? '#654EA3',\n height: 50,\n width: 50,\n borderRadius: cardStyle.iconCornerRadius ?? 30.0,\n alignSelf: 'center',\n justifyContent: 'center',\n alignItems: 'center',\n }}\n >\n <Image source={buttonIcon} style={{ height: 28, width: 28 }} />\n </View>\n <View style={{ height: 10 }} />\n <Text\n style={{\n alignSelf: 'center',\n flexShrink: 1,\n color: cardStyle.buttonTitleTextColor ?? 'black',\n fontSize:\n cardStyle.buttonTitleTextSize != null\n ? cardStyle.buttonTitleTextSize < 30\n ? cardStyle.buttonTitleTextSize\n : 30\n : 16,\n fontFamily: cardStyle.buttonTitleFontFamily ?? 'Montserrat-Bold',\n textAlign: 'center',\n paddingLeft: 5,\n paddingRight: 5,\n }}\n numberOfLines={1}\n >\n {buttonTitle}\n </Text>\n <View style={{ height: 10 }} />\n </View>\n );\n};\n"]}
@@ -1,5 +1,26 @@
1
+ /// <reference types="react" />
1
2
  declare type FlyyType = {
2
3
  multiply(a: number, b: number): Promise<number>;
3
4
  };
4
5
  declare const _default: FlyyType;
5
6
  export default _default;
7
+ export declare const FlyyWidget: ({ widgetStyle, }: {
8
+ widgetStyle?: {
9
+ rewardsButtonIcon: any;
10
+ offersButtonIcon: any;
11
+ walletButtonIcon: any;
12
+ rewardButtonTitle: string;
13
+ offerButtonTitle: string;
14
+ walletButtonTitle: string;
15
+ buttonTitleFontFamily: string;
16
+ buttonBorderWidth: number;
17
+ buttonTitleTextSize: number;
18
+ iconCornerRadius: number;
19
+ buttonCornerRadius: number;
20
+ buttonTitleTextColor: string;
21
+ buttonBorderColor: string;
22
+ containerBackgroundColor: string;
23
+ buttonIconBackgroundColor: string;
24
+ buttonBackgroundColor: string;
25
+ } | undefined;
26
+ }) => JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-flyy",
3
- "version": "1.4.21",
3
+ "version": "1.4.22",
4
4
  "description": "React Native wrapper around our Android and iOS mobile SDKs",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -18,5 +18,5 @@ Pod::Spec.new do |s|
18
18
 
19
19
 
20
20
  s.dependency "React-Core"
21
- s.dependency "FlyyFramework", "1.3.38"
21
+ s.dependency "FlyyFramework", "1.3.41"
22
22
  end
package/src/index.tsx CHANGED
@@ -1,4 +1,11 @@
1
- import { NativeModules } from 'react-native';
1
+ import React from 'react';
2
+ import {
3
+ Image,
4
+ NativeModules,
5
+ Text,
6
+ TouchableOpacity,
7
+ View,
8
+ } from 'react-native';
2
9
 
3
10
  type FlyyType = {
4
11
  multiply(a: number, b: number): Promise<number>;
@@ -7,3 +14,139 @@ type FlyyType = {
7
14
  const { Flyy } = NativeModules;
8
15
 
9
16
  export default Flyy as FlyyType;
17
+ export const FlyyWidget = ({
18
+ widgetStyle = {
19
+ rewardsButtonIcon: require('./assets/images/rewardwidget.png'),
20
+ offersButtonIcon: require('./assets/images/offerswidget.png'),
21
+ walletButtonIcon: require('./assets/images/walletwidget.png'),
22
+ rewardButtonTitle: 'Rewards',
23
+ offerButtonTitle: 'Offers',
24
+ walletButtonTitle: 'Wallet',
25
+ buttonTitleFontFamily: 'Montserrat-Bold',
26
+ buttonBorderWidth: 0.5,
27
+ buttonTitleTextSize: 16.0,
28
+ iconCornerRadius: 30.0,
29
+ buttonCornerRadius: 15.0,
30
+ buttonTitleTextColor: 'black',
31
+ buttonBorderColor: 'white',
32
+ containerBackgroundColor: '#ebedeb',
33
+ buttonIconBackgroundColor: '#654EA3',
34
+ buttonBackgroundColor: 'white',
35
+ },
36
+ }) => {
37
+ const buttonStyle = {
38
+ backgroundColor: widgetStyle.buttonBackgroundColor ?? 'white',
39
+ height: 110,
40
+ flex: 1,
41
+ elevation: 1,
42
+ borderRadius: widgetStyle.buttonCornerRadius ?? 15.0,
43
+ borderColor: widgetStyle.buttonBorderColor ?? 'white',
44
+ borderWidth: widgetStyle.buttonBorderWidth ?? 0.5,
45
+ };
46
+ return (
47
+ <View
48
+ style={{
49
+ backgroundColor: widgetStyle.containerBackgroundColor ?? '#ebedeb',
50
+ height: 160,
51
+ width: '100%',
52
+ flexDirection: 'row',
53
+ justifyContent: 'center',
54
+ alignItems: 'center',
55
+ }}
56
+ >
57
+ <View style={{ width: 20 }} />
58
+ <TouchableOpacity
59
+ onPress={() => {
60
+ Flyy.openOffersScreen();
61
+ }}
62
+ style={buttonStyle}
63
+ >
64
+ <FlyyCardView
65
+ cardStyle={widgetStyle}
66
+ buttonTitle={widgetStyle.offerButtonTitle ?? 'Offers'}
67
+ buttonIcon={
68
+ widgetStyle.offersButtonIcon ??
69
+ require('./assets/images/offerswidget.png')
70
+ }
71
+ />
72
+ </TouchableOpacity>
73
+ <View style={{ width: 15 }} />
74
+ <TouchableOpacity
75
+ onPress={() => {
76
+ Flyy.openRewardsScreen();
77
+ }}
78
+ style={buttonStyle}
79
+ >
80
+ <FlyyCardView
81
+ cardStyle={widgetStyle}
82
+ buttonTitle={widgetStyle.rewardButtonTitle ?? 'Rewards'}
83
+ buttonIcon={
84
+ widgetStyle.rewardsButtonIcon ??
85
+ require('./assets/images/rewardwidget.png')
86
+ }
87
+ />
88
+ </TouchableOpacity>
89
+ <View style={{ width: 15 }} />
90
+ <TouchableOpacity
91
+ onPress={() => {
92
+ Flyy.openWalletScreen();
93
+ }}
94
+ style={buttonStyle}
95
+ >
96
+ <FlyyCardView
97
+ cardStyle={widgetStyle}
98
+ buttonTitle={widgetStyle.walletButtonTitle ?? 'Wallet'}
99
+ buttonIcon={
100
+ widgetStyle.walletButtonIcon ??
101
+ require('./assets/images/walletwidget.png')
102
+ }
103
+ />
104
+ </TouchableOpacity>
105
+ <View style={{ width: 20 }} />
106
+ </View>
107
+ );
108
+ };
109
+
110
+ // @ts-ignore
111
+ const FlyyCardView = ({ cardStyle, buttonTitle, buttonIcon }) => {
112
+ return (
113
+ <View>
114
+ <View style={{ height: 10 }} />
115
+ <View
116
+ style={{
117
+ backgroundColor: cardStyle.buttonIconBackgroundColor ?? '#654EA3',
118
+ height: 50,
119
+ width: 50,
120
+ borderRadius: cardStyle.iconCornerRadius ?? 30.0,
121
+ alignSelf: 'center',
122
+ justifyContent: 'center',
123
+ alignItems: 'center',
124
+ }}
125
+ >
126
+ <Image source={buttonIcon} style={{ height: 28, width: 28 }} />
127
+ </View>
128
+ <View style={{ height: 10 }} />
129
+ <Text
130
+ style={{
131
+ alignSelf: 'center',
132
+ flexShrink: 1,
133
+ color: cardStyle.buttonTitleTextColor ?? 'black',
134
+ fontSize:
135
+ cardStyle.buttonTitleTextSize != null
136
+ ? cardStyle.buttonTitleTextSize < 30
137
+ ? cardStyle.buttonTitleTextSize
138
+ : 30
139
+ : 16,
140
+ fontFamily: cardStyle.buttonTitleFontFamily ?? 'Montserrat-Bold',
141
+ textAlign: 'center',
142
+ paddingLeft: 5,
143
+ paddingRight: 5,
144
+ }}
145
+ numberOfLines={1}
146
+ >
147
+ {buttonTitle}
148
+ </Text>
149
+ <View style={{ height: 10 }} />
150
+ </View>
151
+ );
152
+ };