ikualo-ui-kit-mobile 0.9.2 → 0.9.4

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ikualo-ui-kit-mobile",
3
- "version": "0.9.2",
4
- "main": "expo/AppEntry.js",
3
+ "version": "0.9.4",
4
+ "main": "src/index.ts",
5
5
  "scripts": {
6
6
  "start": "expo start",
7
7
  "android": "expo start --android",
@@ -38,4 +38,4 @@
38
38
  "metro-react-native-babel-preset": "^0.77.0",
39
39
  "typescript": "^5.1.3"
40
40
  }
41
- }
41
+ }
@@ -1,53 +1,51 @@
1
- import { Platform, TouchableHighlight, View } from "react-native";
2
- import useStore from "../../store";
3
- import { cloneElement, useEffect, useState } from "react";
4
- import { Text } from "../../";
5
- import { getStyleNavbar } from "../../../assets/styles/elements/pages";
6
- import { INavbar } from "../../models";
1
+ import { Platform, TouchableHighlight, View } from 'react-native';
2
+ import useStore from '../../store';
3
+ import { cloneElement, useEffect, useState } from 'react';
4
+ import { Text } from '../../';
5
+ import { getStyleNavbar } from '../../../assets/styles/elements/pages';
6
+ import { INavbar } from '../../models';
7
7
 
8
8
  export const Navbar = (props: INavbar) => {
9
- const { items, onChange, style, itemSelected } = props;
10
- const theme = useStore().theme;
11
- const stylesNavbar = getStyleNavbar(theme);
12
- const [selected, setSelected] = useState<string>();
9
+ const { items, onChange, style, itemSelected } = props;
10
+ const theme = useStore().theme;
11
+ const stylesNavbar = getStyleNavbar(theme);
12
+ const [selected, setSelected] = useState<string>();
13
13
 
14
- useEffect(() => {
15
- setSelected(itemSelected);
16
- }, [itemSelected]);
14
+ useEffect(() => {
15
+ setSelected(itemSelected);
16
+ }, [itemSelected]);
17
17
 
18
- return (
19
- <View style={[stylesNavbar['navbar'],
20
- { height: Platform.OS === 'ios' ? 80 : 60 }
21
- , style]}>
22
- {items.map((item, index) => {
23
- return <TouchableHighlight
24
- underlayColor={'transparent'}
25
- key={index}
26
- onPress={() => { setSelected(item.value); onChange(item.value) }}>
27
- <View>
28
- {selected === item.value && <View style={stylesNavbar["navbar-bar"]}></View>}
29
- <View style={stylesNavbar['navbar-item']}>
30
- {cloneElement(item.icon,
31
- {
32
- color: selected === item.value ?
33
- theme.colors.icon :
34
- theme.colors.icon_disabled,
35
- size: 32
36
- })}
37
- <Text
38
- lineHeight={15}
39
- fontSize={10}
40
- fontWeight="MontserratSemiBold600"
41
- color={selected === item.value ?
42
- theme.colors.icon :
43
- theme.colors.icon_disabled}>
44
- {item.label}
45
- </Text>
46
- </View>
47
-
48
- </View>
49
- </TouchableHighlight>
50
- })}
51
-
52
- </View>);
53
- };
18
+ return (
19
+ <View style={[stylesNavbar['navbar'], { height: Platform.OS === 'ios' ? 80 : 60 }, style]}>
20
+ {items.map((item, index) => {
21
+ return (
22
+ <TouchableHighlight
23
+ underlayColor={'transparent'}
24
+ key={index}
25
+ onPress={() => {
26
+ onChange(item.value);
27
+ }}
28
+ >
29
+ <View>
30
+ {selected === item.value && <View style={stylesNavbar['navbar-bar']}></View>}
31
+ <View style={stylesNavbar['navbar-item']}>
32
+ {cloneElement(item.icon, {
33
+ color: selected === item.value ? theme.colors.icon : theme.colors.icon_disabled,
34
+ size: 32,
35
+ })}
36
+ <Text
37
+ lineHeight={15}
38
+ fontSize={10}
39
+ fontWeight="MontserratSemiBold600"
40
+ color={selected === item.value ? theme.colors.icon : theme.colors.icon_disabled}
41
+ >
42
+ {item.label}
43
+ </Text>
44
+ </View>
45
+ </View>
46
+ </TouchableHighlight>
47
+ );
48
+ })}
49
+ </View>
50
+ );
51
+ };