parent
579db32a92
commit
3b6eff8f3b
@ -1,50 +1,85 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { View, StyleSheet } from 'react-native'
|
import { StyleSheet, View, Image, Pressable } from 'react-native'
|
||||||
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
||||||
|
|
||||||
import Profiles from '../screens/Profiles';
|
import Profiles from '../screens/Profiles';
|
||||||
import TopBar from '../components/TopBar';
|
import CreateProfile from '../screens/CreateProfile';
|
||||||
|
import ModifyProfile from '../screens/ModifyProfile';
|
||||||
|
|
||||||
|
import { HeaderTitle } from './Utils';
|
||||||
|
|
||||||
|
import SearchIcon from '../assets/images/search.png';
|
||||||
|
import AddIcon from '../assets/images/plus.png'
|
||||||
|
|
||||||
const ProfilesStack = createNativeStackNavigator()
|
const ProfilesStack = createNativeStackNavigator()
|
||||||
|
|
||||||
export default function ProfilesStackScreen() {
|
export default function ProfilesStackScreen({ navigation }) {
|
||||||
return (
|
const _handleSearch = () => console.log('Searching');
|
||||||
<ProfilesStack.Navigator>
|
const _handleHeaderAdd = () => navigation.navigate('ProfileCreation');
|
||||||
<ProfilesStack.Screen
|
|
||||||
name='Profiles'
|
return (
|
||||||
component={Profiles}
|
<ProfilesStack.Navigator>
|
||||||
options={{
|
<ProfilesStack.Screen
|
||||||
headerTitle: () => (
|
name='Profiles'
|
||||||
<TopBar title='Profiles' isVisible={true}/>
|
component={Profiles}
|
||||||
)
|
options={{
|
||||||
}}
|
headerStyle: styles.headerBarContainer,
|
||||||
/>
|
headerTitle: () => (
|
||||||
</ProfilesStack.Navigator>
|
<HeaderTitle title='Profiles'/>
|
||||||
)
|
),
|
||||||
|
headerRight: () => (
|
||||||
|
<View style={styles.headerBarRightContainer}>
|
||||||
|
<Pressable onPress={_handleSearch}>
|
||||||
|
<Image
|
||||||
|
source={SearchIcon}
|
||||||
|
style={styles.headerBarIcon}/>
|
||||||
|
</Pressable>
|
||||||
|
<Pressable onPress={_handleHeaderAdd}>
|
||||||
|
<Image
|
||||||
|
source={AddIcon}
|
||||||
|
style={styles.headerBarIcon}/>
|
||||||
|
</Pressable>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<ProfilesStack.Screen
|
||||||
|
name='ProfileCreation'
|
||||||
|
component={CreateProfile}
|
||||||
|
options={{
|
||||||
|
headerStyle: styles.headerBarContainer,
|
||||||
|
headerTitle: () => (
|
||||||
|
<HeaderTitle title='Profile Creation'/>
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<ProfilesStack.Screen
|
||||||
|
name='ProfileModification'
|
||||||
|
component={ModifyProfile}
|
||||||
|
options={{
|
||||||
|
headerStyle: styles.headerBarContainer,
|
||||||
|
headerTitle: () => (
|
||||||
|
<HeaderTitle title='Profile Modification'/>
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</ProfilesStack.Navigator>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
headerBarContainer: {
|
headerBarContainer: {
|
||||||
flexDirection: 'row',
|
|
||||||
width: "100%",
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'center',
|
|
||||||
backgroundColor: '#F2F0E4',
|
backgroundColor: '#F2F0E4',
|
||||||
padding: 5,
|
|
||||||
},
|
},
|
||||||
headerTitle: {
|
headerBarRightContainer: {
|
||||||
fontSize: 20,
|
display: 'flex',
|
||||||
fontWeight: "bold",
|
flexDirection: 'row',
|
||||||
color: '#3F3C42',
|
alignContent: 'space-between',
|
||||||
textAlign: "center",
|
marginHorizontal: 10,
|
||||||
textAlignVertical: 'center',
|
|
||||||
flex: 0.8,
|
|
||||||
},
|
|
||||||
headerAppIcon: {
|
|
||||||
width: 35,
|
|
||||||
height: 35
|
|
||||||
},
|
},
|
||||||
headerAppIconContainer: {
|
headerBarIcon: {
|
||||||
|
width: 30,
|
||||||
|
height: 30,
|
||||||
|
marginHorizontal: 10
|
||||||
}
|
}
|
||||||
})
|
})
|
@ -0,0 +1,19 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { Text, StyleSheet } from 'react-native';
|
||||||
|
|
||||||
|
export function HeaderTitle(props) {
|
||||||
|
return (
|
||||||
|
<Text
|
||||||
|
style={styles.headerTitle}>
|
||||||
|
{props.title}
|
||||||
|
</Text>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
headerTitle: {
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: "bold",
|
||||||
|
color: '#3F3C42',
|
||||||
|
}
|
||||||
|
})
|
Loading…
Reference in new issue