ikualo-ui-kit-mobile 0.8.2 → 0.8.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/assets/styles/elements/buttons.ts +4 -0
- package/assets/styles/elements/pages.ts +6 -2
- package/package.json +1 -1
- package/src/elements/buttons/BtnLightSmall.tsx +2 -2
- package/src/elements/navbar/Navbar.tsx +7 -3
- package/src/elements/views/Others.tsx +3 -1
- package/src/models/interfaces.models.ts +2 -0
|
@@ -128,6 +128,10 @@ const getStylesBtnLightSmall = (theme: ITheme) => StyleSheet.create({
|
|
|
128
128
|
'btn-light-small--primary': {
|
|
129
129
|
backgroundColor: theme.colors.background_focus,
|
|
130
130
|
borderColor: theme.colors.icon,
|
|
131
|
+
},
|
|
132
|
+
'btn-light-small--transparent': {
|
|
133
|
+
backgroundColor: theme.colors.transparent,
|
|
134
|
+
borderColor: theme.colors.icon,
|
|
131
135
|
}
|
|
132
136
|
,
|
|
133
137
|
'btn-light-small-content': {
|
|
@@ -28,15 +28,16 @@ export const getStyleNavbar = (theme: ITheme) => StyleSheet.create({
|
|
|
28
28
|
paddingHorizontal: 16,
|
|
29
29
|
alignItems: 'flex-start',
|
|
30
30
|
borderTopWidth: 1,
|
|
31
|
-
height:
|
|
31
|
+
height: 55,
|
|
32
32
|
width: '100%',
|
|
33
33
|
borderColor: theme.colors.border,
|
|
34
34
|
backgroundColor: theme.colors.background_card,
|
|
35
35
|
},
|
|
36
36
|
'navbar-item': {
|
|
37
37
|
width: 50,
|
|
38
|
+
alignSelf: 'center',
|
|
38
39
|
alignItems: 'center',
|
|
39
|
-
marginTop:
|
|
40
|
+
marginTop: 5
|
|
40
41
|
},
|
|
41
42
|
'navbar-bar': {
|
|
42
43
|
width: 50,
|
|
@@ -47,3 +48,6 @@ export const getStyleNavbar = (theme: ITheme) => StyleSheet.create({
|
|
|
47
48
|
}
|
|
48
49
|
})
|
|
49
50
|
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@ export const BtnLightSmall = (props: IBtnLightSmall) => {
|
|
|
12
12
|
const theme = useStore().theme;
|
|
13
13
|
const stylesBtnLightSmall = getStylesBtnLightSmall(theme);
|
|
14
14
|
|
|
15
|
-
const { onPress, icon, disabled = false, active, isLoading, text } = props;
|
|
15
|
+
const { onPress, icon, disabled = false, active, isLoading, text, transparent } = props;
|
|
16
16
|
const color = active ?
|
|
17
17
|
stylesBtnLightSmall['btn-light-small--active'].borderColor :
|
|
18
18
|
disabled ? theme.colors.border_disabled : stylesBtnLightSmall['btn-light-small--primary'].borderColor
|
|
@@ -24,7 +24,7 @@ export const BtnLightSmall = (props: IBtnLightSmall) => {
|
|
|
24
24
|
stylesBtnLightSmall['btn-light-small'],
|
|
25
25
|
active && stylesBtnLightSmall['btn-light-small--active'],
|
|
26
26
|
disabled && stylesBtnLightSmall['btn-light-small--disabled'],
|
|
27
|
-
!active && !disabled && stylesBtnLightSmall[
|
|
27
|
+
!active && !disabled && stylesBtnLightSmall[`btn-light-small--${transparent ? 'transparent' : 'primary'}`],
|
|
28
28
|
]}
|
|
29
29
|
contentStyle={stylesBtnLightSmall['btn-light-small-content']}
|
|
30
30
|
labelStyle={[
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { TouchableHighlight, View } from "react-native";
|
|
2
2
|
import useStore from "../../store";
|
|
3
|
-
import { cloneElement, useState } from "react";
|
|
3
|
+
import { cloneElement, useEffect, useState } from "react";
|
|
4
4
|
import { Text } from "../../";
|
|
5
5
|
import { getStyleNavbar } from "../../../assets/styles/elements/pages";
|
|
6
6
|
import { INavbar } from "../../models";
|
|
7
7
|
|
|
8
8
|
export const Navbar = (props: INavbar) => {
|
|
9
|
-
const { items, onChange, style } = props;
|
|
9
|
+
const { items, onChange, style, itemSelected } = props;
|
|
10
10
|
const theme = useStore().theme;
|
|
11
11
|
const stylesNavbar = getStyleNavbar(theme);
|
|
12
|
-
const [selected, setSelected] = useState<string>(
|
|
12
|
+
const [selected, setSelected] = useState<string>();
|
|
13
|
+
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
setSelected(itemSelected);
|
|
16
|
+
}, [itemSelected]);
|
|
13
17
|
|
|
14
18
|
return (
|
|
15
19
|
<View style={[stylesNavbar['navbar'], style]}>
|
|
@@ -12,6 +12,8 @@ export const Others = () => {
|
|
|
12
12
|
{ icon: <Test />, label: 'Crypto', value: '3' },
|
|
13
13
|
{ icon: <Test />, label: 'Perfil', value: '4' },
|
|
14
14
|
]
|
|
15
|
+
const itemSelected = items3[0].value
|
|
16
|
+
|
|
15
17
|
return (
|
|
16
18
|
<View style={{ gap: 24 }} >
|
|
17
19
|
<Text
|
|
@@ -35,7 +37,7 @@ export const Others = () => {
|
|
|
35
37
|
fontWeight="MontserratSemiBold600"
|
|
36
38
|
fontSize={18}
|
|
37
39
|
>Navbar</Text>
|
|
38
|
-
<Navbar items={items3} onChange={(value) => { console.log(value) }} />
|
|
40
|
+
<Navbar itemSelected={itemSelected} items={items3} onChange={(value) => { console.log(value) }} />
|
|
39
41
|
<Text
|
|
40
42
|
fontWeight="MontserratSemiBold600"
|
|
41
43
|
fontSize={18}
|
|
@@ -51,6 +51,7 @@ export interface IBtnLightSmall {
|
|
|
51
51
|
isLoading?: boolean;
|
|
52
52
|
active?: boolean;
|
|
53
53
|
text?: string;
|
|
54
|
+
transparent?: boolean;
|
|
54
55
|
}
|
|
55
56
|
export interface IBtnOutlined {
|
|
56
57
|
color?: TypeBtnColors;
|
|
@@ -287,6 +288,7 @@ export interface IFTimer {
|
|
|
287
288
|
}
|
|
288
289
|
export interface INavbar {
|
|
289
290
|
items: { icon: ReactElement, label: string, value: string }[],
|
|
291
|
+
itemSelected: string;
|
|
290
292
|
onChange: (value: string) => void
|
|
291
293
|
style?: object;
|
|
292
294
|
}
|