@coorpacademy/components 10.29.1-alpha.12 → 10.29.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/es/organism/mobile-navigation/index.native.d.ts +3 -2
- package/es/organism/mobile-navigation/index.native.d.ts.map +1 -1
- package/es/organism/mobile-navigation/index.native.js +19 -12
- package/es/organism/mobile-navigation/index.native.js.map +1 -1
- package/lib/organism/mobile-navigation/index.native.d.ts +3 -2
- package/lib/organism/mobile-navigation/index.native.d.ts.map +1 -1
- package/lib/organism/mobile-navigation/index.native.js +22 -12
- package/lib/organism/mobile-navigation/index.native.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { ViewStyle, TextStyle } from 'react-native';
|
|
2
|
+
import { ViewStyle, TextStyle, GestureResponderEvent } from 'react-native';
|
|
3
3
|
import { Theme } from '../../variables/theme.native';
|
|
4
4
|
interface ButtonProps {
|
|
5
5
|
title: string;
|
|
@@ -12,11 +12,12 @@ interface ButtonProps {
|
|
|
12
12
|
}>;
|
|
13
13
|
styles: StyleSheetType;
|
|
14
14
|
theme: Theme;
|
|
15
|
+
onPress: (event: GestureResponderEvent) => void;
|
|
15
16
|
}
|
|
16
17
|
export declare type NavItemType = {
|
|
17
18
|
label: string;
|
|
18
19
|
icon: ButtonProps['Icon'];
|
|
19
|
-
|
|
20
|
+
action: (event: GestureResponderEvent) => void;
|
|
20
21
|
};
|
|
21
22
|
export interface Props {
|
|
22
23
|
testID?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/mobile-navigation/index.native.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAsB,EAAE,EAAC,MAAM,OAAO,CAAC;AACrD,OAAO,EAAyB,SAAS,EAAE,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.native.d.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a,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { View, StyleSheet, Text } from 'react-native';
|
|
|
3
3
|
import { BlurView } from '@react-native-community/blur';
|
|
4
4
|
import { NovaCompositionNavigationNavBar as BlurredShadow } from '@coorpacademy/nova-icons';
|
|
5
5
|
import { useTemplateContext } from '../../template/app-review/template-context';
|
|
6
|
+
import Touchable from '../../hoc/touchable/index.native';
|
|
6
7
|
|
|
7
8
|
const createStyleSheet = theme => StyleSheet.create({
|
|
8
9
|
main: {
|
|
@@ -61,10 +62,12 @@ const Button = ({
|
|
|
61
62
|
selected,
|
|
62
63
|
Icon,
|
|
63
64
|
styles,
|
|
64
|
-
theme
|
|
65
|
-
|
|
65
|
+
theme,
|
|
66
|
+
onPress
|
|
67
|
+
}) => /*#__PURE__*/React.createElement(Touchable, {
|
|
66
68
|
testID: testID,
|
|
67
|
-
style: styles.button
|
|
69
|
+
style: styles.button,
|
|
70
|
+
onPress: onPress
|
|
68
71
|
}, /*#__PURE__*/React.createElement(View, {
|
|
69
72
|
style: {
|
|
70
73
|
alignItems: 'center'
|
|
@@ -109,15 +112,19 @@ const NavigationBar = ({
|
|
|
109
112
|
reducedTransparencyFallbackColor: "rgba(17, 17, 23, 0.5)"
|
|
110
113
|
}), /*#__PURE__*/React.createElement(View, {
|
|
111
114
|
style: styleSheet.container
|
|
112
|
-
}, items.map((prop, index) =>
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
115
|
+
}, items.map((prop, index) => {
|
|
116
|
+
const handlePress = prop.action;
|
|
117
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
118
|
+
key: `button-${prop.label}`,
|
|
119
|
+
title: prop.label,
|
|
120
|
+
Icon: prop.icon,
|
|
121
|
+
onPress: handlePress,
|
|
122
|
+
selected: index === selectedItemIndex,
|
|
123
|
+
testID: `navigationButton_${index}`,
|
|
124
|
+
styles: styleSheet,
|
|
125
|
+
theme: theme
|
|
126
|
+
});
|
|
127
|
+
})));
|
|
121
128
|
};
|
|
122
129
|
|
|
123
130
|
export default NavigationBar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["React","useState","useEffect","View","StyleSheet","Text","BlurView","NovaCompositionNavigationNavBar","BlurredShadow","useTemplateContext","createStyleSheet","theme","create","main","marginHorizontal","container","position","bottom","width","flexDirection","justifyContent","alignSelf","overflow","height","borderRadius","backgroundColor","colors","gray","light","button","alignItems","flex","marginTop","spacing","small","buttonText","fontSize","lineHeight","color","text","primary","dot","cta","blur","transform","rotateX","scaleX","Button","testID","title","selected","Icon","styles","NavigationBar","items","selectedItemIndex","templateContext","styleSheet","setStylesheet","_stylesheet","map","prop","index","label","icon"],"sources":["../../../src/organism/mobile-navigation/index.native.tsx"],"sourcesContent":["import React, {useState, useEffect, FC} from 'react';\nimport {View, StyleSheet, Text, ViewStyle, TextStyle} from 'react-native';\nimport {BlurView} from '@react-native-community/blur';\n\nimport {NovaCompositionNavigationNavBar as BlurredShadow} from '@coorpacademy/nova-icons';\n\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\n\ninterface ButtonProps {\n title: string;\n testID: string;\n selected: boolean;\n Icon: FC<{height: number; width: number; color?: string}>;\n styles: StyleSheetType;\n theme: Theme;\n}\n\nexport type NavItemType = {\n label: string;\n icon: ButtonProps['Icon'];\n
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","useState","useEffect","View","StyleSheet","Text","BlurView","NovaCompositionNavigationNavBar","BlurredShadow","useTemplateContext","Touchable","createStyleSheet","theme","create","main","marginHorizontal","container","position","bottom","width","flexDirection","justifyContent","alignSelf","overflow","height","borderRadius","backgroundColor","colors","gray","light","button","alignItems","flex","marginTop","spacing","small","buttonText","fontSize","lineHeight","color","text","primary","dot","cta","blur","transform","rotateX","scaleX","Button","testID","title","selected","Icon","styles","onPress","NavigationBar","items","selectedItemIndex","templateContext","styleSheet","setStylesheet","_stylesheet","map","prop","index","handlePress","action","label","icon"],"sources":["../../../src/organism/mobile-navigation/index.native.tsx"],"sourcesContent":["import React, {useState, useEffect, FC} from 'react';\nimport {View, StyleSheet, Text, ViewStyle, TextStyle, GestureResponderEvent} from 'react-native';\nimport {BlurView} from '@react-native-community/blur';\n\nimport {NovaCompositionNavigationNavBar as BlurredShadow} from '@coorpacademy/nova-icons';\n\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport Touchable from '../../hoc/touchable/index.native';\nimport {Theme} from '../../variables/theme.native';\n\ninterface ButtonProps {\n title: string;\n testID: string;\n selected: boolean;\n Icon: FC<{height: number; width: number; color?: string}>;\n styles: StyleSheetType;\n theme: Theme;\n onPress: (event: GestureResponderEvent) => void;\n}\n\nexport type NavItemType = {\n label: string;\n icon: ButtonProps['Icon'];\n action: (event: GestureResponderEvent) => void;\n};\n\nexport interface Props {\n testID?: string;\n items: Array<NavItemType>;\n selectedItemIndex: number;\n}\n\ntype StyleSheetType = {\n main: ViewStyle;\n container: ViewStyle;\n button: ViewStyle;\n buttonText: TextStyle;\n dot: ViewStyle;\n blur: ViewStyle;\n};\n\nconst createStyleSheet = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n main: {\n marginHorizontal: 20\n },\n container: {\n position: 'absolute',\n bottom: 34,\n width: '100%',\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignSelf: 'center',\n overflow: 'hidden',\n height: 66,\n borderRadius: 12,\n backgroundColor: theme.colors.gray.light\n },\n button: {\n alignItems: 'center',\n flex: 1,\n height: '100%',\n marginTop: theme.spacing.small\n },\n buttonText: {\n fontSize: theme.fontSize.small,\n lineHeight: 26,\n // height: 11,\n color: theme.colors.text.primary\n },\n\n dot: {\n width: 8,\n height: 8,\n borderRadius: 8,\n backgroundColor: theme.colors.cta,\n marginTop: 3,\n position: 'absolute',\n alignSelf: 'center'\n },\n blur: {\n marginTop: -87,\n width: 200,\n height: 100,\n position: 'absolute',\n alignSelf: 'center',\n transform: [{rotateX: '180deg'}, {scaleX: 0.7}]\n }\n });\n\nconst Button = ({testID, title, selected, Icon, styles, theme, onPress}: ButtonProps) => (\n <Touchable testID={testID} style={styles.button} onPress={onPress}>\n <View style={{alignItems: 'center'}}>\n <Icon\n height={16}\n width={16}\n color={selected ? theme.colors.cta : theme.colors.text.primary}\n />\n <Text style={styles.buttonText}>{title}</Text>\n </View>\n {selected ? (\n <View>\n <View style={styles.dot} />\n <BlurredShadow color={theme.colors.cta} style={styles.blur} />\n </View>\n ) : null}\n </Touchable>\n);\n\nconst NavigationBar = ({items, selectedItemIndex}: Props) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {theme} = templateContext;\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <View style={styleSheet.main}>\n <BlurView\n style={styleSheet.container}\n blurAmount={32}\n reducedTransparencyFallbackColor=\"rgba(17, 17, 23, 0.5)\"\n />\n <View style={styleSheet.container}>\n {items.map((prop, index) => {\n const handlePress = prop.action;\n return (\n <Button\n key={`button-${prop.label}`}\n title={prop.label}\n Icon={prop.icon}\n onPress={handlePress}\n selected={index === selectedItemIndex}\n testID={`navigationButton_${index}`}\n styles={styleSheet}\n theme={theme}\n />\n );\n })}\n </View>\n </View>\n );\n};\n\nexport default NavigationBar;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,SAAzB,QAA6C,OAA7C;AACA,SAAQC,IAAR,EAAcC,UAAd,EAA0BC,IAA1B,QAAkF,cAAlF;AACA,SAAQC,QAAR,QAAuB,8BAAvB;AAEA,SAAQC,+BAA+B,IAAIC,aAA3C,QAA+D,0BAA/D;AAEA,SAAQC,kBAAR,QAAiC,4CAAjC;AACA,OAAOC,SAAP,MAAsB,kCAAtB;;AAkCA,MAAMC,gBAAgB,GAAIC,KAAD,IACvBR,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AI,CAAC+C,UAAL,EAAiB;IACf,OAAO,IAAP;EACD;;EAED,oBACE,oBAAC,IAAD;IAAM,KAAK,EAAEA,UAAU,CAAC7C;EAAxB,gBACE,oBAAC,QAAD;IACE,KAAK,EAAE6C,UAAU,CAAC3C,SADpB;IAEE,UAAU,EAAE,EAFd;IAGE,gCAAgC,EAAC;EAHnC,EADF,eAME,oBAAC,IAAD;IAAM,KAAK,EAAE2C,UAAU,CAAC3C;EAAxB,GACGwC,KAAK,CAACM,GAAN,CAAU,CAACC,IAAD,EAAOC,KAAP,KAAiB;IAC1B,MAAMC,WAAW,GAAGF,IAAI,CAACG,MAAzB;IACA,oBACE,oBAAC,MAAD;MACE,GAAG,EAAG,UAASH,IAAI,CAACI,KAAM,EAD5B;MAEE,KAAK,EAAEJ,IAAI,CAACI,KAFd;MAGE,IAAI,EAAEJ,IAAI,CAACK,IAHb;MAIE,OAAO,EAAEH,WAJX;MAKE,QAAQ,EAAED,KAAK,KAAKP,iBALtB;MAME,MAAM,EAAG,oBAAmBO,KAAM,EANpC;MAOE,MAAM,EAAEL,UAPV;MAQE,KAAK,EAAE/C;IART,EADF;EAYD,CAdA,CADH,CANF,CADF;AA0BD,CAxCD;;AA0CA,eAAe2C,aAAf"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { ViewStyle, TextStyle } from 'react-native';
|
|
2
|
+
import { ViewStyle, TextStyle, GestureResponderEvent } from 'react-native';
|
|
3
3
|
import { Theme } from '../../variables/theme.native';
|
|
4
4
|
interface ButtonProps {
|
|
5
5
|
title: string;
|
|
@@ -12,11 +12,12 @@ interface ButtonProps {
|
|
|
12
12
|
}>;
|
|
13
13
|
styles: StyleSheetType;
|
|
14
14
|
theme: Theme;
|
|
15
|
+
onPress: (event: GestureResponderEvent) => void;
|
|
15
16
|
}
|
|
16
17
|
export declare type NavItemType = {
|
|
17
18
|
label: string;
|
|
18
19
|
icon: ButtonProps['Icon'];
|
|
19
|
-
|
|
20
|
+
action: (event: GestureResponderEvent) => void;
|
|
20
21
|
};
|
|
21
22
|
export interface Props {
|
|
22
23
|
testID?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/mobile-navigation/index.native.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAsB,EAAE,EAAC,MAAM,OAAO,CAAC;AACrD,OAAO,EAAyB,SAAS,EAAE,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/mobile-navigation/index.native.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAsB,EAAE,EAAC,MAAM,OAAO,CAAC;AACrD,OAAO,EAAyB,SAAS,EAAE,SAAS,EAAE,qBAAqB,EAAC,MAAM,cAAc,CAAC;AAOjG,OAAO,EAAC,KAAK,EAAC,MAAM,8BAA8B,CAAC;AAEnD,UAAU,WAAW;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,EAAE,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC,CAAC;IAC1D,MAAM,EAAE,cAAc,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;CACjD;AAED,oBAAY,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,MAAM,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,MAAM,WAAW,KAAK;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,aAAK,cAAc,GAAG;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,EAAE,SAAS,CAAC;IAClB,UAAU,EAAE,SAAS,CAAC;IACtB,GAAG,EAAE,SAAS,CAAC;IACf,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAsEF,QAAA,MAAM,aAAa,iCAAgC,KAAK,uBAwCvD,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -13,6 +13,10 @@ var _novaIcons = require("@coorpacademy/nova-icons");
|
|
|
13
13
|
|
|
14
14
|
var _templateContext = require("../../template/app-review/template-context");
|
|
15
15
|
|
|
16
|
+
var _index = _interopRequireDefault(require("../../hoc/touchable/index.native"));
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
16
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
21
|
|
|
18
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -74,10 +78,12 @@ const Button = ({
|
|
|
74
78
|
selected,
|
|
75
79
|
Icon,
|
|
76
80
|
styles,
|
|
77
|
-
theme
|
|
78
|
-
|
|
81
|
+
theme,
|
|
82
|
+
onPress
|
|
83
|
+
}) => /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
79
84
|
testID: testID,
|
|
80
|
-
style: styles.button
|
|
85
|
+
style: styles.button,
|
|
86
|
+
onPress: onPress
|
|
81
87
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
82
88
|
style: {
|
|
83
89
|
alignItems: 'center'
|
|
@@ -122,15 +128,19 @@ const NavigationBar = ({
|
|
|
122
128
|
reducedTransparencyFallbackColor: "rgba(17, 17, 23, 0.5)"
|
|
123
129
|
}), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
124
130
|
style: styleSheet.container
|
|
125
|
-
}, items.map((prop, index) =>
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
}, items.map((prop, index) => {
|
|
132
|
+
const handlePress = prop.action;
|
|
133
|
+
return /*#__PURE__*/_react.default.createElement(Button, {
|
|
134
|
+
key: `button-${prop.label}`,
|
|
135
|
+
title: prop.label,
|
|
136
|
+
Icon: prop.icon,
|
|
137
|
+
onPress: handlePress,
|
|
138
|
+
selected: index === selectedItemIndex,
|
|
139
|
+
testID: `navigationButton_${index}`,
|
|
140
|
+
styles: styleSheet,
|
|
141
|
+
theme: theme
|
|
142
|
+
});
|
|
143
|
+
})));
|
|
134
144
|
};
|
|
135
145
|
|
|
136
146
|
var _default = NavigationBar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["createStyleSheet","theme","StyleSheet","create","main","marginHorizontal","container","position","bottom","width","flexDirection","justifyContent","alignSelf","overflow","height","borderRadius","backgroundColor","colors","gray","light","button","alignItems","flex","marginTop","spacing","small","buttonText","fontSize","lineHeight","color","text","primary","dot","cta","blur","transform","rotateX","scaleX","Button","testID","title","selected","Icon","styles","NavigationBar","items","selectedItemIndex","templateContext","useTemplateContext","styleSheet","setStylesheet","useState","useEffect","_stylesheet","map","prop","index","label","icon"],"sources":["../../../src/organism/mobile-navigation/index.native.tsx"],"sourcesContent":["import React, {useState, useEffect, FC} from 'react';\nimport {View, StyleSheet, Text, ViewStyle, TextStyle} from 'react-native';\nimport {BlurView} from '@react-native-community/blur';\n\nimport {NovaCompositionNavigationNavBar as BlurredShadow} from '@coorpacademy/nova-icons';\n\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\n\ninterface ButtonProps {\n title: string;\n testID: string;\n selected: boolean;\n Icon: FC<{height: number; width: number; color?: string}>;\n styles: StyleSheetType;\n theme: Theme;\n}\n\nexport type NavItemType = {\n label: string;\n icon: ButtonProps['Icon'];\n
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["createStyleSheet","theme","StyleSheet","create","main","marginHorizontal","container","position","bottom","width","flexDirection","justifyContent","alignSelf","overflow","height","borderRadius","backgroundColor","colors","gray","light","button","alignItems","flex","marginTop","spacing","small","buttonText","fontSize","lineHeight","color","text","primary","dot","cta","blur","transform","rotateX","scaleX","Button","testID","title","selected","Icon","styles","onPress","NavigationBar","items","selectedItemIndex","templateContext","useTemplateContext","styleSheet","setStylesheet","useState","useEffect","_stylesheet","map","prop","index","handlePress","action","label","icon"],"sources":["../../../src/organism/mobile-navigation/index.native.tsx"],"sourcesContent":["import React, {useState, useEffect, FC} from 'react';\nimport {View, StyleSheet, Text, ViewStyle, TextStyle, GestureResponderEvent} from 'react-native';\nimport {BlurView} from '@react-native-community/blur';\n\nimport {NovaCompositionNavigationNavBar as BlurredShadow} from '@coorpacademy/nova-icons';\n\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport Touchable from '../../hoc/touchable/index.native';\nimport {Theme} from '../../variables/theme.native';\n\ninterface ButtonProps {\n title: string;\n testID: string;\n selected: boolean;\n Icon: FC<{height: number; width: number; color?: string}>;\n styles: StyleSheetType;\n theme: Theme;\n onPress: (event: GestureResponderEvent) => void;\n}\n\nexport type NavItemType = {\n label: string;\n icon: ButtonProps['Icon'];\n action: (event: GestureResponderEvent) => void;\n};\n\nexport interface Props {\n testID?: string;\n items: Array<NavItemType>;\n selectedItemIndex: number;\n}\n\ntype StyleSheetType = {\n main: ViewStyle;\n container: ViewStyle;\n button: ViewStyle;\n buttonText: TextStyle;\n dot: ViewStyle;\n blur: ViewStyle;\n};\n\nconst createStyleSheet = (theme: Theme): StyleSheetType =>\n StyleSheet.create({\n main: {\n marginHorizontal: 20\n },\n container: {\n position: 'absolute',\n bottom: 34,\n width: '100%',\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignSelf: 'center',\n overflow: 'hidden',\n height: 66,\n borderRadius: 12,\n backgroundColor: theme.colors.gray.light\n },\n button: {\n alignItems: 'center',\n flex: 1,\n height: '100%',\n marginTop: theme.spacing.small\n },\n buttonText: {\n fontSize: theme.fontSize.small,\n lineHeight: 26,\n // height: 11,\n color: theme.colors.text.primary\n },\n\n dot: {\n width: 8,\n height: 8,\n borderRadius: 8,\n backgroundColor: theme.colors.cta,\n marginTop: 3,\n position: 'absolute',\n alignSelf: 'center'\n },\n blur: {\n marginTop: -87,\n width: 200,\n height: 100,\n position: 'absolute',\n alignSelf: 'center',\n transform: [{rotateX: '180deg'}, {scaleX: 0.7}]\n }\n });\n\nconst Button = ({testID, title, selected, Icon, styles, theme, onPress}: ButtonProps) => (\n <Touchable testID={testID} style={styles.button} onPress={onPress}>\n <View style={{alignItems: 'center'}}>\n <Icon\n height={16}\n width={16}\n color={selected ? theme.colors.cta : theme.colors.text.primary}\n />\n <Text style={styles.buttonText}>{title}</Text>\n </View>\n {selected ? (\n <View>\n <View style={styles.dot} />\n <BlurredShadow color={theme.colors.cta} style={styles.blur} />\n </View>\n ) : null}\n </Touchable>\n);\n\nconst NavigationBar = ({items, selectedItemIndex}: Props) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {theme} = templateContext;\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(theme);\n setStylesheet(_stylesheet);\n }, [theme]);\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <View style={styleSheet.main}>\n <BlurView\n style={styleSheet.container}\n blurAmount={32}\n reducedTransparencyFallbackColor=\"rgba(17, 17, 23, 0.5)\"\n />\n <View style={styleSheet.container}>\n {items.map((prop, index) => {\n const handlePress = prop.action;\n return (\n <Button\n key={`button-${prop.label}`}\n title={prop.label}\n Icon={prop.icon}\n onPress={handlePress}\n selected={index === selectedItemIndex}\n testID={`navigationButton_${index}`}\n styles={styleSheet}\n theme={theme}\n />\n );\n })}\n </View>\n </View>\n );\n};\n\nexport default NavigationBar;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAEA;;AAEA;;AACA;;;;;;;;AAkCA,MAAMA,gBAAgB,GAAIC,KAAD,IACvBC,uBAAA,CAAWC,MAAX,CAAkB;EAChBC,IAAI,EAAE;IACJC,gBAAgB,EAAE;EADd,CADU;EAIhBC,SAAS,EAAE;IACTC,QAAQ,EAAE,UADD;IAETC,MAAM,EAAE,EAFC;IAGTC,KAAK,EAAE,MAHE;IAITC,aAAa,EAAE,KAJN;IAKTC,cAAc,EAAE,eALP;IAMTC,SAAS,EAAE,QANF;IAOTC,QAAQ,EAAE,QAPD;IAQTC,MAAM,EAAE,EARC;IASTC,YAAY,EAAE,EATL;IAUTC,eAAe,EAAEf,KAAK,CAACgB,MAAN,CAAaC,IAAb,CAAkBC;EAV1B,CAJK;EAgBhBC,MAAM,EAAE;IACNC,UAAU,EAAE,QADN;IAENC,IAAI,EAAE,CAFA;IAGNR,MAAM,EAAE,MAHF;IAINS,SAAS,EAAEtB,KAAK,CAACuB,OAAN,CAAcC;EAJnB,CAhBQ;EAsBhBC,UAAU,EAAE;IACVC,QAAQ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AO,EAAEH,WAJX;MAKE,QAAQ,EAAED,KAAK,KAAKV,iBALtB;MAME,MAAM,EAAG,oBAAmBU,KAAM,EANpC;MAOE,MAAM,EAAEP,UAPV;MAQE,KAAK,EAAEjD;IART,EADF;EAYD,CAdA,CADH,CANF,CADF;AA0BD,CAxCD;;eA0Ce4C,a"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/components",
|
|
3
|
-
"version": "10.29.1
|
|
3
|
+
"version": "10.29.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -157,5 +157,5 @@
|
|
|
157
157
|
"last 2 versions",
|
|
158
158
|
"IE 11"
|
|
159
159
|
],
|
|
160
|
-
"gitHead": "
|
|
160
|
+
"gitHead": "4f7ce328a328214e463b74c66c8803e3a8bc8cfb"
|
|
161
161
|
}
|