-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from MayankSingh173/profile
Profile Screen and User Search added
- Loading branch information
Showing
51 changed files
with
1,424 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import React from 'react'; | ||
import {StyleSheet, View, TouchableOpacity} from 'react-native'; | ||
import {UserInterface} from '../../../models/User/User'; | ||
import {Text} from '@ui-kitten/components'; | ||
import FastImage from 'react-native-fast-image'; | ||
import {DEFAULT_AVATAR} from '../../../constants/Images/Images'; | ||
import {RALEWAY_BOLD, RALEWAY_REGULAR} from '../../../constants/Fonts/Fonts'; | ||
|
||
interface props { | ||
user: UserInterface; | ||
onPress: () => void; | ||
} | ||
|
||
const UserSerchCard = ({user, onPress}: props) => { | ||
return ( | ||
<TouchableOpacity style={styles.main} onPress={onPress}> | ||
<View style={styles.imgView}> | ||
<FastImage | ||
source={{uri: user.photoURL ? user.photoURL : DEFAULT_AVATAR}} | ||
style={{flex: 1, height: 50, width: 50, borderRadius: 30}} | ||
/> | ||
</View> | ||
<View style={styles.content}> | ||
<Text style={styles.name}>{user.name ? user.name : 'Robot'}</Text> | ||
<Text style={styles.tagLine}> | ||
{user.tagLine ? user.tagLine : 'Baithak user'} | ||
</Text> | ||
</View> | ||
</TouchableOpacity> | ||
); | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
main: { | ||
flex: 1, | ||
flexDirection: 'row', | ||
}, | ||
imgView: { | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
flex: 1, | ||
}, | ||
content: { | ||
flex: 4, | ||
justifyContent: 'center', | ||
paddingHorizontal: 10, | ||
// borderBottomWidth: 0.3, | ||
// borderColor: 'grey', | ||
// paddingBottom: 15, | ||
}, | ||
name: { | ||
fontFamily: RALEWAY_BOLD, | ||
}, | ||
tagLine: { | ||
fontFamily: RALEWAY_REGULAR, | ||
color: 'grey', | ||
}, | ||
}); | ||
|
||
export default UserSerchCard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import {Icon} from '@ui-kitten/components'; | ||
import React from 'react'; | ||
import {StyleSheet, Text, View, TouchableOpacity} from 'react-native'; | ||
import {useSelector} from 'react-redux'; | ||
import {RootState} from '../../../store/rootReducer'; | ||
|
||
interface props { | ||
myProfile: boolean; | ||
onPressEdit: () => void; | ||
onPressSetting: () => void; | ||
} | ||
|
||
const ProfileHeader = (props: props) => { | ||
const theme = useSelector( | ||
(reduxState: RootState) => reduxState.ThemeReducer.theme, | ||
); | ||
|
||
if (!props.myProfile) return null; | ||
return ( | ||
<View style={styles.main}> | ||
<TouchableOpacity onPress={props.onPressEdit}> | ||
<Icon | ||
name="edit-outline" | ||
style={styles.icon} | ||
fill={theme === 'dark' ? 'white' : 'black'} | ||
/> | ||
</TouchableOpacity> | ||
<TouchableOpacity onPress={props.onPressSetting}> | ||
<Icon | ||
name="settings-outline" | ||
style={styles.icon} | ||
fill={theme === 'dark' ? 'white' : 'black'} | ||
/> | ||
</TouchableOpacity> | ||
</View> | ||
); | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
main: { | ||
width: '100%', | ||
flexDirection: 'row', | ||
justifyContent: 'flex-end', | ||
padding: 10, | ||
alignItems: 'center', | ||
flex: 1, | ||
}, | ||
icon: { | ||
height: 30, | ||
width: 30, | ||
marginHorizontal: 7, | ||
}, | ||
}); | ||
|
||
export default ProfileHeader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.