├── assets ├── images │ ├── BG.png │ ├── icon.png │ ├── favicon.png │ ├── splash.png │ └── adaptive-icon.png └── fonts │ └── SpaceMono-Regular.ttf ├── tsconfig.json ├── babel.config.js ├── components ├── inputBox │ ├── style.js │ └── index.jsx ├── StyledText.tsx ├── Settings │ ├── Seperator.js │ ├── style.js │ ├── profile.tsx │ └── Item.js ├── __tests__ │ └── StyledText-test.js ├── labelListItem │ ├── style.js │ └── index.tsx ├── searchBar │ ├── Style.js │ └── index.js ├── addLabel │ ├── style.js │ └── index.tsx ├── chatMessage │ ├── style.js │ └── index.tsx ├── NewChatSectionTitle │ └── index.js ├── Lists │ ├── FlatList.js │ └── SectionList.js ├── ContactList.js ├── Status │ ├── style.js │ ├── PrivacyItem.js │ └── index.js ├── UsersListItem │ ├── Style.js │ └── index.js ├── chatListItem │ ├── Style.js │ └── index.tsx ├── ChatList.js ├── callListItem │ ├── Style.js │ └── index.tsx ├── CallLog.js ├── GoBack.js ├── Themed.tsx ├── EditScreenInfo.tsx ├── NewChatNav.js ├── LabelList.js └── ChatNavs.js ├── data ├── profile.js ├── Labels.js ├── StatusUpdates.js ├── CallsData.js ├── Chats.js ├── Users.js └── ChatRooms.js ├── .gitignore ├── constants ├── Layout.ts ├── Styles.ts └── Colors.ts ├── .expo-shared └── assets.json ├── hooks ├── useColorScheme.ts └── useCachedResources.ts ├── screens ├── CameraScreen.tsx ├── AddLabelScreen.tsx ├── NotFoundScreen.tsx ├── AddCallModalScreen.js ├── NewGroupModalScreen.js ├── LabelsScreen.tsx ├── CallsScreen.tsx ├── ChatRoomScreen.tsx ├── StatusPrivacy.tsx ├── StatusScreen.tsx ├── ChatScreen.tsx ├── NewChatModalScreen.tsx ├── QRScreen.tsx └── SettingsScreen.tsx ├── app.json ├── headers ├── SettingsScreenHeader.js ├── LabelsScreenHeader.js ├── QRScreenHeader.js ├── StatusScreenHeader.js ├── AddLabelScreenHeader.js ├── NewChatModalHeader.js ├── ChatScreenHeader.js ├── ChatRoomScreenHeader.js └── CallScreenHeader.js ├── navigation ├── LinkingConfiguration.ts ├── MainTabNavigator.tsx └── index.tsx ├── App.tsx ├── package.json ├── types.tsx └── README.md /assets/images/BG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qbentil/chatbox/HEAD/assets/images/BG.png -------------------------------------------------------------------------------- /assets/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qbentil/chatbox/HEAD/assets/images/icon.png -------------------------------------------------------------------------------- /assets/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qbentil/chatbox/HEAD/assets/images/favicon.png -------------------------------------------------------------------------------- /assets/images/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qbentil/chatbox/HEAD/assets/images/splash.png -------------------------------------------------------------------------------- /assets/images/adaptive-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qbentil/chatbox/HEAD/assets/images/adaptive-icon.png -------------------------------------------------------------------------------- /assets/fonts/SpaceMono-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qbentil/chatbox/HEAD/assets/fonts/SpaceMono-Regular.ttf -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "expo/tsconfig.base", 3 | "compilerOptions": { 4 | "strict": true 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = function(api) { 2 | api.cache(true); 3 | return { 4 | presets: ['babel-preset-expo'] 5 | }; 6 | }; 7 | -------------------------------------------------------------------------------- /components/inputBox/style.js: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from "react-native"; 2 | 3 | const Styles = StyleSheet.create({ 4 | 5 | }) 6 | 7 | 8 | export default Styles; -------------------------------------------------------------------------------- /data/profile.js: -------------------------------------------------------------------------------- 1 | export default { 2 | id: 'u1', 3 | name: 'BentilZone Web Hosting', 4 | imageUri: 'https://codersquiz.netlify.app/img/bentil.jpeg', 5 | status: "Servers you can trust", 6 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .expo/ 3 | dist/ 4 | npm-debug.* 5 | *.jks 6 | *.p8 7 | *.p12 8 | *.key 9 | *.mobileprovision 10 | *.orig.* 11 | web-build/ 12 | .vscode/ 13 | 14 | # macOS 15 | .DS_Store 16 | -------------------------------------------------------------------------------- /components/StyledText.tsx: -------------------------------------------------------------------------------- 1 | import { Text, TextProps } from './Themed'; 2 | 3 | export function MonoText(props: TextProps) { 4 | return ; 5 | } 6 | -------------------------------------------------------------------------------- /components/Settings/Seperator.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { View } from 'react-native' 3 | import tw from 'twrnc' 4 | 5 | const Seperator = () => { 6 | return ( 7 | 8 | ) 9 | } 10 | 11 | export default Seperator -------------------------------------------------------------------------------- /constants/Layout.ts: -------------------------------------------------------------------------------- 1 | import { Dimensions } from 'react-native'; 2 | 3 | const width = Dimensions.get('window').width; 4 | const height = Dimensions.get('window').height; 5 | 6 | export default { 7 | window: { 8 | width, 9 | height, 10 | }, 11 | isSmallDevice: width < 375, 12 | }; 13 | -------------------------------------------------------------------------------- /.expo-shared/assets.json: -------------------------------------------------------------------------------- 1 | { 2 | "e997a5256149a4b76e6bfd6cbf519c5e5a0f1d278a3d8fa1253022b03c90473b": true, 3 | "af683c96e0ffd2cf81287651c9433fa44debc1220ca7cb431fe482747f34a505": true, 4 | "12bb71342c6255bbf50437ec8f4441c083f47cdb74bd89160c15e4f43e52a1cb": true, 5 | "40b842e832070c58deac6aa9e08fa459302ee3f9da492c7e77d93d2fbf4a56fd": true 6 | } 7 | -------------------------------------------------------------------------------- /components/__tests__/StyledText-test.js: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import renderer from 'react-test-renderer'; 3 | 4 | import { MonoText } from '../StyledText'; 5 | 6 | it(`renders correctly`, () => { 7 | const tree = renderer.create(Snapshot test!).toJSON(); 8 | 9 | expect(tree).toMatchSnapshot(); 10 | }); 11 | -------------------------------------------------------------------------------- /components/labelListItem/style.js: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | 3 | const styles = StyleSheet.create({ 4 | container: { 5 | flexDirection: 'row', 6 | width: "100%", 7 | justifyContent: 'space-between', 8 | padding: 10, 9 | }, 10 | text: { 11 | fontSize: 15 12 | } 13 | 14 | }); 15 | 16 | export default styles; -------------------------------------------------------------------------------- /components/searchBar/Style.js: -------------------------------------------------------------------------------- 1 | export default { 2 | 3 | container: { 4 | flexDirection: 'row', 5 | justifyContent: 'center', 6 | alignItems: 'center', 7 | borderRadius: 10, 8 | marginVertical: 10, 9 | paddingHorizontal: 10, 10 | paddingVertical: 5, 11 | height: 45, 12 | }, 13 | input: { 14 | fontSize: 17, 15 | fontWeight: '400', 16 | }, 17 | 18 | } -------------------------------------------------------------------------------- /hooks/useColorScheme.ts: -------------------------------------------------------------------------------- 1 | import { ColorSchemeName, useColorScheme as _useColorScheme } from 'react-native'; 2 | 3 | // The useColorScheme value is always either light or dark, but the built-in 4 | // type suggests that it can be null. This will not happen in practice, so this 5 | // makes it a bit easier to work with. 6 | export default function useColorScheme(): NonNullable { 7 | return _useColorScheme() as NonNullable; 8 | } 9 | -------------------------------------------------------------------------------- /components/addLabel/style.js: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from "react-native" 2 | export const style = StyleSheet.create({ 3 | container: { 4 | 5 | }, 6 | colorPicker: { 7 | width: 60, 8 | height: 60, 9 | borderRadius: 50, 10 | backgroundColor: 'pink' 11 | }, 12 | input:{ 13 | // borderColor: 'gray', 14 | fontSize: 18 15 | 16 | }, 17 | text:{ 18 | fontSize: 18 19 | } 20 | }) -------------------------------------------------------------------------------- /constants/Styles.ts: -------------------------------------------------------------------------------- 1 | // import { ColorSchemeName } from 'react-native'; 2 | 3 | import Colors from './Colors'; 4 | import useColorScheme from '../hooks/useColorScheme'; 5 | 6 | // const colorScheme = useColorScheme(); 7 | export default { 8 | headerTitle: { 9 | color: Colors.light.tint, 10 | // fontWeight: 'bold', 11 | fontSize: 17 12 | }, 13 | headerIconsContainer: { 14 | flexDirection: 'row', 15 | width: 56, 16 | justifyContent: 'space-between', 17 | marginRight: 10 18 | }, 19 | 20 | } -------------------------------------------------------------------------------- /components/chatMessage/style.js: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from "react-native"; 2 | 3 | const Styles = StyleSheet.create({ 4 | container: { 5 | padding: 10, 6 | // backgroundColor: '#eee' 7 | }, 8 | msgBox: { 9 | borderRadius: 5, 10 | padding: 10, 11 | 12 | }, 13 | incomingMsg: { 14 | backgroundColor: '#28282B', 15 | marginRight: 60 16 | }, 17 | outgoingMsg: { 18 | backgroundColor: '#075E54', 19 | marginLeft: 60 20 | } 21 | 22 | }) 23 | 24 | 25 | export default Styles; -------------------------------------------------------------------------------- /components/NewChatSectionTitle/index.js: -------------------------------------------------------------------------------- 1 | import { Text, View } from '../Themed' 2 | 3 | import Colors from '../../constants/Colors' 4 | import React from 'react' 5 | import tw from 'twrnc' 6 | import useColorScheme from '../../hooks/useColorScheme' 7 | 8 | export default function SectionTitle({title}) { 9 | const colorScheme = useColorScheme(); 10 | return ( 11 | 12 | {title} 13 | 14 | ) 15 | } 16 | -------------------------------------------------------------------------------- /components/Lists/FlatList.js: -------------------------------------------------------------------------------- 1 | import {FlatList, ScrollView} from 'react-native'; 2 | 3 | import ChatListItem from '../chatListItem'; 4 | 5 | const FlatListView = ({data}) => { 6 | return ( 7 | 8 | item.id} 13 | renderItem = {({item}) => ( 14 | 15 | )} 16 | 17 | /> 18 | ) 19 | } 20 | 21 | 22 | export default FlatListView; -------------------------------------------------------------------------------- /components/ContactList.js: -------------------------------------------------------------------------------- 1 | import {FlatList, ScrollView} from 'react-native'; 2 | 3 | import ChatListItem from './chatListItem'; 4 | import ChatRooms from '../data/ChatRooms'; 5 | import FlatListView from './Lists/FlatList'; 6 | import SectionListView from './Lists/SectionList'; 7 | 8 | const ContactList = ({data}) => { 9 | // const SortedChatData = ChatRooms.slice().sort((a, b) => new Date(b.lastMessage.CreatedAt) - new Date(a.lastMessage.CreatedAt)); 10 | 11 | return ( 12 | 13 | // 14 | 15 | 16 | ); 17 | 18 | } 19 | 20 | export default ContactList; -------------------------------------------------------------------------------- /components/Settings/style.js: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from "react-native"; 2 | 3 | export const styles = StyleSheet.create({ 4 | avatar: { 5 | width: 60, 6 | height: 60, 7 | borderRadius: 50, 8 | marginRight: 15, 9 | backgroundColor: 'white', 10 | // padding: 25 11 | 12 | }, 13 | username: { 14 | fontWeight: 'bold', 15 | fontSize: 23, 16 | }, 17 | status: { 18 | fontSize: 18, 19 | color: 'grey', 20 | }, 21 | icon: { 22 | width: 40, 23 | height: 40, 24 | borderRadius: 50, 25 | marginRight: 5, 26 | // backgroundColor: 'white' 27 | 28 | }, 29 | }) -------------------------------------------------------------------------------- /components/Status/style.js: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from "react-native"; 2 | 3 | export const styles = StyleSheet.create({ 4 | avatar: { 5 | width: 60, 6 | height: 60, 7 | borderRadius: 50, 8 | marginRight: 15, 9 | backgroundColor: 'white', 10 | // padding: 25 11 | 12 | }, 13 | username: { 14 | fontWeight: 'bold', 15 | fontSize: 21, 16 | }, 17 | status: { 18 | fontSize: 18, 19 | color: 'grey', 20 | }, 21 | icon: { 22 | width: 40, 23 | height: 40, 24 | borderRadius: 50, 25 | marginRight: 5, 26 | // backgroundColor: 'white' 27 | 28 | }, 29 | }) -------------------------------------------------------------------------------- /components/UsersListItem/Style.js: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | 3 | const Style = StyleSheet.create({ 4 | container: { 5 | flexDirection: 'row', 6 | width: "100%", 7 | // justifyContent: 'space-between', 8 | padding: 10, 9 | }, 10 | lefContainer: { 11 | flexDirection: 'row', 12 | }, 13 | avatar: { 14 | width: 60, 15 | height: 60, 16 | borderRadius: 50, 17 | marginRight: 15, 18 | backgroundColor: 'gray' 19 | }, 20 | username: { 21 | fontWeight: 'bold', 22 | fontSize: 16, 23 | }, 24 | lastMessage: { 25 | fontSize: 16, 26 | color: 'grey', 27 | }, 28 | time: { 29 | fontSize: 14, 30 | color: 'grey', 31 | }, 32 | }); 33 | 34 | export default Style; -------------------------------------------------------------------------------- /components/chatListItem/Style.js: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | 3 | const Style = StyleSheet.create({ 4 | container: { 5 | flexDirection: 'row', 6 | width: "100%", 7 | // justifyContent: 'space-between', 8 | padding: 10, 9 | }, 10 | lefContainer: { 11 | flexDirection: 'row', 12 | }, 13 | avatar: { 14 | width: 60, 15 | height: 60, 16 | borderRadius: 50, 17 | marginRight: 15, 18 | backgroundColor: 'gray' 19 | }, 20 | username: { 21 | fontWeight: 'bold', 22 | fontSize: 16, 23 | }, 24 | lastMessage: { 25 | fontSize: 16, 26 | color: 'grey', 27 | }, 28 | time: { 29 | fontSize: 14, 30 | color: 'grey', 31 | }, 32 | }); 33 | 34 | export default Style; -------------------------------------------------------------------------------- /constants/Colors.ts: -------------------------------------------------------------------------------- 1 | const tintColorLight = '#34B7F1'; 2 | const tintColorDark = '#fff'; 3 | 4 | 5 | export default { 6 | light: { 7 | text: '#000', 8 | background: '#fff', 9 | tint: tintColorLight, 10 | tabIconDefault: '#ccc', 11 | tabIconSelected: tintColorLight, 12 | backgroundOpac: '#EEEEEE', 13 | incomingMsgBg: '#eee', 14 | outgoingMsgBg: '#dcf8c5' 15 | 16 | }, 17 | dark: { 18 | text: '#fff', 19 | background: '#000', 20 | tint: tintColorDark, 21 | tabIconDefault: '#ccc', 22 | tabIconSelected: tintColorDark, 23 | backgroundOpac: '#2C3333', 24 | incomingMsgBg: '#28282B', 25 | outgoingMsgBg: '#075E54' 26 | }, 27 | white:"#fff", 28 | black: "#000", 29 | sec: "#ccc" 30 | }; 31 | -------------------------------------------------------------------------------- /screens/CameraScreen.tsx: -------------------------------------------------------------------------------- 1 | import { Text, View } from '../components/Themed'; 2 | 3 | import { RootTabScreenProps } from '../types'; 4 | import { StyleSheet } from 'react-native'; 5 | 6 | export default function CameraScreen({ navigation }: RootTabScreenProps<'Camera'>) { 7 | return ( 8 | 9 | Camera Tab 10 | 11 | ); 12 | } 13 | 14 | const styles = StyleSheet.create({ 15 | container: { 16 | flex: 1, 17 | alignItems: 'center', 18 | justifyContent: 'center', 19 | }, 20 | title: { 21 | fontSize: 20, 22 | fontWeight: 'bold', 23 | }, 24 | separator: { 25 | marginVertical: 30, 26 | height: 1, 27 | width: '80%', 28 | }, 29 | }); 30 | -------------------------------------------------------------------------------- /components/ChatList.js: -------------------------------------------------------------------------------- 1 | import {FlatList, ScrollView} from 'react-native'; 2 | 3 | import ChatListItem from './chatListItem'; 4 | import ChatRooms from '../data/ChatRooms'; 5 | 6 | const ChatList = () => { 7 | const SortedChatData = ChatRooms.slice().sort((a, b) => new Date(b.lastMessage.createdAt) - new Date(a.lastMessage.createdAt)) 8 | return ( 9 | 10 | item.id} 15 | renderItem = {({item}) => ( 16 | 17 | )} 18 | 19 | /> 20 | 21 | ); 22 | 23 | } 24 | 25 | export default ChatList; -------------------------------------------------------------------------------- /components/callListItem/Style.js: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | 3 | const Style = StyleSheet.create({ 4 | container: { 5 | flexDirection: 'row', 6 | width: "100%", 7 | // justifyContent: 'space-between', 8 | padding: 10, 9 | }, 10 | lefContainer: { 11 | flexDirection: 'row', 12 | }, 13 | avatar: { 14 | width: 60, 15 | height: 60, 16 | borderRadius: 50, 17 | marginRight: 15, 18 | backgroundColor: 'gray' 19 | }, 20 | username: { 21 | fontWeight: 'bold', 22 | fontSize: 16, 23 | }, 24 | lastMessage: { 25 | fontSize: 16, 26 | color: 'grey', 27 | paddingLeft: 7 28 | }, 29 | time: { 30 | fontSize: 16, 31 | color: 'grey', 32 | paddingRight: 5 33 | }, 34 | }); 35 | 36 | export default Style; -------------------------------------------------------------------------------- /components/CallLog.js: -------------------------------------------------------------------------------- 1 | import CallListItem from '../components/callListItem'; 2 | import CallsData from '../data/CallsData'; 3 | import {FlatList} from 'react-native'; 4 | 5 | const CallLogs = ({type}) => { 6 | const SortedCallsData = type == "all"? CallsData.slice().sort((a, b) => new Date(b.date) - new Date(a.date)): CallsData.slice().filter((e) => e.type == "Missed") 7 | 8 | return ( 9 | 10 | item.id} 15 | renderItem = {({item}) => ( 16 | 17 | )} 18 | 19 | /> 20 | 21 | ); 22 | 23 | } 24 | 25 | export default CallLogs; -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "expo": { 3 | "name": "chabox", 4 | "slug": "chabox", 5 | "version": "1.0.0", 6 | "orientation": "portrait", 7 | "icon": "./assets/images/icon.png", 8 | "scheme": "myapp", 9 | "userInterfaceStyle": "automatic", 10 | "splash": { 11 | "image": "./assets/images/splash.png", 12 | "resizeMode": "contain", 13 | "backgroundColor": "#ffffff" 14 | }, 15 | "updates": { 16 | "fallbackToCacheTimeout": 0 17 | }, 18 | "assetBundlePatterns": [ 19 | "**/*" 20 | ], 21 | "ios": { 22 | "supportsTablet": true 23 | }, 24 | "android": { 25 | "adaptiveIcon": { 26 | "foregroundImage": "./assets/images/adaptive-icon.png", 27 | "backgroundColor": "#ffffff" 28 | } 29 | }, 30 | "web": { 31 | "favicon": "./assets/images/favicon.png" 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /headers/SettingsScreenHeader.js: -------------------------------------------------------------------------------- 1 | import { Pressable, SafeAreaView, StyleSheet, View } from 'react-native'; 2 | 3 | import Styles from '../constants/Styles'; 4 | import { Text } from '../components/Themed'; 5 | import tw from 'twrnc' 6 | import useColorScheme from '../hooks/useColorScheme'; 7 | 8 | const SettingsScreenHeader = (props) => { 9 | colorScheme = useColorScheme() 10 | return ( 11 | 12 | 13 | 14 | {props.showTitle? Settings: null} 15 | 16 | 17 | 18 | ); 19 | } 20 | 21 | const styles = StyleSheet.create({ 22 | bgTransparent: { 23 | backgroundColor: 'transparent', 24 | opacity: 1 25 | }, 26 | 27 | }); 28 | 29 | export default SettingsScreenHeader; -------------------------------------------------------------------------------- /navigation/LinkingConfiguration.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Learn more about deep linking with React Navigation 3 | * https://reactnavigation.org/docs/deep-linking 4 | * https://reactnavigation.org/docs/configuring-links 5 | */ 6 | 7 | import { LinkingOptions } from '@react-navigation/native'; 8 | import * as Linking from 'expo-linking'; 9 | 10 | import { RootStackParamList } from '../types'; 11 | 12 | const linking: LinkingOptions = { 13 | prefixes: [Linking.makeUrl('/')], 14 | config: { 15 | screens: { 16 | Root: { 17 | screens: { 18 | TabOne: { 19 | screens: { 20 | TabOneScreen: 'one', 21 | }, 22 | }, 23 | TabTwo: { 24 | screens: { 25 | TabTwoScreen: 'two', 26 | }, 27 | }, 28 | }, 29 | }, 30 | Modal: 'modal', 31 | NotFound: '*', 32 | }, 33 | }, 34 | }; 35 | 36 | export default linking; 37 | -------------------------------------------------------------------------------- /screens/AddLabelScreen.tsx: -------------------------------------------------------------------------------- 1 | import { ScrollView, StyleSheet, TextInput } from 'react-native'; 2 | import { Text, View } from '../components/Themed'; 3 | 4 | import Colors from '../constants/Colors'; 5 | import { RootTabScreenProps } from '../types'; 6 | import tw from 'twrnc' 7 | import useColorScheme from '../hooks/useColorScheme'; 8 | import AddLabelScreenHeader from '../headers/AddLabelScreenHeader'; 9 | import AddLabel from '../components/addLabel'; 10 | 11 | export default function AddLabelsScreen({ navigation }: RootTabScreenProps<'AddLabel'>) { 12 | const colorScheme = useColorScheme(); 13 | 14 | return ( 15 | 16 | 17 | 18 | 19 | ); 20 | } 21 | 22 | const styles = StyleSheet.create({ 23 | container: { 24 | paddingHorizontal: 15, 25 | minHeight: 800, 26 | flex: 1 27 | 28 | }, 29 | 30 | }); 31 | -------------------------------------------------------------------------------- /headers/LabelsScreenHeader.js: -------------------------------------------------------------------------------- 1 | import { SafeAreaView, StyleSheet } from 'react-native'; 2 | import { Text, View } from '../components/Themed'; 3 | 4 | import Colors from '../constants/Colors'; 5 | import tw from 'twrnc' 6 | import useColorScheme from '../hooks/useColorScheme'; 7 | import GoBack from '../components/GoBack'; 8 | 9 | const LabelsScreenHeader = (props) => { 10 | colorScheme = useColorScheme() 11 | return ( 12 | 13 | 14 | 15 | Labels 16 | 17 | 18 | 19 | 20 | ); 21 | } 22 | 23 | const styles = StyleSheet.create({ 24 | bgTransparent: { 25 | backgroundColor: 'transparent', 26 | opacity: 1 27 | }, 28 | 29 | }); 30 | 31 | export default LabelsScreenHeader; -------------------------------------------------------------------------------- /headers/QRScreenHeader.js: -------------------------------------------------------------------------------- 1 | import { SafeAreaView, StyleSheet } from 'react-native'; 2 | import { Text, View } from '../components/Themed'; 3 | 4 | import Colors from '../constants/Colors'; 5 | import tw from 'twrnc' 6 | import useColorScheme from '../hooks/useColorScheme'; 7 | import GoBack from '../components/GoBack'; 8 | 9 | const QRScreenHeader = (props) => { 10 | colorScheme = useColorScheme() 11 | return ( 12 | 13 | 14 | 15 | QR Code 16 | Scan 17 | 18 | 19 | 20 | ); 21 | } 22 | 23 | const styles = StyleSheet.create({ 24 | bgTransparent: { 25 | backgroundColor: 'transparent', 26 | opacity: 1 27 | }, 28 | 29 | }); 30 | 31 | export default QRScreenHeader; -------------------------------------------------------------------------------- /App.tsx: -------------------------------------------------------------------------------- 1 | import { LogBox } from 'react-native'; 2 | import Navigation from './navigation'; 3 | import { SafeAreaProvider } from 'react-native-safe-area-context'; 4 | import { StatusBar } from 'expo-status-bar'; 5 | import useCachedResources from './hooks/useCachedResources'; 6 | import useColorScheme from './hooks/useColorScheme'; 7 | import { useEffect } from 'react'; 8 | 9 | export default function App() { 10 | const isLoadingComplete = useCachedResources(); 11 | const colorScheme = useColorScheme(); 12 | 13 | useEffect(() => { 14 | LogBox.ignoreLogs(["VirtualizedLists should never be nested"]) 15 | }, []); 16 | 17 | LogBox.ignoreLogs([ 18 | "[react-native-gesture-handler] Seems like you\'re using an old API with gesture components, check out new Gestures system!", 19 | ]); 20 | 21 | if (!isLoadingComplete) { 22 | return null; 23 | } else { 24 | return ( 25 | 26 | 27 | 28 | 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /screens/NotFoundScreen.tsx: -------------------------------------------------------------------------------- 1 | import { StyleSheet, TouchableOpacity } from 'react-native'; 2 | 3 | import { Text, View } from '../components/Themed'; 4 | import { RootStackScreenProps } from '../types'; 5 | 6 | export default function NotFoundScreen({ navigation }: RootStackScreenProps<'NotFound'>) { 7 | return ( 8 | 9 | This screen doesn't exist. 10 | navigation.replace('Root')} style={styles.link}> 11 | Go to home screen! 12 | 13 | 14 | ); 15 | } 16 | 17 | const styles = StyleSheet.create({ 18 | container: { 19 | flex: 1, 20 | alignItems: 'center', 21 | justifyContent: 'center', 22 | padding: 20, 23 | }, 24 | title: { 25 | fontSize: 20, 26 | fontWeight: 'bold', 27 | }, 28 | link: { 29 | marginTop: 15, 30 | paddingVertical: 15, 31 | }, 32 | linkText: { 33 | fontSize: 14, 34 | color: '#2e78b7', 35 | }, 36 | }); 37 | -------------------------------------------------------------------------------- /components/Lists/SectionList.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types' 2 | import React from 'react' 3 | import {SectionList} from 'react-native' 4 | import SectionTitle from '../NewChatSectionTitle'; 5 | import UserListItem from '../UsersListItem'; 6 | 7 | const renderItem = ({item}) => 8 | 9 | const renderSectionHeader = ({section}) => 10 | 11 | const SectionListView = ({contacts}) => { 12 | const contactsByLetter = contacts.reduce((obj, contact) => { 13 | const firstLetter = contact.name[0].toUpperCase() 14 | return { 15 | ...obj, 16 | [firstLetter]: [...(obj[firstLetter] || []), contact], 17 | } 18 | }, {}) 19 | 20 | const sections = Object.keys(contactsByLetter).sort().map(letter => ({ 21 | data: contactsByLetter[letter], 22 | title: letter, 23 | })) 24 | 25 | return 26 | } 27 | 28 | SectionListView.propTypes = { 29 | contacts: PropTypes.array, 30 | } 31 | 32 | export default SectionListView 33 | -------------------------------------------------------------------------------- /screens/AddCallModalScreen.js: -------------------------------------------------------------------------------- 1 | import { Platform, StyleSheet } from 'react-native'; 2 | import { Text, View } from '../components/Themed'; 3 | 4 | import EditScreenInfo from '../components/EditScreenInfo'; 5 | import { StatusBar } from 'expo-status-bar'; 6 | 7 | export default function AddCallModalScreen() { 8 | return ( 9 | 10 | Add Call 11 | 12 | 13 | 14 | {/* Use a light status bar on iOS to account for the black space above the modal */} 15 | 16 | 17 | ); 18 | } 19 | 20 | const styles = StyleSheet.create({ 21 | container: { 22 | flex: 1, 23 | alignItems: 'center', 24 | justifyContent: 'center', 25 | }, 26 | title: { 27 | fontSize: 20, 28 | fontWeight: 'bold', 29 | }, 30 | separator: { 31 | marginVertical: 30, 32 | height: 1, 33 | width: '80%', 34 | }, 35 | }); 36 | -------------------------------------------------------------------------------- /screens/NewGroupModalScreen.js: -------------------------------------------------------------------------------- 1 | import { Platform, StyleSheet } from 'react-native'; 2 | import { Text, View } from '../components/Themed'; 3 | 4 | import EditScreenInfo from '../components/EditScreenInfo'; 5 | import { StatusBar } from 'expo-status-bar'; 6 | 7 | export default function NewGroupModalScreen() { 8 | return ( 9 | 10 | Modal 11 | 12 | 13 | 14 | {/* Use a light status bar on iOS to account for the black space above the modal */} 15 | 16 | 17 | ); 18 | } 19 | 20 | const styles = StyleSheet.create({ 21 | container: { 22 | flex: 1, 23 | alignItems: 'center', 24 | justifyContent: 'center', 25 | }, 26 | title: { 27 | fontSize: 20, 28 | fontWeight: 'bold', 29 | }, 30 | separator: { 31 | marginVertical: 30, 32 | height: 1, 33 | width: '80%', 34 | }, 35 | }); 36 | -------------------------------------------------------------------------------- /hooks/useCachedResources.ts: -------------------------------------------------------------------------------- 1 | import { FontAwesome } from '@expo/vector-icons'; 2 | import * as Font from 'expo-font'; 3 | import * as SplashScreen from 'expo-splash-screen'; 4 | import { useEffect, useState } from 'react'; 5 | 6 | export default function useCachedResources() { 7 | const [isLoadingComplete, setLoadingComplete] = useState(false); 8 | 9 | // Load any resources or data that we need prior to rendering the app 10 | useEffect(() => { 11 | async function loadResourcesAndDataAsync() { 12 | try { 13 | SplashScreen.preventAutoHideAsync(); 14 | 15 | // Load fonts 16 | await Font.loadAsync({ 17 | ...FontAwesome.font, 18 | 'space-mono': require('../assets/fonts/SpaceMono-Regular.ttf'), 19 | }); 20 | } catch (e) { 21 | // We might want to provide this error information to an error reporting service 22 | console.warn(e); 23 | } finally { 24 | setLoadingComplete(true); 25 | SplashScreen.hideAsync(); 26 | } 27 | } 28 | 29 | loadResourcesAndDataAsync(); 30 | }, []); 31 | 32 | return isLoadingComplete; 33 | } 34 | -------------------------------------------------------------------------------- /screens/LabelsScreen.tsx: -------------------------------------------------------------------------------- 1 | import { ScrollView, StyleSheet, TextInput } from 'react-native'; 2 | import { Text, View } from '../components/Themed'; 3 | 4 | import Colors from '../constants/Colors'; 5 | import LabelList from '../components/LabelList'; 6 | import LabelsScreenHeader from '../headers/LabelsScreenHeader' 7 | import { RootTabScreenProps } from '../types'; 8 | import tw from 'twrnc' 9 | import useColorScheme from '../hooks/useColorScheme'; 10 | 11 | export default function LabelsScreen({ navigation }: RootTabScreenProps<'Labels'>) { 12 | const colorScheme = useColorScheme(); 13 | 14 | return ( 15 | 16 | 17 | 22 | 23 | 24 | 25 | ); 26 | } 27 | 28 | const styles = StyleSheet.create({ 29 | container: { 30 | paddingHorizontal: 15, 31 | minHeight: 800, 32 | flex: 1 33 | 34 | }, 35 | 36 | }); 37 | -------------------------------------------------------------------------------- /data/Labels.js: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | id: 'L1', 4 | title: "Paid", 5 | color: "green", 6 | users: [{ 7 | id: 'u1', 8 | name: 'Vadim', 9 | imageUri: 'https://scontent.fkiv3-1.fna.fbcdn.net/v/t31.0-1/s200x200/22256588_1932617800312085_5686197942193420542_o.jpg?_nc_cat=110&_nc_sid=7206a8&_nc_eui2=AeF3UwtnAs3QLEJRnLSp4-hQxlokCBJZ6JPGWiQIElnok9HafHyjqv9D4bW9zeNFfNJlg5jLsvbewM7j5OD-OFy-&_nc_ohc=IxycgYSpqQEAX8EcTqI&_nc_ht=scontent.fkiv3-1.fna&tp=7&oh=640a83293bb75378958d22b633302f1b&oe=5F9F4BB7', 10 | }, { 11 | id: 'u7', 12 | name: '@qBentil', 13 | imageUri: 'https://codersquiz.netlify.app/img/bentil.jpeg', 14 | }] 15 | }, 16 | { 17 | id: 'L2', 18 | title: "Order Complete", 19 | color: "pink", 20 | users: [] 21 | }, 22 | { 23 | id: 'L3', 24 | title: "New Customer", 25 | color: "grey", 26 | users: [{ 27 | id: 'u7', 28 | name: '@qBentil', 29 | imageUri: 'https://codersquiz.netlify.app/img/bentil.jpeg', 30 | }] 31 | 32 | } 33 | ] -------------------------------------------------------------------------------- /components/labelListItem/index.tsx: -------------------------------------------------------------------------------- 1 | import { ChatRoom, Label } from '../../types'; 2 | import { Image, TouchableOpacity } from 'react-native'; 3 | import { Ionicons, MaterialCommunityIcons } from '@expo/vector-icons'; 4 | import { Text, View } from '../Themed'; 5 | 6 | import React from 'react'; 7 | import tw from 'twrnc' 8 | import styles from './style'; 9 | 10 | export type LabelListItemProp = { 11 | label: Label; 12 | } 13 | const LabelListItem = (props: LabelListItemProp) => { 14 | const { label } = props; 15 | return ( 16 | 17 | 18 | 19 | {label.title} 20 | 21 | 22 | {label.users.length} 23 | 24 | 25 | 26 | ) 27 | } 28 | 29 | export default LabelListItem; 30 | -------------------------------------------------------------------------------- /components/searchBar/index.js: -------------------------------------------------------------------------------- 1 | import { KeyboardAvoidingView, StyleSheet, TextInput, TouchableOpacity } from 'react-native'; 2 | import { Text, View } from '../Themed'; 3 | 4 | import Colors from '../../constants/Colors'; 5 | import { Ionicons } from '@expo/vector-icons'; 6 | import Style from './Style'; 7 | import tw from 'twrnc' 8 | import useColorScheme from '../../hooks/useColorScheme'; 9 | 10 | const SearchBar = ({style, search}) =>{ 11 | const colorScheme = useColorScheme(); 12 | return ( 13 | 18 | 19 | {search(searchString)}} 23 | underlineColorAndroid="transparent" 24 | placeholderTextColor={Colors[colorScheme].tabIconDefault} 25 | returnKeyType = {'search'} 26 | /> 27 | 28 | ); 29 | } 30 | 31 | export default SearchBar; 32 | 33 | -------------------------------------------------------------------------------- /components/GoBack.js: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import { TouchableOpacity } from "react-native" 3 | import { Ionicons } from "@expo/vector-icons" 4 | import Colors from "../constants/Colors" 5 | import { useNavigation } from "@react-navigation/native" 6 | import tw from 'twrnc' 7 | import { Text } from "./Themed" 8 | 9 | const GoBack = (props) => { 10 | // const backText = (props.label === undefined || props.label == 0) ? "Back" : props.label 11 | const showIcon = (props.showIcon === undefined) ? true: props.showIcon 12 | const navigation = useNavigation() 13 | return ( 14 | navigation.goBack()} 17 | style={[tw`flex-row`, props.style]} 18 | > 19 | {showIcon && ( 20 | 26 | )} 27 | {props.label} 30 | 31 | ) 32 | } 33 | 34 | 35 | export default GoBack; -------------------------------------------------------------------------------- /headers/StatusScreenHeader.js: -------------------------------------------------------------------------------- 1 | import { Pressable, SafeAreaView, StyleSheet } from 'react-native'; 2 | import { Text, View } from '../components/Themed'; 3 | 4 | import Colors from '../constants/Colors'; 5 | import { Feather } from '@expo/vector-icons'; 6 | import Styles from '../constants/Styles'; 7 | import tw from 'twrnc' 8 | import useColorScheme from '../hooks/useColorScheme'; 9 | import { useNavigation } from '@react-navigation/native'; 10 | 11 | const StatusScreenHeader = (props) => { 12 | colorScheme = useColorScheme() 13 | const navigation = useNavigation() 14 | return ( 15 | 16 | 17 | 18 | ({ 20 | opacity: pressed ? 0.5 : 1, 21 | })} 22 | onPress={() => navigation.navigate('StatusPrivacy')} 23 | > 24 | Privacy 25 | 26 | {props.showTitle? Status: null} 27 | 28 | 29 | 30 | ); 31 | } 32 | 33 | const styles = StyleSheet.create({ 34 | bgTransparent: { 35 | backgroundColor: 'transparent', 36 | opacity: 1 37 | }, 38 | 39 | }); 40 | 41 | export default StatusScreenHeader; -------------------------------------------------------------------------------- /headers/AddLabelScreenHeader.js: -------------------------------------------------------------------------------- 1 | import { Feather, Ionicons } from '@expo/vector-icons'; 2 | import { Pressable, SafeAreaView, StyleSheet, TouchableOpacity } from 'react-native'; 3 | import { Text, View } from '../components/Themed'; 4 | 5 | import Colors from '../constants/Colors'; 6 | import tw from 'twrnc' 7 | import useColorScheme from '../hooks/useColorScheme'; 8 | import { useNavigation } from '@react-navigation/native'; 9 | import GoBack from '../components/GoBack'; 10 | 11 | const AddLabelScreenHeader = (props) => { 12 | colorScheme = useColorScheme() 13 | const navigation = useNavigation() 14 | return ( 15 | 16 | 17 | 18 | Add New Label 19 | 20 | Save 21 | 22 | 23 | 24 | 25 | ); 26 | } 27 | 28 | const styles = StyleSheet.create({ 29 | bgTransparent: { 30 | backgroundColor: 'transparent', 31 | opacity: 1 32 | }, 33 | 34 | }); 35 | 36 | export default AddLabelScreenHeader; -------------------------------------------------------------------------------- /screens/CallsScreen.tsx: -------------------------------------------------------------------------------- 1 | import { ScrollView, StyleSheet } from 'react-native'; 2 | import { Text, View } from '../components/Themed'; 3 | 4 | import CallLogs from "../components/CallLog" 5 | import CallScreenHeader from '../headers/CallScreenHeader' 6 | import Colors from '../constants/Colors'; 7 | import SearchBar from '../components/searchBar'; 8 | import useColorScheme from '../hooks/useColorScheme'; 9 | import { useState } from 'react'; 10 | 11 | export default function CallsScreen() { 12 | const [logType, setLogType] = useState('all'); 13 | const colorScheme = useColorScheme() 14 | 15 | // Search func 16 | const onSearch = (name: string) => { 17 | console.log(name); 18 | } 19 | return ( 20 | 21 | 22 | 23 | Calls 24 | 25 | 26 | 27 | 28 | ); 29 | } 30 | 31 | const styles = StyleSheet.create({ 32 | container: { 33 | paddingHorizontal: 15, 34 | minHeight: 800, 35 | flex: 1 36 | }, 37 | title: { 38 | fontSize: 35, 39 | fontWeight: '600', 40 | }, 41 | separator: { 42 | marginVertical: 30, 43 | height: 1, 44 | width: '80%', 45 | }, 46 | }); 47 | -------------------------------------------------------------------------------- /components/addLabel/index.tsx: -------------------------------------------------------------------------------- 1 | import { Text, View } from "../Themed"; 2 | import { style } from "./style"; 3 | import tw from 'twrnc' 4 | import { TextInput } from "react-native"; 5 | import Colors from "../../constants/Colors"; 6 | import useColorScheme from "../../hooks/useColorScheme"; 7 | import ColorPicker from 'react-native-wheel-color-picker' 8 | 9 | const AddLabel = () => { 10 | const colorScheme = useColorScheme() 11 | return( 12 | 13 | 14 | 15 | {/* */} 21 | 22 | 23 | 28 | 100 29 | 30 | 31 | 32 | ) 33 | } 34 | 35 | 36 | export default AddLabel; -------------------------------------------------------------------------------- /headers/NewChatModalHeader.js: -------------------------------------------------------------------------------- 1 | import { Pressable, SafeAreaView, StyleSheet, TouchableOpacity, View } from 'react-native'; 2 | 3 | import Colors from '../constants/Colors'; 4 | import { Ionicons } from '@expo/vector-icons'; 5 | import { Text } from '../components/Themed'; 6 | import tw from 'twrnc' 7 | import useColorScheme from '../hooks/useColorScheme'; 8 | import { useNavigation } from '@react-navigation/native'; 9 | import { useState } from 'react'; 10 | 11 | const NewChatModalHeader = () => { 12 | colorScheme = useColorScheme() 13 | const navigation = useNavigation() 14 | 15 | return ( 16 | 17 | 18 | 19 | New Chat 20 | 21 | 22 | 23 | 24 | 25 | 26 | ); 27 | } 28 | 29 | const styles = StyleSheet.create({ 30 | bgTransparent: { 31 | backgroundColor: 'transparent', 32 | opacity: 1 33 | }, 34 | toggler: { 35 | borderRadius: 8, 36 | width: 160, 37 | padding: 1.5 38 | }, 39 | itemActive: { 40 | backgroundColor: 'white', 41 | borderRadius: 8, 42 | }, 43 | 44 | }); 45 | 46 | 47 | // export const {logType} = NewChatModalHeader; 48 | 49 | export default NewChatModalHeader; -------------------------------------------------------------------------------- /components/Themed.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Learn more about Light and Dark modes: 3 | * https://docs.expo.io/guides/color-schemes/ 4 | */ 5 | 6 | import { Text as DefaultText, View as DefaultView } from 'react-native'; 7 | 8 | import Colors from '../constants/Colors'; 9 | import useColorScheme from '../hooks/useColorScheme'; 10 | 11 | export function useThemeColor( 12 | props: { light?: string; dark?: string }, 13 | colorName: keyof typeof Colors.light & keyof typeof Colors.dark 14 | ) { 15 | const theme = useColorScheme(); 16 | const colorFromProps = props[theme]; 17 | 18 | if (colorFromProps) { 19 | return colorFromProps; 20 | } else { 21 | return Colors[theme][colorName]; 22 | } 23 | } 24 | 25 | type ThemeProps = { 26 | lightColor?: string; 27 | darkColor?: string; 28 | }; 29 | 30 | export type TextProps = ThemeProps & DefaultText['props']; 31 | export type ViewProps = ThemeProps & DefaultView['props']; 32 | 33 | export function Text(props: TextProps) { 34 | const { style, lightColor, darkColor, ...otherProps } = props; 35 | const color = useThemeColor({ light: lightColor, dark: darkColor }, 'text'); 36 | 37 | return ; 38 | } 39 | 40 | export function View(props: ViewProps) { 41 | const { style, lightColor, darkColor, ...otherProps } = props; 42 | const backgroundColor = useThemeColor({ light: lightColor, dark: darkColor }, 'background'); 43 | 44 | return ; 45 | } 46 | -------------------------------------------------------------------------------- /headers/ChatScreenHeader.js: -------------------------------------------------------------------------------- 1 | import { Pressable, SafeAreaView, StyleSheet } from 'react-native'; 2 | import { Text, View } from '../components/Themed'; 3 | 4 | import Colors from '../constants/Colors'; 5 | import { Feather } from '@expo/vector-icons'; 6 | import Styles from '../constants/Styles'; 7 | import tw from 'twrnc' 8 | import useColorScheme from '../hooks/useColorScheme'; 9 | import { useNavigation } from '@react-navigation/native'; 10 | 11 | const ChatScreenHeader = (props) => { 12 | colorScheme = useColorScheme() 13 | const navigation = useNavigation() 14 | return ( 15 | 16 | 17 | Edit 18 | {props.showTitle? WA Businnes: null} 19 | ({ 21 | opacity: pressed ? 0.5 : 1, 22 | })} 23 | onPress={() => navigation.navigate('Modal')} 24 | > 25 | 31 | 32 | 33 | 34 | ); 35 | } 36 | 37 | const styles = StyleSheet.create({ 38 | bgTransparent: { 39 | backgroundColor: 'transparent', 40 | opacity: 1 41 | }, 42 | 43 | }); 44 | 45 | export default ChatScreenHeader; -------------------------------------------------------------------------------- /components/chatMessage/index.tsx: -------------------------------------------------------------------------------- 1 | import { Text, View } from '../Themed'; 2 | 3 | import Colors from '../../constants/Colors'; 4 | import React from 'react'; 5 | import Styles from './style'; 6 | import { chatMessageProps } from '../../types'; 7 | import moment from 'moment'; 8 | import tw from 'twrnc' 9 | import useColorScheme from '../../hooks/useColorScheme'; 10 | 11 | // import { Text, View } from 'react-native'; 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | const ChatMessage = (props: chatMessageProps) => { 20 | const {message} = props; 21 | const colorScheme = useColorScheme(); 22 | 23 | // Check for incoming and outgoing messages 24 | const isMyMessage = () => message.user.id === "u1"; 25 | 26 | return ( 27 | 28 | 35 | {!isMyMessage() && ({message.user.name})} 36 | {message.content} 37 | {moment(message.createdAt).fromNow()} 38 | 39 | 40 | ) 41 | } 42 | 43 | export default ChatMessage; -------------------------------------------------------------------------------- /screens/ChatRoomScreen.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react' 2 | 3 | import {Text, View} from '../components/Themed' 4 | 5 | import ChatMessage from '../components/chatMessage' 6 | import ChatRoomData from '../data/Chats' 7 | import ChatRoomScreenHeader from '../headers/ChatRoomScreenHeader' 8 | import { FlatList } from 'react-native-gesture-handler' 9 | import { ImageBackground } from 'react-native' 10 | import InputBox from '../components/inputBox' 11 | import tw from 'twrnc' 12 | import { useRoute } from '@react-navigation/native' 13 | import { user } from '../types' 14 | 15 | // import BG from '../assets/images/BG.png' 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | const ChatRoomScreen = () => { 26 | const route = useRoute(); 27 | // useRoute Hook is used to access the params passed through the useNavigateion hook 28 | const user:user = route.params as user; 29 | 30 | return( 31 | 32 | 33 | item.id} 40 | renderItem = {({item}) => } 41 | /> 42 | {/* Input Box */} 43 | 44 | 45 | ) 46 | } 47 | 48 | export default ChatRoomScreen -------------------------------------------------------------------------------- /screens/StatusPrivacy.tsx: -------------------------------------------------------------------------------- 1 | import { ScrollView, StyleSheet, TextInput } from 'react-native'; 2 | import { Text, View } from '../components/Themed'; 3 | 4 | import AddLabel from '../components/addLabel'; 5 | import AddLabelScreenHeader from '../headers/AddLabelScreenHeader'; 6 | import Colors from '../constants/Colors'; 7 | import PrivacyItem from '../components/Status/PrivacyItem'; 8 | import { RootTabScreenProps } from '../types'; 9 | import tw from 'twrnc' 10 | import useColorScheme from '../hooks/useColorScheme'; 11 | 12 | export default function StatusPrivacy({ navigation }: RootTabScreenProps<'AddLabel'>) { 13 | const colorScheme = useColorScheme(); 14 | 15 | return ( 16 | 17 | 18 | WHo will see my updates 19 | 20 | 21 | 22 | 23 | 24 | 25 | Changes to your privacy settings won't affect status updates that you've sent already 26 | 27 | 28 | ); 29 | } 30 | 31 | const styles = StyleSheet.create({ 32 | container: { 33 | paddingHorizontal: 15, 34 | minHeight: 800, 35 | flex: 1 36 | 37 | }, 38 | 39 | }); 40 | -------------------------------------------------------------------------------- /components/UsersListItem/index.js: -------------------------------------------------------------------------------- 1 | import { Image, TouchableOpacity } from 'react-native'; 2 | import { Text, View } from '../Themed'; 3 | 4 | import Colors from '../../constants/Colors'; 5 | import React from 'react'; 6 | import Style from './Style'; 7 | import tw from 'twrnc' 8 | import useColorScheme from '../../hooks/useColorScheme'; 9 | import { useNavigation } from '@react-navigation/native'; 10 | 11 | const UserListItem = ({user}) => { 12 | const navigation = useNavigation(); 13 | 14 | const colorScheme = useColorScheme() 15 | const onClick = () => { 16 | // console.log(user.id); 17 | navigation.navigate("ChatRoom", { 18 | id: user.id, 19 | name: user.name, 20 | imageUri: user.imageUri 21 | }) 22 | } 23 | 24 | return ( 25 | onClick()} style={Style.container}> 26 | 27 | 33 | 34 | 35 | 36 | {user.name} 37 | {user.status} 38 | 39 | {/* 40 | 41 | {date} 42 | 43 | */} 44 | 45 | 46 | ) 47 | } 48 | export default UserListItem; 49 | -------------------------------------------------------------------------------- /components/Status/PrivacyItem.js: -------------------------------------------------------------------------------- 1 | import { AntDesign, Fontisto, Ionicons, MaterialCommunityIcons, MaterialIcons } from '@expo/vector-icons'; 2 | import { TouchableOpacity, View } from 'react-native'; 3 | 4 | import Colors from '../../constants/Colors'; 5 | import React from 'react'; 6 | import { Text } from '../Themed'; 7 | import tw from 'twrnc' 8 | import useColorScheme from '../../hooks/useColorScheme'; 9 | import { useNavigation } from '@react-navigation/native'; 10 | 11 | const PrivacyItem = ({title, desc, children = false, showIcon = false, style = {}}) => { 12 | const colorScheme = useColorScheme() 13 | const navigation = useNavigation() 14 | return ( 15 | 16 | 17 | 18 | {showIcon && } 19 | 20 | 21 | {title} 22 | {desc} 23 | 24 | 25 | {children && } 26 | 27 | ) 28 | } 29 | 30 | export default PrivacyItem; 31 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "chabox", 3 | "version": "1.0.0", 4 | "main": "node_modules/expo/AppEntry.js", 5 | "scripts": { 6 | "start": "expo start", 7 | "android": "expo start --android", 8 | "ios": "expo start --ios", 9 | "web": "expo start --web", 10 | "eject": "expo eject", 11 | "test": "jest --watchAll" 12 | }, 13 | "jest": { 14 | "preset": "jest-expo" 15 | }, 16 | "dependencies": { 17 | "@expo/vector-icons": "^12.0.0", 18 | "@react-navigation/bottom-tabs": "^6.0.5", 19 | "@react-navigation/material-top-tabs": "^6.1.1", 20 | "@react-navigation/native": "^6.0.2", 21 | "@react-navigation/native-stack": "^6.1.0", 22 | "@react-navigation/stack": "^6.1.1", 23 | "expo": "~44.0.0", 24 | "expo-asset": "~8.4.4", 25 | "expo-constants": "~13.0.0", 26 | "expo-font": "~10.0.4", 27 | "expo-linking": "~3.0.0", 28 | "expo-splash-screen": "~0.14.0", 29 | "expo-status-bar": "~1.2.0", 30 | "expo-web-browser": "~10.1.0", 31 | "moment": "^2.29.1", 32 | "moment-duration-format": "^2.3.2", 33 | "moment-timezone": "^0.5.34", 34 | "react": "17.0.1", 35 | "react-dom": "17.0.1", 36 | "react-moment": "^1.1.1", 37 | "react-native": "0.64.3", 38 | "react-native-pager-view": "5.4.9", 39 | "react-native-reanimated": "~2.3.1", 40 | "react-native-safe-area-context": "3.3.2", 41 | "react-native-screens": "~3.10.1", 42 | "react-native-tab-view": "^3.1.1", 43 | "react-native-web": "0.17.1", 44 | "react-native-wheel-color-picker": "^1.2.0", 45 | "twrnc": "^3.0.2" 46 | }, 47 | "devDependencies": { 48 | "@babel/core": "^7.12.9", 49 | "@types/react": "~17.0.21", 50 | "@types/react-native": "~0.64.12", 51 | "jest": "^26.6.3", 52 | "jest-expo": "~44.0.1", 53 | "react-test-renderer": "17.0.1", 54 | "typescript": "~4.3.5" 55 | }, 56 | "private": true 57 | } 58 | -------------------------------------------------------------------------------- /screens/StatusScreen.tsx: -------------------------------------------------------------------------------- 1 | import { ScrollView, StyleSheet } from 'react-native'; 2 | import { Text, View } from '../components/Themed'; 3 | 4 | import Colors from '../constants/Colors'; 5 | import { RootTabScreenProps } from '../types'; 6 | import SearchBar from '../components/searchBar'; 7 | import StatusProfile from '../components/Status'; 8 | import StatusScreenHeader from '../headers/StatusScreenHeader'; 9 | import useColorScheme from '../hooks/useColorScheme'; 10 | import { useState } from 'react'; 11 | 12 | export default function StatusScreen({ navigation }: RootTabScreenProps<'Chats'>) { 13 | const colorScheme = useColorScheme(); 14 | const [titleShown, setTitleShown] = useState(false) 15 | const handleScroll = function(event: Object) { 16 | event.nativeEvent.contentOffset.y <= 0 ? setTitleShown(false): setTitleShown(true) 17 | } 18 | 19 | const onSearch = (name:string) => { 20 | console.log(name); 21 | 22 | } 23 | 24 | return ( 25 | 26 | 27 | 34 | {!titleShown && Status} 35 | 36 | 37 | 38 | 39 | ); 40 | } 41 | 42 | const styles = StyleSheet.create({ 43 | container: { 44 | paddingHorizontal: 15, 45 | minHeight: 800, 46 | flex: 1 47 | 48 | }, 49 | title: { 50 | fontSize: 35, 51 | fontWeight: '600', 52 | }, 53 | 54 | }); 55 | -------------------------------------------------------------------------------- /components/EditScreenInfo.tsx: -------------------------------------------------------------------------------- 1 | import * as WebBrowser from 'expo-web-browser'; 2 | 3 | import { StyleSheet, TouchableOpacity } from 'react-native'; 4 | import { Text, View } from './Themed'; 5 | 6 | import Colors from '../constants/Colors'; 7 | import { MonoText } from './StyledText'; 8 | 9 | export default function EditScreenInfo({ path }: { path: string }) { 10 | return ( 11 | 12 | 13 | 17 | Open up the code for this screen: 18 | 19 | 20 | 24 | {"path"} 25 | 26 | 27 | 31 | Change any of the text, save the file, and your app will automatically update. 32 | 33 | 34 | 35 | ); 36 | } 37 | 38 | 39 | const styles = StyleSheet.create({ 40 | getStartedContainer: { 41 | alignItems: 'center', 42 | marginHorizontal: 50, 43 | }, 44 | homeScreenFilename: { 45 | marginVertical: 7, 46 | }, 47 | codeHighlightContainer: { 48 | borderRadius: 3, 49 | paddingHorizontal: 4, 50 | }, 51 | getStartedText: { 52 | fontSize: 17, 53 | lineHeight: 24, 54 | textAlign: 'center', 55 | }, 56 | helpContainer: { 57 | marginTop: 15, 58 | marginHorizontal: 20, 59 | alignItems: 'center', 60 | }, 61 | helpLink: { 62 | paddingVertical: 15, 63 | }, 64 | helpLinkText: { 65 | textAlign: 'center', 66 | }, 67 | }); 68 | -------------------------------------------------------------------------------- /components/Settings/profile.tsx: -------------------------------------------------------------------------------- 1 | import { Image, TouchableOpacity, View } from 'react-native'; 2 | import { Ionicons, MaterialCommunityIcons } from '@expo/vector-icons'; 3 | 4 | import Colors from '../../constants/Colors'; 5 | import React from 'react'; 6 | import { Text } from '../Themed'; 7 | import profile from '../../data/profile'; 8 | import { styles } from './style'; 9 | import tw from 'twrnc' 10 | import useColorScheme from '../../hooks/useColorScheme'; 11 | import { useNavigation } from '@react-navigation/native'; 12 | 13 | const Profile = () => { 14 | const colorScheme = useColorScheme() 15 | const navigation = useNavigation() 16 | return ( 17 | 18 | 19 | 23 | 24 | {profile.name} 25 | {profile.status} 26 | 27 | 28 | navigation.navigate("QRScan")} 32 | > 33 | 34 | 35 | 36 | ) 37 | } 38 | 39 | export default Profile; 40 | -------------------------------------------------------------------------------- /screens/ChatScreen.tsx: -------------------------------------------------------------------------------- 1 | import { ScrollView, StyleSheet, TextInput } from 'react-native'; 2 | import { Text, View } from '../components/Themed'; 3 | 4 | import ChatList from '../components/ChatList'; 5 | import ChatNavs from '../components/ChatNavs'; 6 | import ChatScreenHeader from '../headers/ChatScreenHeader'; 7 | import Colors from '../constants/Colors'; 8 | import { RootTabScreenProps } from '../types'; 9 | import SearchBar from '../components/searchBar'; 10 | import useColorScheme from '../hooks/useColorScheme'; 11 | import { useState } from 'react'; 12 | 13 | export default function ChatScreen({ navigation }: RootTabScreenProps<'Chats'>) { 14 | const colorScheme = useColorScheme(); 15 | const [titleShown, setTitleShown] = useState(false) 16 | const handleScroll = function(event: Object) { 17 | event.nativeEvent.contentOffset.y <= 0 ? setTitleShown(false): setTitleShown(true) 18 | } 19 | 20 | const onSearch = (name:string) => { 21 | console.log(name); 22 | 23 | } 24 | 25 | return ( 26 | 27 | 28 | 35 | {!titleShown && WA Business} 36 | 37 | 38 | 39 | 40 | 41 | ); 42 | } 43 | 44 | const styles = StyleSheet.create({ 45 | container: { 46 | paddingHorizontal: 15, 47 | minHeight: 800, 48 | flex: 1 49 | 50 | }, 51 | title: { 52 | fontSize: 35, 53 | fontWeight: '600', 54 | }, 55 | 56 | }); 57 | -------------------------------------------------------------------------------- /components/NewChatNav.js: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { AntDesign, Feather, FontAwesome5, Fontisto, MaterialCommunityIcons } from '@expo/vector-icons'; 4 | import { StyleSheet, Text, TouchableOpacity, View, useColorScheme } from 'react-native'; 5 | 6 | import Colors from '../constants/Colors'; 7 | import tw from 'twrnc' 8 | import { useNavigation } from '@react-navigation/native' 9 | 10 | const NewChatNavs = () => { 11 | const colorScheme = useColorScheme(); 12 | const navigation = useNavigation(); 13 | return ( 14 | 15 | 16 | 19 | 20 | rounded-full`, {backgroundColor: Colors[colorScheme].backgroundOpac}]}> 21 | 22 | 23 | New Group 24 | 25 | 26 | 27 | 28 | navigation.navigate("LabelsScreen")} 31 | > 32 | 33 | 34 | 35 | 36 | New Contact 37 | 38 | 39 | 40 | 41 | ); 42 | }; 43 | 44 | export default NewChatNavs; 45 | 46 | const styles = StyleSheet.create({ 47 | container: {} 48 | }); 49 | -------------------------------------------------------------------------------- /components/LabelList.js: -------------------------------------------------------------------------------- 1 | import {FlatList, TouchableOpacity} from 'react-native'; 2 | 3 | import LabelListItem from './labelListItem'; 4 | import Labels from '../data/Labels'; 5 | import { View, Text } from './Themed'; 6 | import tw from 'twrnc' 7 | import Colors from '../constants/Colors'; 8 | import useColorScheme from '../hooks/useColorScheme'; 9 | import { useNavigation } from '@react-navigation/native'; 10 | const LabelList = () => { 11 | const colorScheme = useColorScheme() 12 | const navigation = useNavigation() 13 | return ( 14 | 15 | 16 | item.id} 21 | renderItem = {({item}) => ( 22 | 23 | )} 24 | ItemSeparatorComponent = {() => ( 25 | 26 | )} 27 | /> 28 | {/* add Label button */} 29 | 30 | navigation.navigate("AddLabel")}> 31 | Add New Label 32 | 33 | 34 | 35 | 36 | Use labels to organize your customers and chats. 37 | 38 | Learn more 39 | 40 | 41 | 42 | 43 | ); 44 | 45 | } 46 | 47 | export default LabelList; -------------------------------------------------------------------------------- /headers/ChatRoomScreenHeader.js: -------------------------------------------------------------------------------- 1 | import { Feather, Ionicons } from '@expo/vector-icons'; 2 | import { Image, SafeAreaView, StyleSheet, TouchableOpacity } from 'react-native'; 3 | import { Text, View } from '../components/Themed'; 4 | 5 | import Colors from '../constants/Colors'; 6 | import GoBack from '../components/GoBack'; 7 | import tw from 'twrnc' 8 | import useColorScheme from '../hooks/useColorScheme'; 9 | 10 | const ChatRoomScreenHeader = ({user}) => { 11 | colorScheme = useColorScheme() 12 | return ( 13 | 14 | 15 | 16 | 17 | 21 | 22 | {user.name} 23 | 5 minutes ago 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | ); 37 | } 38 | 39 | const styles = StyleSheet.create({ 40 | container: { 41 | alignContent: 'center', 42 | alignItems: 'center' 43 | }, 44 | avatar: { 45 | width: 42, 46 | height: 42, 47 | borderRadius: 50, 48 | marginRight: 15, 49 | backgroundColor: 'gray' 50 | } 51 | 52 | }); 53 | 54 | export default ChatRoomScreenHeader; -------------------------------------------------------------------------------- /types.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Learn more about using TypeScript with React Navigation: 3 | * https://reactnavigation.org/docs/typescript/ 4 | */ 5 | 6 | import { CompositeScreenProps, NavigatorScreenParams } from '@react-navigation/native'; 7 | 8 | import { BottomTabScreenProps } from '@react-navigation/bottom-tabs'; 9 | import { NativeStackScreenProps } from '@react-navigation/native-stack'; 10 | 11 | declare global { 12 | namespace ReactNavigation { 13 | interface RootParamList extends RootStackParamList {} 14 | } 15 | } 16 | 17 | export type RootStackParamList = { 18 | Root: NavigatorScreenParams | undefined; 19 | NewGroupModal: undefined; 20 | AddCallModal: undefined; 21 | Modal: undefined; 22 | NotFound: undefined; 23 | LabelsScreen: undefined; 24 | QRScan: undefined; 25 | AddLabel: undefined; 26 | StatusPrivacy: undefined; 27 | ChatRoom: { 28 | id: string, 29 | name: string, 30 | imageUri: string 31 | }; 32 | 33 | }; 34 | 35 | export type RootStackScreenProps = NativeStackScreenProps< 36 | RootStackParamList, 37 | Screen 38 | >; 39 | 40 | export type RootTabParamList = { 41 | Camera: undefined; 42 | Chats: undefined; 43 | Settings: undefined; 44 | Status: undefined; 45 | Calls: undefined; 46 | AddLabel: undefined; 47 | Labels: undefined; 48 | QRScreen: undefined; 49 | }; 50 | 51 | export type ChatRoom = { 52 | id: string; 53 | users: user[]; 54 | lastMessage: Message; 55 | } 56 | 57 | export type Call = { 58 | id: string, 59 | mode: string, 60 | type: string, 61 | user: user, 62 | date: string 63 | } 64 | 65 | export type CallLog = { 66 | calls : Call[] 67 | } 68 | 69 | export type user = { 70 | id: string; 71 | name: string; 72 | imageUri: string; 73 | } 74 | 75 | export type Message = { 76 | id: string; 77 | content: string; 78 | createdAt: string; 79 | user: user; 80 | } 81 | 82 | export type Label = { 83 | id: string; 84 | title: string; 85 | color: string; 86 | users: user[] 87 | } 88 | 89 | export type chatMessageProps = { 90 | message: Message 91 | } 92 | 93 | export type RootTabScreenProps = CompositeScreenProps< 94 | BottomTabScreenProps, 95 | NativeStackScreenProps 96 | >; 97 | -------------------------------------------------------------------------------- /components/chatListItem/index.tsx: -------------------------------------------------------------------------------- 1 | import { Image, TouchableOpacity } from 'react-native'; 2 | import { Text, View } from '../Themed'; 3 | 4 | import { ChatRoom } from '../../types'; 5 | import Colors from '../../constants/Colors'; 6 | import React from 'react'; 7 | import Style from './Style'; 8 | import moment from 'moment'; 9 | import tw from 'twrnc' 10 | import useColorScheme from '../../hooks/useColorScheme'; 11 | import { useNavigation } from '@react-navigation/native'; 12 | 13 | export type ChatListItemProp = { 14 | chatRoom: ChatRoom; 15 | } 16 | const ChatListItem = (props: ChatListItemProp) => { 17 | const { chatRoom } = props; 18 | const navigation = useNavigation(); 19 | const user = chatRoom.users[1]; 20 | const colorScheme = useColorScheme() 21 | const onClick = () => { 22 | navigation.navigate("ChatRoom", { 23 | // How to pass Data to next screen during navigation 24 | id: chatRoom.id, 25 | name: user.name, 26 | imageUri: user.imageUri 27 | }) 28 | } 29 | 30 | // fix date 31 | let date = moment(chatRoom.lastMessage.createdAt).calendar() 32 | if(date.split(" ")[0] == "Today") 33 | { 34 | date = moment(chatRoom.lastMessage.createdAt).format("LT") 35 | }else if (date.split(" ")[0] == "Yesterday") 36 | { 37 | date = date.split(" ")[0] 38 | }else if (date.split(" ")[0] == "Last") 39 | { 40 | date = date.split(" ")[1] 41 | } 42 | 43 | return ( 44 | onClick()} style={Style.container}> 45 | 46 | 52 | 53 | 54 | 55 | {user.name} 56 | {chatRoom.lastMessage.content} 57 | 58 | 59 | 60 | {date} 61 | 62 | 63 | 64 | 65 | ) 66 | } 67 | export default ChatListItem; 68 | -------------------------------------------------------------------------------- /screens/NewChatModalScreen.tsx: -------------------------------------------------------------------------------- 1 | import { Platform, ScrollView, StyleSheet } from 'react-native'; 2 | import { Text, View } from '../components/Themed'; 3 | 4 | import ContactList from '../components/ContactList'; 5 | import NewChatNavs from '../components/NewChatNav'; 6 | import SearchBar from '../components/searchBar'; 7 | import SectionTitle from '../components/NewChatSectionTitle'; 8 | import { StatusBar } from 'expo-status-bar'; 9 | import Users from '../data/Users'; 10 | import tw from 'twrnc'; 11 | import useColorScheme from '../hooks/useColorScheme'; 12 | import { useState } from 'react'; 13 | 14 | const Freqs: Array = []; 15 | export default function NewChatModalScreen() { 16 | const [users, setUsers] = useState(Users); 17 | const [query, setQuery] = useState('') 18 | const colorScheme = useColorScheme(); 19 | 20 | const filteredUsers =query === '' ? Users: Users.filter((user) => 21 | user.name 22 | .toLowerCase() 23 | .replace(/\s+/g, '') 24 | .includes(query.toLowerCase().replace(/\s+/g, '')) 25 | ) 26 | const onSearch = (name: string) => { 27 | setQuery(name); 28 | } 29 | return ( 30 | 31 | {/* Use a light status bar on iOS to account for the black space above the modal */} 32 | 33 | {/* */} 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | { 42 | Freqs.length > 0 && ( 43 | 44 | 45 | 46 | ) 47 | } 48 | 52 | 53 | 54 | 55 | 56 | 57 | ); 58 | } 59 | 60 | const styles = StyleSheet.create({ 61 | container: { 62 | flex: 1, 63 | alignItems: 'center', 64 | justifyContent: 'center', 65 | }, 66 | title: { 67 | fontSize: 20, 68 | fontWeight: 'bold', 69 | }, 70 | separator: { 71 | marginVertical: 30, 72 | height: 1, 73 | width: '80%', 74 | }, 75 | }); 76 | 77 | -------------------------------------------------------------------------------- /components/callListItem/index.tsx: -------------------------------------------------------------------------------- 1 | import { Image, TouchableOpacity } from 'react-native'; 2 | import { Text, View } from '../Themed'; 3 | 4 | import { Call } from '../../types'; 5 | import Colors from '../../constants/Colors'; 6 | import { Ionicons } from '@expo/vector-icons'; 7 | import React from 'react'; 8 | import Style from './Style'; 9 | import moment from 'moment'; 10 | import tw from 'twrnc' 11 | import useColorScheme from '../../hooks/useColorScheme'; 12 | import { useNavigation } from '@react-navigation/native'; 13 | 14 | export type CallListItemProp = { 15 | call: Call; 16 | } 17 | const CallListItem = (props: CallListItemProp) => { 18 | const { call } = props; 19 | const navigation = useNavigation(); 20 | const colorScheme = useColorScheme() 21 | let date = moment(call.date).calendar() 22 | if(date.split(" ")[0] == "Today") 23 | { 24 | date = moment(call.date).format("LT") 25 | }else if (date.split(" ")[0] == "Yesterday") 26 | { 27 | date = date.split(" ")[0] 28 | }else if (date.split(" ")[0] == "Last") 29 | { 30 | date = date.split(" ")[1] 31 | } 32 | return ( 33 | 34 | 35 | 41 | 42 | 43 | 44 | {call.user.name} 45 | 46 | 47 | {call.type} 48 | 49 | 50 | 51 | 52 | {date } 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | ) 61 | } 62 | export default CallListItem; 63 | -------------------------------------------------------------------------------- /data/StatusUpdates.js: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | user: { 4 | id: 'u1', 5 | name: 'AllyTyson', 6 | imageUri: 'https://avatars.githubusercontent.com/u/88384474?v=4', 7 | }, 8 | updates: [ 9 | { 10 | id: 's1', 11 | types: 'text', 12 | content: 'I am like the air, you no fit catch me \n ~Wale', 13 | caption: null, 14 | createdAt: '2022-02-20T15:40:00.000Z', 15 | }, 16 | { 17 | id: 's2', 18 | types: 'photo', 19 | content: 'https://codersquiz.netlify.app/img/bentil.jpeg', 20 | caption: 'For God is', 21 | createdAt: '2022-02-20T15:40:00.000Z', 22 | }, 23 | ] 24 | }, 25 | { 26 | user: { 27 | id: 'u4', 28 | name: 'Alex', 29 | imageUri: 'https://avatars.githubusercontent.com/u/89520838?v=4', 30 | }, 31 | updates: [ 32 | { 33 | id: 's1', 34 | types: 'text', 35 | content: 'I am like the air, you no fit catch me \n ~Wale', 36 | caption: null, 37 | createdAt: '2022-02-20T15:40:00.000Z', 38 | }, 39 | { 40 | id: 's2', 41 | types: 'photo', 42 | content: 'https://codersquiz.netlify.app/img/bentil.jpeg', 43 | caption: 'For God is', 44 | createdAt: '2022-02-20T15:40:00.000Z', 45 | }, 46 | ] 47 | }, 48 | { 49 | user: { 50 | id: 'u6', 51 | name: 'Elon Musk', 52 | imageUri: 'https://www.biography.com/.image/ar_1:1%2Cc_fill%2Ccs_srgb%2Cfl_progressive%2Cq_auto:good%2Cw_1200/MTc5OTk2ODUyMTMxNzM0ODcy/gettyimages-1229892983-square.jpg', 53 | status: "Tesla to the f*kn Wiase🔥🔥" 54 | }, 55 | updates: [ 56 | { 57 | id: 's1', 58 | types: 'text', 59 | content: 'Moving to a different planet', 60 | caption: null, 61 | createdAt: '2022-02-20T15:40:00.000Z', 62 | }, 63 | { 64 | id: 's2', 65 | types: 'photo', 66 | content: 'https://codersquiz.netlify.app/img/bentil.jpeg', 67 | caption: 'ROcket Launch successful', 68 | createdAt: '2022-02-20T15:40:00.000Z', 69 | }, 70 | ] 71 | }, 72 | ] -------------------------------------------------------------------------------- /components/Status/index.js: -------------------------------------------------------------------------------- 1 | import { Image, TouchableOpacity, View } from 'react-native'; 2 | import { Ionicons, MaterialCommunityIcons, MaterialIcons } from '@expo/vector-icons'; 3 | 4 | import Colors from '../../constants/Colors'; 5 | import React from 'react'; 6 | import { Text } from '../Themed'; 7 | import profile from '../../data/profile'; 8 | import { styles } from './style'; 9 | import tw from 'twrnc' 10 | import useColorScheme from '../../hooks/useColorScheme'; 11 | import { useNavigation } from '@react-navigation/native'; 12 | 13 | const StatusProfile = () => { 14 | const colorScheme = useColorScheme() 15 | const navigation = useNavigation() 16 | return ( 17 | 18 | 19 | 23 | 24 | {'My Status'} 25 | {'Add to my status'} 26 | 27 | 28 | 29 | navigation.navigate("QRScan")} 33 | > 34 | 35 | 36 | 37 | navigation.navigate("QRScan")} 41 | > 42 | 43 | 44 | 45 | 46 | ) 47 | } 48 | 49 | export default StatusProfile; 50 | -------------------------------------------------------------------------------- /headers/CallScreenHeader.js: -------------------------------------------------------------------------------- 1 | import { Pressable, SafeAreaView, StyleSheet, TouchableOpacity } from 'react-native'; 2 | import { Text, View } from '../components/Themed'; 3 | 4 | import Colors from '../constants/Colors'; 5 | import { MaterialCommunityIcons } from '@expo/vector-icons'; 6 | import Styles from '../constants/Styles'; 7 | import tw from 'twrnc' 8 | import useColorScheme from '../hooks/useColorScheme'; 9 | import { useNavigation } from '@react-navigation/native'; 10 | 11 | const CallScreenHeader = ({logType, selected}) => { 12 | colorScheme = useColorScheme() 13 | const navigation = useNavigation() 14 | return ( 15 | 16 | 17 | 18 | Edit 19 | 20 | logType('all')}> 21 | All 22 | 23 | logType('Missed')}> 24 | Missed 25 | 26 | 27 | ({ 29 | opacity: pressed ? 0.5 : 1, 30 | })} 31 | onPress={() => navigation.navigate('AddCallModal')} 32 | > 33 | 39 | 40 | 41 | 42 | 43 | 44 | ); 45 | } 46 | 47 | const styles = StyleSheet.create({ 48 | bgTransparent: { 49 | backgroundColor: 'transparent', 50 | opacity: 1 51 | }, 52 | toggler: { 53 | borderRadius: 8, 54 | width: 160, 55 | padding: 1.5, 56 | }, 57 | itemActive: { 58 | backgroundColor: 'white', 59 | borderRadius: 8, 60 | }, 61 | 62 | }); 63 | 64 | 65 | export const {logType} = CallScreenHeader; 66 | 67 | export default CallScreenHeader; -------------------------------------------------------------------------------- /data/CallsData.js: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | id: 'C1', 4 | mode: 'video', 5 | type: 'Missed', 6 | user:{ 7 | id: 'u7', 8 | name: '@qBentil', 9 | imageUri: 'https://codersquiz.netlify.app/img/bentil.jpeg', 10 | }, 11 | date: '2022-02-21T15:40:00.000Z' 12 | }, 13 | { 14 | id: 'C2', 15 | mode: 'video', 16 | type: 'Incoming', 17 | user: { 18 | id: 'u1', 19 | name: 'Vadim', 20 | imageUri: 'https://scontent.fkiv3-1.fna.fbcdn.net/v/t31.0-1/s200x200/22256588_1932617800312085_5686197942193420542_o.jpg?_nc_cat=110&_nc_sid=7206a8&_nc_eui2=AeF3UwtnAs3QLEJRnLSp4-hQxlokCBJZ6JPGWiQIElnok9HafHyjqv9D4bW9zeNFfNJlg5jLsvbewM7j5OD-OFy-&_nc_ohc=IxycgYSpqQEAX8EcTqI&_nc_ht=scontent.fkiv3-1.fna&tp=7&oh=640a83293bb75378958d22b633302f1b&oe=5F9F4BB7', 21 | }, 22 | date: '2020-10-20T15:40:00.000Z' 23 | }, 24 | { 25 | id: 'C3', 26 | mode: 'audio', 27 | type: 'Outgoing', 28 | user: { 29 | id: 'u7', 30 | name: '@qBentil', 31 | imageUri: 'https://codersquiz.netlify.app/img/bentil.jpeg', 32 | }, 33 | date: '2022-02-19T15:40:00.000Z' 34 | }, 35 | { 36 | id: 'C4', 37 | mode: 'audio', 38 | type: 'Missed', 39 | user: { 40 | id: 'u1', 41 | name: 'Vadim', 42 | imageUri: 'https://scontent.fkiv3-1.fna.fbcdn.net/v/t31.0-1/s200x200/22256588_1932617800312085_5686197942193420542_o.jpg?_nc_cat=110&_nc_sid=7206a8&_nc_eui2=AeF3UwtnAs3QLEJRnLSp4-hQxlokCBJZ6JPGWiQIElnok9HafHyjqv9D4bW9zeNFfNJlg5jLsvbewM7j5OD-OFy-&_nc_ohc=IxycgYSpqQEAX8EcTqI&_nc_ht=scontent.fkiv3-1.fna&tp=7&oh=640a83293bb75378958d22b633302f1b&oe=5F9F4BB7', 43 | }, 44 | date: '2022-02-20T15:40:00.000Z' 45 | }, 46 | { 47 | id: 'C5', 48 | mode: 'video', 49 | type: 'Incoming', 50 | user: { 51 | id: 'u10', 52 | name: 'Angelina Jolie', 53 | imageUri: 'https://lkbkspro.s3.amazonaws.com/atelier-management/gs_58d933b8-98b4-468e-b229-43100a9620a7.jpg', 54 | }, 55 | date: '2022-02-19T15:40:00.000Z' 56 | }, 57 | { 58 | id: 'C6', 59 | mode: 'video', 60 | type: 'Incoming', 61 | user: { 62 | id: 'u9', 63 | name: 'Mom', 64 | imageUri: 'https://image.shutterstock.com/image-vector/super-mom-hero-superhero-cartoon-600w-720015928.jpg', 65 | }, 66 | date: '2022-02-21T15:40:00.000Z' 67 | }, 68 | ] -------------------------------------------------------------------------------- /components/ChatNavs.js: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Fontisto, MaterialCommunityIcons } from '@expo/vector-icons'; 4 | import { StyleSheet, Text, TouchableOpacity, View, useColorScheme } from 'react-native'; 5 | 6 | import Colors from '../constants/Colors'; 7 | import tw from 'twrnc' 8 | import { useNavigation } from '@react-navigation/native' 9 | 10 | const ChatNavs = () => { 11 | const colorScheme = useColorScheme(); 12 | const navigation = useNavigation(); 13 | return ( 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | Archived 24 | 25 | 0 26 | 27 | 28 | 29 | navigation.navigate("LabelsScreen")} 32 | > 33 | 34 | 35 | 36 | 37 | Labels 38 | 39 | 40 | 41 | 42 | 43 | Broadcast Lists 44 | 45 | navigation.navigate('NewGroupModal')} 47 | > 48 | New Group 49 | 50 | 51 | 52 | ); 53 | }; 54 | 55 | export default ChatNavs; 56 | 57 | const styles = StyleSheet.create({ 58 | container: {} 59 | }); 60 | -------------------------------------------------------------------------------- /data/Chats.js: -------------------------------------------------------------------------------- 1 | export default { 2 | id: '1', 3 | users: [{ 4 | id: 'u1', 5 | name: 'Vadim', 6 | imageUri: 'https://scontent.fkiv3-1.fna.fbcdn.net/v/t31.0-1/s200x200/22256588_1932617800312085_5686197942193420542_o.jpg?_nc_cat=110&_nc_sid=7206a8&_nc_eui2=AeF3UwtnAs3QLEJRnLSp4-hQxlokCBJZ6JPGWiQIElnok9HafHyjqv9D4bW9zeNFfNJlg5jLsvbewM7j5OD-OFy-&_nc_ohc=IxycgYSpqQEAX8EcTqI&_nc_ht=scontent.fkiv3-1.fna&tp=7&oh=640a83293bb75378958d22b633302f1b&oe=5F9F4BB7', 7 | }, { 8 | id: 'u2', 9 | name: 'AllyTyson', 10 | imageUri: 'https://avatars.githubusercontent.com/u/88384474?v=4', 11 | }], 12 | messages: [{ 13 | id: 'm1', 14 | content: 'How are you, AllyTyson!', 15 | createdAt: '2022-04-29T12:48:00.000Z', 16 | user: { 17 | id: 'u1', 18 | name: 'Vadim', 19 | imageUri: '' 20 | }, 21 | }, { 22 | id: 'm2', 23 | content: 'I am good, good', 24 | createdAt: '2022-04-29T14:49:00.000Z', 25 | user: { 26 | id: 'u2', 27 | name: 'AllyTyson', 28 | imageUri: '' 29 | }, 30 | }, { 31 | id: 'm3', 32 | content: 'What about you?', 33 | createdAt: '2022-04-29T14:49:40.000Z', 34 | user: { 35 | id: 'u2', 36 | name: 'AllyTyson', 37 | imageUri: '' 38 | }, 39 | }, { 40 | id: 'm4', 41 | content: 'Good as well, preparing for the stream now.', 42 | createdAt: '2022-04-29T14:50:00.000Z', 43 | user: { 44 | id: 'u1', 45 | name: 'Vadim', 46 | imageUri: '' 47 | }, 48 | }, { 49 | id: 'm5', 50 | content: 'How is your uni going?', 51 | createdAt: '2022-04-29T14:51:00.000Z', 52 | user: { 53 | id: 'u1', 54 | name: 'Vadim', 55 | imageUri: '' 56 | }, 57 | }, { 58 | id: 'm6', 59 | content: 'It is a bit tough, as I have 2 specializations. How about yours? Do you enjoy it?', 60 | createdAt: '2022-04-29T14:49:00.000Z', 61 | user: { 62 | id: 'u2', 63 | name: 'AllyTyson', 64 | imageUri: '' 65 | }, 66 | }, { 67 | id: 'm7', 68 | content: 'Big Data is really interesting. Cannot wait to go through all the material. Buh wait.... Since when have you been in this sh*t!🤣🤣', 69 | createdAt: '2022-04-29T14:53:00.000Z', 70 | user: { 71 | id: 'u1', 72 | name: 'Vadim', 73 | imageUri: '' 74 | }, 75 | },{ 76 | id: 'm8', 77 | content: 'Big Data is really interesting. Cannot wait to go through all the material. Buh wait.... Since when have you been in this sh*t!🤣🤣', 78 | createdAt: '2022-04-29T14:53:00.000Z', 79 | user: { 80 | id: 'u2', 81 | name: 'Vadim', 82 | imageUri: '' 83 | }, 84 | },{ 85 | id: 'm9', 86 | content: 'Bentil is a boi and really interesting. Cannot wait to go through all the material. Buh wait.... Since when have you been in this sh*t!🤣🤣', 87 | createdAt: '2022-04-29T14:53:00.000Z', 88 | user: { 89 | id: 'u1', 90 | name: 'Vadim', 91 | imageUri: '' 92 | }, 93 | }] 94 | } -------------------------------------------------------------------------------- /components/Settings/Item.js: -------------------------------------------------------------------------------- 1 | import { AntDesign, Fontisto, Ionicons, MaterialCommunityIcons, MaterialIcons } from '@expo/vector-icons'; 2 | import { TouchableOpacity, View } from 'react-native'; 3 | 4 | import Colors from '../../constants/Colors'; 5 | import React from 'react'; 6 | import { Text } from '../Themed'; 7 | import tw from 'twrnc' 8 | import useColorScheme from '../../hooks/useColorScheme'; 9 | import { useNavigation } from '@react-navigation/native'; 10 | 11 | const Settingitem = ({iconType = 'MI', iconName, iconBgColor, title, route = '', style = {}}) => { 12 | const colorScheme = useColorScheme() 13 | const navigation = useNavigation() 14 | return ( 15 | 16 | 17 | 18 | {iconType == 'MI' && ( 19 | 25 | ) || 26 | 27 | iconType == 'F' && ( 28 | 34 | ) || 35 | iconType == "MCI" && ( 36 | 42 | ) || 43 | iconType == "AD" && ( 44 | 50 | ) 51 | } 52 | 53 | 54 | {title} 55 | 56 | 57 | 58 | 59 | ) 60 | } 61 | 62 | export default Settingitem; 63 | -------------------------------------------------------------------------------- /screens/QRScreen.tsx: -------------------------------------------------------------------------------- 1 | import { Image, StyleSheet, TouchableOpacity, View } from 'react-native'; 2 | 3 | import Colors from '../constants/Colors'; 4 | import QRScreenHeader from '../headers/QRScreenHeader' 5 | import { RootTabScreenProps } from '../types'; 6 | import { Text } from '../components/Themed'; 7 | import profile from '../data/profile'; 8 | import tw from 'twrnc' 9 | import useColorScheme from '../hooks/useColorScheme'; 10 | 11 | export default function QRScreen({ navigation }: RootTabScreenProps<'QRScreen'>) { 12 | const colorScheme = useColorScheme(); 13 | 14 | return ( 15 | 16 | 17 | 18 | 22 | 23 | {profile.name} 24 | WhatsApp Business Account 25 | 26 | 30 | 31 | 32 | 33 | 34 | 35 | You customer can scan this code to start a WhatsApp chat with you. 36 | Learn more 37 | 38 | 39 | 40 | Reset 41 | 42 | 43 | 44 | Share Code 45 | 46 | 47 | 48 | ); 49 | } 50 | 51 | const styles = StyleSheet.create({ 52 | container: { 53 | paddingHorizontal: 15, 54 | minHeight: 800, 55 | flex: 1 56 | 57 | }, 58 | avatar: { 59 | width: 80, 60 | height: 80, 61 | borderRadius: 50, 62 | marginRight: 15, 63 | backgroundColor: 'white', 64 | borderWidth: 1, 65 | borderColor: "#ccc", 66 | position: 'absolute', 67 | top: 60, 68 | zIndex: 999, 69 | } 70 | 71 | }); 72 | -------------------------------------------------------------------------------- /screens/SettingsScreen.tsx: -------------------------------------------------------------------------------- 1 | import { ScrollView, StyleSheet, View, useColorScheme } from 'react-native'; 2 | 3 | import Profile from '../components/Settings/profile'; 4 | import Seperator from '../components/Settings/Seperator'; 5 | import Settingitem from '../components/Settings/Item'; 6 | import SettingsScreenHeader from '../headers/SettingsScreenHeader' 7 | import { Text, } from '../components/Themed'; 8 | import { useState } from 'react'; 9 | 10 | export default function SettingsScreen() { 11 | const [titleShown, setTitleShown] = useState(false) 12 | const colorScheme = useColorScheme() 13 | 14 | const handleScroll = function(event: Object) { 15 | event.nativeEvent.contentOffset.y <= 0 ? setTitleShown(false): setTitleShown(true) 16 | } 17 | return ( 18 | 19 | 20 | 27 | {!titleShown && Settings} 28 | {/* User Profile */} 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 46 | 47 | 53 | 59 | 60 | 61 | ); 62 | } 63 | 64 | const styles = StyleSheet.create({ 65 | container: { 66 | paddingHorizontal: 0, 67 | minHeight: 800, 68 | flex: 1 69 | }, 70 | title: { 71 | fontSize: 35, 72 | fontWeight: '600', 73 | paddingHorizontal: 10 74 | }, 75 | separator: { 76 | marginVertical: 30, 77 | height: 1, 78 | width: '80%', 79 | }, 80 | }); 81 | -------------------------------------------------------------------------------- /components/inputBox/index.jsx: -------------------------------------------------------------------------------- 1 | import { Feather, Ionicons, MaterialCommunityIcons, MaterialIcons, SimpleLineIcons } from '@expo/vector-icons' 2 | import { Keyboard, KeyboardAvoidingView, Platform, TextInput, TouchableNativeFeedback, TouchableOpacity } from 'react-native' 3 | import React, { useState } from 'react' 4 | import { Text, View } from '../Themed' 5 | 6 | import Colors from '../../constants/Colors' 7 | import tw from 'twrnc' 8 | import useColorScheme from '../../hooks/useColorScheme' 9 | 10 | export default function InputBox() { 11 | colorScheme = useColorScheme() 12 | const [chatMsg, setChatMsg] = useState('') 13 | 14 | const formatMsg = (msg) => msg.replace(/^\s+|\s+$/g, ''); 15 | return ( 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | setChatMsg(formatMsg(text))} 29 | placeholder = 'Message' 30 | placeholderTextColor = {Colors[colorScheme].backgroundOpac} 31 | returnKeyType= {"next"} 32 | returnKeyLabel = {"return"} 33 | spellCheck 34 | enablesReturnKeyAutomatically 35 | keyboardType='ascii-capable' 36 | style={tw`p-2 border border-[${Colors[colorScheme].backgroundOpac}] w-full min-h-8 text-[${Colors[colorScheme].text}] max-h-30 rounded-2xl `} 37 | /> 38 | 39 | 40 | 41 | 42 | { chatMsg.length <=0 ? ( 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | ):( 51 | 52 | 53 | 54 | 55 | 56 | ) 57 | } 58 | 59 | 60 | 61 | ) 62 | } -------------------------------------------------------------------------------- /data/Users.js: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | id: 'u1', 4 | name: 'AllyTyson', 5 | imageUri: 'https://avatars.githubusercontent.com/u/88384474?v=4', 6 | status: "Console.WriteLine('Please can I get a cup of code?');" 7 | }, { 8 | id: 'u2', 9 | name: 'Lukas', 10 | imageUri: 'https://scontent.fkiv3-1.fna.fbcdn.net/v/t1.0-1/p200x200/107443858_3074598385966770_1929559809312242379_n.jpg?_nc_cat=107&_nc_sid=7206a8&_nc_eui2=AeGly5fZLQUfAKei_EiACEq5Dfw2T_M-BQMN_DZP8z4FA_aLEVK_8e0dKvl_5vxVO0Zn-4OPzQ9pKS0c0XeXd898&_nc_ohc=z1ydC_UL4KsAX_tfrbv&_nc_oc=AQknywM4y1IAQaQZaZkPdtkUmaem060LXSByeTx3pdQXWfxW2_tdzfgRsQIXQK_zV94&_nc_ht=scontent.fkiv3-1.fna&tp=6&oh=69508c88f073f64f432fc1f1ab9299e8&oe=5F9C5FD5', 11 | status: "Hello there, I'm using WHatsApp" 12 | }, { 13 | id: 'u3', 14 | name: 'Daniil', 15 | imageUri: 'https://scontent.fkiv3-1.fna.fbcdn.net/v/t31.0-8/14242257_122280314893965_2111799435851825649_o.jpg?_nc_cat=100&_nc_sid=09cbfe&_nc_eui2=AeH1OfzTrJPQ6gm8y5chASx9XduE6cDoPWBd24TpwOg9YB3iQXtk3WFlfnz5Z8K89WDuLYc3YgooGcmFvcn5fpBL&_nc_ohc=HZKFqosOM-IAX_SsXhT&_nc_oc=AQksp486WazJyCTMR5esRx51kZ8He2qUotQP7EAtzySMJl7i9H2Pv4PpULir6W5Eglk&_nc_ht=scontent.fkiv3-1.fna&oh=b45419e5106747d75fdd548392517a3c&oe=5F9FB4DD', 16 | status: "God over everything!" 17 | }, { 18 | id: 'u4', 19 | name: 'Alex', 20 | imageUri: 'https://avatars.githubusercontent.com/u/89520838?v=4', 21 | status: "Money💸 on my mind > Statistics📚" 22 | }, { 23 | id: 'u5', 24 | name: 'Vlad', 25 | imageUri: 'https://scontent.fkiv3-1.fna.fbcdn.net/v/t1.15752-9/120640479_2760477844167786_6938949653508389840_n.jpg?_nc_cat=108&_nc_sid=ae9488&_nc_eui2=AeGVhYmC95nNnVy1xOf6ArJ2jSXP0lcbAsGNJc_SVxsCwevGmgj2fByDCyiWY8iQK-k-KkqYMmK-pPRahQiFUqAT&_nc_ohc=0d4q0ZI3HTgAX_0LSog&_nc_ht=scontent.fkiv3-1.fna&oh=c9155df4d012070901bce3e8f0e2d877&oe=5F9F9DF5', 26 | status: "Schooling" 27 | }, { 28 | id: 'u6', 29 | name: 'Elon Musk', 30 | imageUri: 'https://www.biography.com/.image/ar_1:1%2Cc_fill%2Ccs_srgb%2Cfl_progressive%2Cq_auto:good%2Cw_1200/MTc5OTk2ODUyMTMxNzM0ODcy/gettyimages-1229892983-square.jpg', 31 | status: "Tesla to the f*kn Wiase🔥🔥" 32 | }, { 33 | id: 'u7', 34 | name: 'Adrian', 35 | imageUri: 'https://scontent.fkiv3-1.fna.fbcdn.net/v/t31.0-8/12185020_10206884996416284_5116038671917824834_o.jpg?_nc_cat=101&_nc_sid=174925&_nc_eui2=AeGr_NhJtwGWWfHbkoBSmifLKzIg47DpEF0rMiDjsOkQXf7yavDd4m-3CLbl5nqAMGcj2nn0Dqg7beNAzuZMzTFK&_nc_ohc=KOCn_AYCJxkAX_ZcLBP&_nc_ht=scontent.fkiv3-1.fna&oh=8cc4e5445ce4633db9d6234f42ccb368&oe=5F9C24D1', 36 | status: "On Vaccation🎉🍉" 37 | }, { 38 | id: 'u8', 39 | name: 'Borja', 40 | imageUri: 'https://scontent.fkiv3-1.fna.fbcdn.net/v/t1.0-9/14639688_10154618563394501_7732414502546927586_n.jpg?_nc_cat=111&_nc_sid=09cbfe&_nc_eui2=AeHoAmU6vBHtxse4pY5lCxy5mE72isysx5eYTvaKzKzHl0wF5HhppdSbpFTEnGVXBMLig16R9B4iHrsuAOk_V_fY&_nc_ohc=Sit1NLT0GMsAX9baI56&_nc_ht=scontent.fkiv3-1.fna&oh=16d88a54bb1629c24e77afed0c49f869&oe=5F9EAC05', 41 | status: "Saved with Amazing Grace (SWAG)🥰" 42 | }, { 43 | id: 'u9', 44 | name: 'Mom', 45 | imageUri: 'https://image.shutterstock.com/image-vector/super-mom-hero-superhero-cartoon-600w-720015928.jpg', 46 | status: "Hello there, I'm using WhatSapp" 47 | }, { 48 | id: 'u10', 49 | name: '@ethel3👩‍💻🥷', 50 | imageUri: 'https://avatars.githubusercontent.com/u/88440439?v=4', 51 | status: "SILENCE🤐 is💫 Golden✨" 52 | }, { 53 | id: 'u11', 54 | name: 'Theboybreyy', 55 | imageUri: 'https://avatars.githubusercontent.com/u/86781764?v=4', 56 | status: "Code with Passion👀" 57 | }, 58 | ] -------------------------------------------------------------------------------- /navigation/MainTabNavigator.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Fontisto, Ionicons, SimpleLineIcons, Zocial } from '@expo/vector-icons'; 4 | import { RootStackParamList, RootTabParamList, RootTabScreenProps } from '../types'; 5 | 6 | import CallsScreen from '../screens/CallsScreen'; 7 | import CameraScreen from '../screens/CameraScreen'; 8 | import ChatScreen from '../screens/ChatScreen'; 9 | import Colors from '../constants/Colors'; 10 | import SettingsScreen from '../screens/SettingsScreen'; 11 | import StatusScreen from '../screens/StatusScreen'; 12 | import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; 13 | import { createStackNavigator } from '@react-navigation/stack'; 14 | import useColorScheme from '../hooks/useColorScheme'; 15 | 16 | const BottomTab = createBottomTabNavigator(); 17 | 18 | export default function BottomTabNavigator() { 19 | const colorScheme = useColorScheme(); 20 | 21 | return ( 22 | 28 | , 34 | }} 35 | /> 36 | , 43 | }} 44 | /> 45 | , 51 | }} 52 | /> 53 | , 60 | }} 61 | /> 62 | , 69 | }} 70 | /> 71 | 72 | ); 73 | } 74 | 75 | /** 76 | * You can explore the built-in icon families and icons on the web at https://icons.expo.fyi/ 77 | */ 78 | function TabBarIcon(props: { 79 | type: string; 80 | name: React.ComponentProps['name']; 81 | color: string; 82 | }) { 83 | return ; 84 | } 85 | 86 | // Each tab has its own navigation stack, you can read more about this pattern here: 87 | // https://reactnavigation.org/docs/tab-based-navigation#a-stack-navigator-for-each-tab 88 | const CameraStack = createStackNavigator(); 89 | const ChatStack= createStackNavigator(); 90 | const SettingStack = createStackNavigator(); 91 | const StatusStack= createStackNavigator(); 92 | const CallsStack = createStackNavigator(); 93 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # chatbox (...ongoing) 2 | ChatBox is a WhatsApp Business Clone built with React Native & Expo. 3 | 4 | # UI (DARK MODE) 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | # UI (LIGHT MODE) 26 |
27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 |
42 | 43 | ## Tech Stack used: 44 | **FRONTEND** 45 | 1. React Native 46 | 2. Expo 47 | 3. TypeScript 48 | 4. React Navigation 49 | 5. Tailwind React native Classname 50 | 51 | **BACKEND** 52 | 1. AWS Amplify 53 | 2. GraphQL 54 | 3. AWS App Sync 55 | 56 | ## Personal Experiences & COmments 57 | Personal Comments to be updated soon.................... 58 | 1. Use and Manage of States 59 | 2. Prop drilling (not recommended tho😊) 60 | 3. Create of FlatList and Section List Componets to Re3nder Contacts 61 | -------------------------------------------------------------------------------- /navigation/index.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { ColorSchemeName, Pressable, StyleSheet, Text, TouchableOpacity, View } from 'react-native'; 4 | import { DarkTheme, DefaultTheme, NavigationContainer } from '@react-navigation/native'; 5 | import { Feather, Ionicons, MaterialCommunityIcons } from '@expo/vector-icons'; 6 | import { RootStackParamList, RootTabParamList, RootTabScreenProps } from '../types'; 7 | 8 | import AddLabelsScreen from '../screens/AddLabelScreen'; 9 | import BottomTabNavigator from './MainTabNavigator'; 10 | import ChatRoomScreen from '../screens/ChatRoomScreen'; 11 | import Colors from '../constants/Colors'; 12 | import LabelsScreen from '../screens/LabelsScreen'; 13 | import LinkingConfiguration from './LinkingConfiguration'; 14 | import NewChatModalScreen from '../screens/NewChatModalScreen'; 15 | import NewGroupModalScreen from '../screens/NewGroupModalScreen'; 16 | import NotFoundScreen from '../screens/NotFoundScreen'; 17 | import QRScreen from '../screens/QRScreen'; 18 | import StatusPrivacy from '../screens/StatusPrivacy'; 19 | import Styles from '../constants/Styles'; 20 | import { createNativeStackNavigator } from '@react-navigation/native-stack'; 21 | import tw from 'twrnc' 22 | import useColorScheme from '../hooks/useColorScheme'; 23 | 24 | /** 25 | * If you are not familiar with React Navigation, refer to the "Fundamentals" guide: 26 | * https://reactnavigation.org/docs/getting-started 27 | * 28 | */ 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | export default function Navigation({ colorScheme }: { colorScheme: ColorSchemeName }) { 38 | 39 | return ( 40 | 44 | 45 | 46 | ); 47 | } 48 | 49 | /** 50 | * A root stack navigator is often used for displaying modals on top of all other content. 51 | * https://reactnavigation.org/docs/modal 52 | */ 53 | const Stack = createNativeStackNavigator(); 54 | 55 | function RootNavigator() { 56 | const colorScheme = useColorScheme(); 57 | return ( 58 | 70 | ({ 74 | headerShown: false, 75 | title: "", 76 | headerLeft: () => ( 77 | Edit 78 | ), 79 | headerRight: () => ( 80 | navigation.navigate('Modal')} 82 | style={({ pressed }) => ({ 83 | opacity: pressed ? 0.5 : 1, 84 | })}> 85 | 91 | 92 | ), 93 | })} 94 | /> 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | {/* Modal Screens */} 103 | ({ 105 | presentation: 'modal', 106 | headerStyle: { 107 | backgroundColor: colorScheme == 'light'? 'white':'#333333' 108 | }, 109 | headerTitleStyle: { 110 | color: Colors[colorScheme].text, 111 | fontSize: 22, 112 | fontWeight: 'bold', 113 | 114 | }, 115 | headerRight: () => ( 116 | navigation.goBack()} 118 | style={[tw`p-1 w-8 h-8 rounded-full shadow-md ${colorScheme ==='light'? 'bg-[#c5c6d0]':'bg-[#555555]'}`]} 119 | > 120 | 126 | 127 | ), 128 | })} 129 | > 130 | 131 | 132 | 133 | 134 | 135 | ); 136 | } 137 | -------------------------------------------------------------------------------- /data/ChatRooms.js: -------------------------------------------------------------------------------- 1 | export default [ 2 | 3 | { 4 | id: '9', 5 | users: [{ 6 | id: 'u1', 7 | name: 'Vadim', 8 | imageUri: 'https://scontent.fkiv3-1.fna.fbcdn.net/v/t31.0-1/s200x200/22256588_1932617800312085_5686197942193420542_o.jpg?_nc_cat=110&_nc_sid=7206a8&_nc_eui2=AeF3UwtnAs3QLEJRnLSp4-hQxlokCBJZ6JPGWiQIElnok9HafHyjqv9D4bW9zeNFfNJlg5jLsvbewM7j5OD-OFy-&_nc_ohc=IxycgYSpqQEAX8EcTqI&_nc_ht=scontent.fkiv3-1.fna&tp=7&oh=640a83293bb75378958d22b633302f1b&oe=5F9F4BB7', 9 | }, { 10 | id: 'u10', 11 | name: 'Angelina Jolie', 12 | imageUri: 'https://lkbkspro.s3.amazonaws.com/atelier-management/gs_58d933b8-98b4-468e-b229-43100a9620a7.jpg', 13 | }], 14 | lastMessage: { 15 | id: 'm9', 16 | content: 'Meet me at the same place', 17 | createdAt: '2022-02-20T15:40:00.000Z', 18 | }, 19 | }, 20 | { 21 | id: '6', 22 | users: [{ 23 | id: 'u1', 24 | name: 'Vadim', 25 | imageUri: 'https://scontent.fkiv3-1.fna.fbcdn.net/v/t31.0-1/s200x200/22256588_1932617800312085_5686197942193420542_o.jpg?_nc_cat=110&_nc_sid=7206a8&_nc_eui2=AeF3UwtnAs3QLEJRnLSp4-hQxlokCBJZ6JPGWiQIElnok9HafHyjqv9D4bW9zeNFfNJlg5jLsvbewM7j5OD-OFy-&_nc_ohc=IxycgYSpqQEAX8EcTqI&_nc_ht=scontent.fkiv3-1.fna&tp=7&oh=640a83293bb75378958d22b633302f1b&oe=5F9F4BB7', 26 | }, { 27 | id: 'u7', 28 | name: '@qBentil', 29 | imageUri: 'https://codersquiz.netlify.app/img/bentil.jpeg', 30 | }], 31 | lastMessage: { 32 | id: 'm6', 33 | content: 'I have a solution', 34 | createdAt: '2022-02-17T15:40:00.000Z', 35 | } 36 | }, 37 | { 38 | id: '1', 39 | users: [{ 40 | id: 'u1', 41 | name: 'Vadim', 42 | imageUri: 'https://scontent.fkiv3-1.fna.fbcdn.net/v/t31.0-1/s200x200/22256588_1932617800312085_5686197942193420542_o.jpg?_nc_cat=110&_nc_sid=7206a8&_nc_eui2=AeF3UwtnAs3QLEJRnLSp4-hQxlokCBJZ6JPGWiQIElnok9HafHyjqv9D4bW9zeNFfNJlg5jLsvbewM7j5OD-OFy-&_nc_ohc=IxycgYSpqQEAX8EcTqI&_nc_ht=scontent.fkiv3-1.fna&tp=7&oh=640a83293bb75378958d22b633302f1b&oe=5F9F4BB7', 43 | }, { 44 | id: 'u2', 45 | name: 'Lukas', 46 | imageUri: 'https://scontent.fkiv3-1.fna.fbcdn.net/v/t1.0-1/p200x200/107443858_3074598385966770_1929559809312242379_n.jpg?_nc_cat=107&_nc_sid=7206a8&_nc_eui2=AeGly5fZLQUfAKei_EiACEq5Dfw2T_M-BQMN_DZP8z4FA_aLEVK_8e0dKvl_5vxVO0Zn-4OPzQ9pKS0c0XeXd898&_nc_ohc=z1ydC_UL4KsAX_tfrbv&_nc_oc=AQknywM4y1IAQaQZaZkPdtkUmaem060LXSByeTx3pdQXWfxW2_tdzfgRsQIXQK_zV94&_nc_ht=scontent.fkiv3-1.fna&tp=6&oh=69508c88f073f64f432fc1f1ab9299e8&oe=5F9C5FD5', 47 | }], 48 | lastMessage: { 49 | id: 'm1', 50 | content: 'Well done this sprint, guys!', 51 | createdAt: '2020-10-03T14:48:00.000Z', 52 | } 53 | }, 54 | { 55 | id: '2', 56 | users: [{ 57 | id: 'u1', 58 | name: 'Vadim', 59 | imageUri: 'https://scontent.fkiv3-1.fna.fbcdn.net/v/t31.0-1/s200x200/22256588_1932617800312085_5686197942193420542_o.jpg?_nc_cat=110&_nc_sid=7206a8&_nc_eui2=AeF3UwtnAs3QLEJRnLSp4-hQxlokCBJZ6JPGWiQIElnok9HafHyjqv9D4bW9zeNFfNJlg5jLsvbewM7j5OD-OFy-&_nc_ohc=IxycgYSpqQEAX8EcTqI&_nc_ht=scontent.fkiv3-1.fna&tp=7&oh=640a83293bb75378958d22b633302f1b&oe=5F9F4BB7', 60 | }, { 61 | id: 'u3', 62 | name: 'Daniil', 63 | imageUri: 'https://scontent.fkiv3-1.fna.fbcdn.net/v/t31.0-8/14242257_122280314893965_2111799435851825649_o.jpg?_nc_cat=100&_nc_sid=09cbfe&_nc_eui2=AeH1OfzTrJPQ6gm8y5chASx9XduE6cDoPWBd24TpwOg9YB3iQXtk3WFlfnz5Z8K89WDuLYc3YgooGcmFvcn5fpBL&_nc_ohc=HZKFqosOM-IAX_SsXhT&_nc_oc=AQksp486WazJyCTMR5esRx51kZ8He2qUotQP7EAtzySMJl7i9H2Pv4PpULir6W5Eglk&_nc_ht=scontent.fkiv3-1.fna&oh=b45419e5106747d75fdd548392517a3c&oe=5F9FB4DD', 64 | }], 65 | lastMessage: { 66 | id: 'm2', 67 | content: 'How are you doing?', 68 | createdAt: '2020-10-02T15:40:00.000Z', 69 | } 70 | }, 71 | { 72 | id: '3', 73 | users: [{ 74 | id: 'u1', 75 | name: 'Vadim', 76 | imageUri: 'https://scontent.fkiv3-1.fna.fbcdn.net/v/t31.0-1/s200x200/22256588_1932617800312085_5686197942193420542_o.jpg?_nc_cat=110&_nc_sid=7206a8&_nc_eui2=AeF3UwtnAs3QLEJRnLSp4-hQxlokCBJZ6JPGWiQIElnok9HafHyjqv9D4bW9zeNFfNJlg5jLsvbewM7j5OD-OFy-&_nc_ohc=IxycgYSpqQEAX8EcTqI&_nc_ht=scontent.fkiv3-1.fna&tp=7&oh=640a83293bb75378958d22b633302f1b&oe=5F9F4BB7', 77 | }, { 78 | id: 'u4', 79 | name: 'Alex', 80 | imageUri: 'https://scontent.fkiv3-1.fna.fbcdn.net/v/t1.0-9/120265890_2659046234308755_83273782629061168_n.jpg?_nc_cat=109&_nc_sid=09cbfe&_nc_eui2=AeFydVcQHwdfhPgKavejHgTkZj50mLqkTwRmPnSYuqRPBBjekO0sZKdUNlELv62Htps4xAUKslo4tD8g8YyTPQ50&_nc_ohc=YcnPR2BvKUgAX_rSMDJ&_nc_ht=scontent.fkiv3-1.fna&oh=ea3bcd9c21e5538c744e4cb19464713b&oe=5F9E4002', 81 | }], 82 | lastMessage: { 83 | id: 'm3', 84 | content: 'Hi, Vadim.', 85 | createdAt: '2020-10-02T14:48:00.000Z', 86 | } 87 | }, 88 | { 89 | id: '4', 90 | users: [{ 91 | id: 'u1', 92 | name: 'Vadim', 93 | imageUri: 'https://scontent.fkiv3-1.fna.fbcdn.net/v/t31.0-1/s200x200/22256588_1932617800312085_5686197942193420542_o.jpg?_nc_cat=110&_nc_sid=7206a8&_nc_eui2=AeF3UwtnAs3QLEJRnLSp4-hQxlokCBJZ6JPGWiQIElnok9HafHyjqv9D4bW9zeNFfNJlg5jLsvbewM7j5OD-OFy-&_nc_ohc=IxycgYSpqQEAX8EcTqI&_nc_ht=scontent.fkiv3-1.fna&tp=7&oh=640a83293bb75378958d22b633302f1b&oe=5F9F4BB7', 94 | }, { 95 | id: 'u5', 96 | name: 'Vlad', 97 | imageUri: 'https://scontent.fkiv3-1.fna.fbcdn.net/v/t1.15752-9/120640479_2760477844167786_6938949653508389840_n.jpg?_nc_cat=108&_nc_sid=ae9488&_nc_eui2=AeGVhYmC95nNnVy1xOf6ArJ2jSXP0lcbAsGNJc_SVxsCwevGmgj2fByDCyiWY8iQK-k-KkqYMmK-pPRahQiFUqAT&_nc_ohc=0d4q0ZI3HTgAX_0LSog&_nc_ht=scontent.fkiv3-1.fna&oh=c9155df4d012070901bce3e8f0e2d877&oe=5F9F9DF5', 98 | }], 99 | lastMessage: { 100 | id: 'm4', 101 | content: 'Can you review my last merge', 102 | createdAt: '2020-09-29T14:48:00.000Z', 103 | } 104 | }, 105 | { 106 | id: '5', 107 | users: [{ 108 | id: 'u1', 109 | name: 'Vadim', 110 | imageUri: 'https://scontent.fkiv3-1.fna.fbcdn.net/v/t31.0-1/s200x200/22256588_1932617800312085_5686197942193420542_o.jpg?_nc_cat=110&_nc_sid=7206a8&_nc_eui2=AeF3UwtnAs3QLEJRnLSp4-hQxlokCBJZ6JPGWiQIElnok9HafHyjqv9D4bW9zeNFfNJlg5jLsvbewM7j5OD-OFy-&_nc_ohc=IxycgYSpqQEAX8EcTqI&_nc_ht=scontent.fkiv3-1.fna&tp=7&oh=640a83293bb75378958d22b633302f1b&oe=5F9F4BB7', 111 | }, { 112 | id: 'u6', 113 | name: 'Elon Musk', 114 | imageUri: 'https://scontent.fkiv3-1.fna.fbcdn.net/v/t1.0-9/117929133_107809907710190_7419805747453745280_n.jpg?_nc_cat=103&_nc_sid=09cbfe&_nc_eui2=AeHyr9m8dMUXCyqgYiDxTTMqypeilYrkr1_Kl6KViuSvX2aKglh0TaInpI6Uqbk8nRSKq6iOQuTncbpb6Uik2iH8&_nc_ohc=YusbV4P7yQMAX9ptPAN&_nc_ht=scontent.fkiv3-1.fna&oh=ebee2db09b2a70c9dbef1bdad876c09c&oe=5F9D4112', 115 | }], 116 | lastMessage: { 117 | id: 'm5', 118 | content: 'I would be happy', 119 | createdAt: '2020-09-30T14:48:00.000Z', 120 | } 121 | }, 122 | { 123 | id: '7', 124 | users: [{ 125 | id: 'u1', 126 | name: 'Vadim', 127 | imageUri: 'https://scontent.fkiv3-1.fna.fbcdn.net/v/t31.0-1/s200x200/22256588_1932617800312085_5686197942193420542_o.jpg?_nc_cat=110&_nc_sid=7206a8&_nc_eui2=AeF3UwtnAs3QLEJRnLSp4-hQxlokCBJZ6JPGWiQIElnok9HafHyjqv9D4bW9zeNFfNJlg5jLsvbewM7j5OD-OFy-&_nc_ohc=IxycgYSpqQEAX8EcTqI&_nc_ht=scontent.fkiv3-1.fna&tp=7&oh=640a83293bb75378958d22b633302f1b&oe=5F9F4BB7', 128 | }, { 129 | id: 'u8', 130 | name: 'Borja', 131 | imageUri: 'https://scontent.fkiv3-1.fna.fbcdn.net/v/t1.0-9/14639688_10154618563394501_7732414502546927586_n.jpg?_nc_cat=111&_nc_sid=09cbfe&_nc_eui2=AeHoAmU6vBHtxse4pY5lCxy5mE72isysx5eYTvaKzKzHl0wF5HhppdSbpFTEnGVXBMLig16R9B4iHrsuAOk_V_fY&_nc_ohc=Sit1NLT0GMsAX9baI56&_nc_ht=scontent.fkiv3-1.fna&oh=16d88a54bb1629c24e77afed0c49f869&oe=5F9EAC05', 132 | }], 133 | lastMessage: { 134 | id: 'm7', 135 | content: 'How are you doing?', 136 | createdAt: '2020-10-02T15:40:00.000Z', 137 | } 138 | }, 139 | { 140 | id: '8', 141 | users: [{ 142 | id: 'u1', 143 | name: 'Vadim', 144 | imageUri: 'https://scontent.fkiv3-1.fna.fbcdn.net/v/t31.0-1/s200x200/22256588_1932617800312085_5686197942193420542_o.jpg?_nc_cat=110&_nc_sid=7206a8&_nc_eui2=AeF3UwtnAs3QLEJRnLSp4-hQxlokCBJZ6JPGWiQIElnok9HafHyjqv9D4bW9zeNFfNJlg5jLsvbewM7j5OD-OFy-&_nc_ohc=IxycgYSpqQEAX8EcTqI&_nc_ht=scontent.fkiv3-1.fna&tp=7&oh=640a83293bb75378958d22b633302f1b&oe=5F9F4BB7', 145 | }, { 146 | id: 'u9', 147 | name: 'Mom', 148 | imageUri: 'https://image.shutterstock.com/image-vector/super-mom-hero-superhero-cartoon-600w-720015928.jpg', 149 | }], 150 | lastMessage: { 151 | id: 'm8', 152 | content: 'Dear, did you eat?', 153 | createdAt: '2020-09-27T15:40:00.000Z', 154 | } 155 | } 156 | ] --------------------------------------------------------------------------------