Skip to content

Commit

Permalink
Merge pull request #9 from MayankSingh173/profile
Browse files Browse the repository at this point in the history
Profile Screen and User Search added
  • Loading branch information
MayankSingh173 authored Jul 2, 2021
2 parents 0f05142 + a6c69b7 commit 1e7be81
Show file tree
Hide file tree
Showing 51 changed files with 1,424 additions and 148 deletions.
5 changes: 4 additions & 1 deletion App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import {View} from 'react-native';
import * as eva from '@eva-design/eva';
import {ApplicationProvider, IconRegistry} from '@ui-kitten/components';
import {ApplicationProvider, IconRegistry, Text} from '@ui-kitten/components';
import {EvaIconsPack} from '@ui-kitten/eva-icons';
import {default as appTheme} from './src/themes/custom-theme.json';
import {SafeAreaProvider} from 'react-native-safe-area-context';
Expand All @@ -10,6 +11,7 @@ import {useSelector} from 'react-redux';
import {RootState} from './src/store/rootReducer';
import MainNavigator from './src/navigation/MainNavigator';
import {LogBox} from 'react-native';
import Toast from 'react-native-toast-message';

LogBox.ignoreAllLogs();

Expand All @@ -25,6 +27,7 @@ const App = () => {
{...eva}
theme={{...(theme && eva[theme]), ...appTheme}}>
<MainNavigator />
<Toast ref={(ref) => Toast.setRef(ref)} />
</ApplicationProvider>
</React.Fragment>
);
Expand Down
1 change: 1 addition & 0 deletions android/app/src/main/java/com/baithak/MainApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.zmxv.RNSound.RNSoundPackage;
import com.goodatlas.audiorecord.RNAudioRecordPackage;
import org.devio.rn.splashscreen.SplashScreenReactPackage;
import co.apptailor.googlesignin.RNGoogleSigninPackage;
Expand Down
Binary file added android/app/src/main/res/raw/joined.mp3
Binary file not shown.
Binary file added android/app/src/main/res/raw/message.mp3
Binary file not shown.
2 changes: 2 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
rootProject.name = 'Baithak'
include ':react-native-sound'
project(':react-native-sound').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-sound/android')
include ':react-native-audio-record'
project(':react-native-audio-record').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-audio-record/android')
include ':react-native-splash-screen'
Expand Down
2 changes: 2 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ target 'Baithak' do

pod 'RNAudioRecord', :path => '../node_modules/react-native-audio-record'

pod 'RNSound', :path => '../node_modules/react-native-sound'

