ikualo-ui-kit-mobile 0.0.3 → 0.0.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/.expo/README.md +8 -0
- package/assets/images/_images.ts +5 -0
- package/assets/images/headerBack.png +0 -0
- package/assets/images/headerClose.png +0 -0
- package/assets/images/headerInfo.png +0 -0
- package/package.json +1 -1
- package/src/elements/cards/CardList.tsx +5 -4
- package/src/elements/headers/HeaderPage.tsx +35 -15
package/.expo/README.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
> Why do I have a folder named ".expo" in my project?
|
|
2
|
+
The ".expo" folder is created when an Expo project is started using "expo start" command.
|
|
3
|
+
> What do the files contain?
|
|
4
|
+
- "devices.json": contains information about devices that have recently opened this project. This is used to populate the "Development sessions" list in your development builds.
|
|
5
|
+
- "settings.json": contains the server configuration that is used to serve the application manifest.
|
|
6
|
+
> Should I commit the ".expo" folder?
|
|
7
|
+
No, you should not share the ".expo" folder. It does not contain any information that is relevant for other developers working on the project, it is specific to your machine.
|
|
8
|
+
Upon project creation, the ".expo" folder is already added to your ".gitignore" file.
|
package/assets/images/_images.ts
CHANGED
|
@@ -45,4 +45,9 @@ export const images = {
|
|
|
45
45
|
},
|
|
46
46
|
validateIdentity: require('./validateIdentity.png'),
|
|
47
47
|
validationFailed: require('./validationFailed.png'),
|
|
48
|
+
header:{
|
|
49
|
+
back: require('./headerBack.png'),
|
|
50
|
+
close: require('./headerClose.png'),
|
|
51
|
+
help: require('./headerInfo.png'),
|
|
52
|
+
}
|
|
48
53
|
};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -2,9 +2,10 @@ import { Card } from 'react-native-paper';
|
|
|
2
2
|
import { stylesCards } from '../../../assets/styles/elements/cards';
|
|
3
3
|
import { View, Text, TouchableHighlight } from 'react-native';
|
|
4
4
|
import { useState } from 'react';
|
|
5
|
+
import { ScrollView } from 'react-native-gesture-handler';
|
|
5
6
|
|
|
6
7
|
interface IfCardList {
|
|
7
|
-
options: { value: string }[];
|
|
8
|
+
options: { value: string | JSX.Element, id: string }[];
|
|
8
9
|
children?: React.ReactNode;
|
|
9
10
|
onSelectOption: (value: string) => void;
|
|
10
11
|
}
|
|
@@ -14,13 +15,13 @@ export const CardList = (props: IfCardList) => {
|
|
|
14
15
|
const [selectedOption, setSelectOption] = useState(0);
|
|
15
16
|
|
|
16
17
|
return (
|
|
17
|
-
<
|
|
18
|
+
<ScrollView>
|
|
18
19
|
{options.map((option, index) => (
|
|
19
20
|
<TouchableHighlight
|
|
20
21
|
key={index}
|
|
21
22
|
onPress={() => {
|
|
22
23
|
setSelectOption(index);
|
|
23
|
-
onSelectOption(option.
|
|
24
|
+
onSelectOption(option.id);
|
|
24
25
|
}}
|
|
25
26
|
style={stylesCards['card-list-item']}
|
|
26
27
|
>
|
|
@@ -34,6 +35,6 @@ export const CardList = (props: IfCardList) => {
|
|
|
34
35
|
</Card>
|
|
35
36
|
</TouchableHighlight>
|
|
36
37
|
))}
|
|
37
|
-
</
|
|
38
|
+
</ScrollView>
|
|
38
39
|
);
|
|
39
40
|
};
|
|
@@ -2,32 +2,52 @@ import { Text } from 'react-native-paper';
|
|
|
2
2
|
import { Image, TouchableOpacity, View } from 'react-native';
|
|
3
3
|
import { useNavigation } from '@react-navigation/native';
|
|
4
4
|
import { stylesHeader } from '../../../assets/styles/elements/header';
|
|
5
|
-
import { icons } from '../../../assets/icons/_icons';
|
|
6
5
|
import { images } from '../../../assets/images/_images';
|
|
7
6
|
|
|
8
7
|
interface IFHeaderPage {
|
|
9
8
|
title: string;
|
|
10
|
-
navigateTo: string;
|
|
11
|
-
|
|
9
|
+
navigateTo: 'Back' | string;
|
|
10
|
+
onPressBack?: () => void;
|
|
11
|
+
onPressRight?: () => void;
|
|
12
|
+
right: 'icon' | 'close' | 'help' | ''
|
|
12
13
|
}
|
|
13
14
|
export const HeaderPage = (props: IFHeaderPage) => {
|
|
14
|
-
const { navigateTo, title,
|
|
15
|
-
const
|
|
15
|
+
const { navigateTo, title, onPressBack, onPressRight, right } = props;
|
|
16
|
+
const { navigate, goBack } = useNavigation();
|
|
16
17
|
const navigateToScreen = () => {
|
|
17
|
-
|
|
18
|
-
navigateTo === 'Back' ?
|
|
18
|
+
onPressBack && onPressBack();
|
|
19
|
+
navigateTo === 'Back' ? goBack() : navigate(navigateTo as never);
|
|
19
20
|
};
|
|
21
|
+
const actionsRight = [
|
|
22
|
+
{
|
|
23
|
+
name: 'icon',
|
|
24
|
+
component: <Image source={images.logoSmallBlack} style={stylesHeader['header-logo']} />
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'close',
|
|
28
|
+
component: <TouchableOpacity onPress={()=>onPressRight && onPressRight()}>
|
|
29
|
+
<Image source={images.header.close} style={stylesHeader['header-logo']} />
|
|
30
|
+
</TouchableOpacity>
|
|
31
|
+
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'help',
|
|
35
|
+
component: <TouchableOpacity onPress={()=>onPressRight && onPressRight()}>
|
|
36
|
+
<Image source={images.header.help} style={stylesHeader['header-logo']} />
|
|
37
|
+
</TouchableOpacity>
|
|
38
|
+
},
|
|
39
|
+
]
|
|
20
40
|
return (
|
|
21
41
|
<View style={stylesHeader['header']}>
|
|
22
|
-
<TouchableOpacity onPress={navigateToScreen}
|
|
23
|
-
<Image source={
|
|
42
|
+
<TouchableOpacity onPress={navigateToScreen}>
|
|
43
|
+
<Image source={images.header.back} style={stylesHeader['header-logo']} />
|
|
24
44
|
</TouchableOpacity>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
45
|
+
<View style={{ flex: 1, alignItems: 'center' }}>
|
|
46
|
+
<Text variant="bodyMedium" style={stylesHeader['header-title']}>
|
|
47
|
+
{title}
|
|
48
|
+
</Text>
|
|
49
|
+
</View>
|
|
50
|
+
{actionsRight.find(x => x.name === right)?.component ?? ""}
|
|
31
51
|
</View>
|
|
32
52
|
);
|
|
33
53
|
};
|