target 'BaithakTests' do
inherit! :complete
# Pods for testing
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"dependencies": {
"@eva-design/eva": "^2.1.0",
"@eva-design/material": "^2.1.0",
"@react-native-clipboard/clipboard": "^1.8.2",
"@react-native-community/masked-view": "^0.1.11",
"@react-native-firebase/app": "^12.1.0",
"@react-native-firebase/auth": "^12.1.0",
Expand Down Expand Up @@ -45,8 +46,10 @@
"react-native-reanimated": "^2.2.0",
"react-native-safe-area-context": "^3.2.0",
"react-native-screens": "^3.4.0",
"react-native-sound": "^0.11.0",
"react-native-splash-screen": "^3.2.0",
"react-native-svg": "^12.1.1",
"react-native-toast-message": "^1.4.9",
"react-native-vector-icons": "^8.1.0",
"react-redux": "^7.2.4",
"redux": "^4.1.0",
Expand Down
60 changes: 60 additions & 0 deletions src/components/Card/UserSearchCard/UserSerchCard.tsx
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;
41 changes: 32 additions & 9 deletions src/components/Headers/BackHeader/BackHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ interface props {
rightIcon?: string;
onRightPress?: () => void;
centerText?: string;
centerTextColor?: string;
leftIconColor?: string;
rightIconColor?: string;
rightLeftIcon?: string;
rightLeftIconColor?: string;
onPressRightLeftIcon?: () => void;
}

const BackHeader = (props: props) => {
Expand All @@ -27,26 +33,43 @@ const BackHeader = (props: props) => {
<Icon
name={props.leftIcon}
style={styles.icon}
fill={theme === 'dark' ? 'white' : 'black'}
fill={props.leftIconColor}
/>
</TouchableOpacity>
)}
{props.centerText && (
<View
style={[styles.textView, {width: props.rightIcon ? '75%' : '85%'}]}>
<Text category="h5" style={[styles.centerText]}>
<Text
category="h5"
style={[styles.centerText, {color: props.centerTextColor}]}>
{props.centerText}
</Text>
</View>
)}
{props.rightIcon && (
<TouchableOpacity onPress={props.onRightPress} style={styles.rightView}>
<Icon
name={props.rightIcon}
style={styles.rightIcon}
fill={theme === 'dark' ? 'white' : 'black'}
/>
</TouchableOpacity>
<View style={{flexDirection: 'row'}}>
{props.rightLeftIcon && (
<TouchableOpacity
onPress={props.onPressRightLeftIcon}
style={[styles.rightView, {marginRight: 10}]}>
<Icon
name={props.rightLeftIcon}
style={styles.rightIcon}
fill={props.rightLeftIconColor}
/>
</TouchableOpacity>
)}
<TouchableOpacity
onPress={props.onRightPress}
style={styles.rightView}>
<Icon
name={props.rightIcon}
style={styles.rightIcon}
fill={props.rightIconColor}
/>
</TouchableOpacity>
</View>
)}
</View>
);
Expand Down
4 changes: 3 additions & 1 deletion src/components/Headers/GeneralHeader/GeneralHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ interface props {
onPressLeft: () => void;
onPressRight?: () => void;
rightIcon?: string;
onPressSearch: () => void;
}
const GeneralHeader: FC<props> = ({
firebaseUser,
heading,
rightIcon,
onPressLeft,
onPressRight,
onPressSearch,
}) => {
const theme = useTheme();
const appTheme = useSelector(
Expand Down Expand Up @@ -76,7 +78,7 @@ const GeneralHeader: FC<props> = ({
)}
</View>
<View style={styles.searchBarView}>
<ShowSearchBar theme={appTheme} onPress={() => console.log('Search')} />
<ShowSearchBar theme={appTheme} onPress={onPressSearch} />
</View>
</View>
);
Expand Down
55 changes: 55 additions & 0 deletions src/components/Headers/ProfileHeader/ProfileHeader.tsx
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;
4 changes: 4 additions & 0 deletions src/components/Icons/Icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ export const PhoneIcon = (style: any) => (
<Icon {...style} name="phone-outline" />
);

export const SearchIcon = (style: any) => (
<Icon {...style} name="search-outline" />
);

export const PlusIcon = (style: any) => <Icon {...style} name="plus" />;

export const PasswordIcon = (style: any) => (
Expand Down
22 changes: 13 additions & 9 deletions src/components/Messages/VideoChat.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import {StyleSheet, View, ActivityIndicator, Clipboard} from 'react-native';
import {Layout, Text, useTheme, Icon} from '@ui-kitten/components';
import {StyleSheet, View, ActivityIndicator} from 'react-native';
import {Layout, useTheme, Icon} from '@ui-kitten/components';
import {FirebaseFirestoreTypes} from '@react-native-firebase/firestore';
import {useSelector} from 'react-redux';
import {RootState} from '../../store/rootReducer';
Expand All @@ -15,8 +15,9 @@ import {
} from 'react-native-gifted-chat';
import {Baithak} from '../../models/Meeting/CreateMeeting/interface';
import {onDeleteMessage} from '../../utils/Messages/onDeleteMessage';
import Toast from 'react-native-toast-message';
import Clipboard from '@react-native-clipboard/clipboard';
import {RALEWAY_MEDIUM} from '../../constants/Fonts/Fonts';
import {ToastAndroid} from 'react-native';

interface props {
message: IMessage[];
Expand Down Expand Up @@ -107,7 +108,11 @@ const onLongPress = (
break;
case 1:
Clipboard.setString(message.text);
ToastAndroid.show('Copied!', ToastAndroid.SHORT);
Toast.show({
type: 'success',
text1: 'Copied!',
position: 'top',
});
break;
}
},
Expand Down Expand Up @@ -145,7 +150,7 @@ const VideoChat = (props: props) => {
props1,
appTheme === 'dark'
? theme['color-basic-900']
: theme['color-basic-600'],
: theme['color-basic-300'],
)
}
renderSend={(props2) =>
Expand All @@ -160,14 +165,13 @@ const VideoChat = (props: props) => {
renderComposer={(props3) =>
renderComposer(props3, appTheme === 'dark' ? 'white' : 'black')
}
onPressAvatar={(item) => console.log('Press on avatar', item)}
renderBubble={(props4) =>
renderBubble(
props4,
appTheme === 'dark'
? theme['color-basic-700']
: theme['color-basic-400'],
theme['color-primary-default'],
appTheme === 'dark'
? theme['color-basic-200']
: theme['color-basic-600'],
)
}
renderActions={(props5) => renderAction(props5)}
Expand Down
Loading

0 comments on commit 1e7be81

Please sign in to comment.