diff --git a/android/app/build.gradle b/android/app/build.gradle
index ae63ef0..7a5fba2 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -216,6 +216,7 @@ dependencies {
} else {
implementation jscFlavor
}
+ implementation 'com.google.firebase:firebase-analytics:17.3.0'
}
// Run this once to be able to run the application with BUCK
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index fd0bc7c..2272f84 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -7,6 +7,7 @@
+
@@ -22,29 +23,35 @@
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/android/app/src/main/res/values/colors.xml b/android/app/src/main/res/values/colors.xml
index 7e2bd59..6e1d21a 100644
--- a/android/app/src/main/res/values/colors.xml
+++ b/android/app/src/main/res/values/colors.xml
@@ -2,4 +2,5 @@
#FFFFFF
+ #FFF
diff --git a/assets/images-covidui/Drcorona.png b/assets/images-covidui/Drcorona.png
new file mode 100644
index 0000000..213ab75
Binary files /dev/null and b/assets/images-covidui/Drcorona.png differ
diff --git a/assets/images-covidui/caugh.png b/assets/images-covidui/caugh.png
new file mode 100644
index 0000000..5f15d62
Binary files /dev/null and b/assets/images-covidui/caugh.png differ
diff --git a/assets/images-covidui/coronadr.png b/assets/images-covidui/coronadr.png
new file mode 100644
index 0000000..bd18692
Binary files /dev/null and b/assets/images-covidui/coronadr.png differ
diff --git a/assets/images-covidui/fever.png b/assets/images-covidui/fever.png
new file mode 100644
index 0000000..a86cc0c
Binary files /dev/null and b/assets/images-covidui/fever.png differ
diff --git a/assets/images-covidui/headache.png b/assets/images-covidui/headache.png
new file mode 100644
index 0000000..b8aca8a
Binary files /dev/null and b/assets/images-covidui/headache.png differ
diff --git a/assets/images-covidui/map.png b/assets/images-covidui/map.png
new file mode 100644
index 0000000..3c78a7c
Binary files /dev/null and b/assets/images-covidui/map.png differ
diff --git a/assets/images-covidui/virus.png b/assets/images-covidui/virus.png
new file mode 100644
index 0000000..eafe6f9
Binary files /dev/null and b/assets/images-covidui/virus.png differ
diff --git a/assets/images-covidui/wash_hands.png b/assets/images-covidui/wash_hands.png
new file mode 100644
index 0000000..ea0ba75
Binary files /dev/null and b/assets/images-covidui/wash_hands.png differ
diff --git a/assets/images-covidui/wear_mask.png b/assets/images-covidui/wear_mask.png
new file mode 100644
index 0000000..014a024
Binary files /dev/null and b/assets/images-covidui/wear_mask.png differ
diff --git a/package.json b/package.json
index e1d3624..8fa6767 100644
--- a/package.json
+++ b/package.json
@@ -13,6 +13,7 @@
"@react-native-community/masked-view": "^0.1.10",
"@react-native-firebase/app": "^9.0.0",
"@react-native-firebase/auth": "^9.3.5",
+ "@react-native-firebase/firestore": "^7.10.3",
"@react-navigation/bottom-tabs": "^5.11.1",
"@react-navigation/native": "^5.8.9",
"@react-navigation/stack": "^5.12.6",
@@ -20,6 +21,7 @@
"expo-splash-screen": "~0.6.2",
"expo-status-bar": "~1.0.2",
"expo-updates": "~0.3.2",
+ "moment": "^2.29.1",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "~0.63.3",
@@ -29,6 +31,7 @@
"react-native-image-crop-picker": "^0.35.1",
"react-native-onboarding-swiper": "^1.1.4",
"react-native-paper": "^4.3.1",
+ "react-native-push-notification": "^6.1.3",
"react-native-really-awesome-button": "^1.6.0",
"react-native-reanimated": "^1.13.1",
"react-native-safe-area-context": "^3.1.9",
diff --git a/src/components/covidui/Block.js b/src/components/covidui/Block.js
new file mode 100644
index 0000000..d7fe937
--- /dev/null
+++ b/src/components/covidui/Block.js
@@ -0,0 +1,81 @@
+import React from 'react';
+import {View, Text, StyleSheet} from 'react-native';
+
+/*
+*
+
+Define props
+block : flex view
+margin
+padding
+width
+height
+border
+borderWidth
+borderColor
+color => is background color of view
+.... your can custom if you want
+
+*/
+
+const styles = StyleSheet.create({
+ block: {
+ flex: 1,
+ },
+});
+
+const Block = ({
+ block,
+ margin,
+ padding,
+ paddingHorizontal,
+ paddingVertical,
+ width,
+ height,
+ border,
+ borderWidth,
+ borderColor,
+ centered,
+ color,
+ style,
+ direction,
+ middle,
+ children,
+ justifyContent,
+ borderRadius,
+ shadow,
+ ...props
+}) => {
+ const styleComponent = [
+ block && styles.block,
+ margin && {margin},
+ padding && {padding},
+ width && {width},
+ height && {height},
+ border && {borderWidth: 1, borderColor: 'gray'},
+ borderWidth && {borderWidth},
+ borderColor && {borderColor},
+ color && {backgroundColor: color},
+ centered && {justifyContent: 'center'},
+ justifyContent && {justifyContent},
+ direction && {flexDirection: direction},
+ paddingVertical && {paddingVertical},
+ paddingHorizontal && {paddingHorizontal},
+ middle && {alignItems: 'center'},
+ borderRadius && {borderRadius},
+ shadow && {
+ shadowOpacity: 0.12,
+ shadowRadius: 15,
+ shadowColor: 'gray',
+ shadowOffset: {height: 0, width: 0},
+ },
+ style,
+ ];
+ return (
+
+ {children}
+
+ );
+};
+
+export default Block;
diff --git a/src/components/covidui/Button.js b/src/components/covidui/Button.js
new file mode 100644
index 0000000..a5ebdd9
--- /dev/null
+++ b/src/components/covidui/Button.js
@@ -0,0 +1,79 @@
+import React from 'react';
+import {TouchableOpacity, Text, StyleSheet} from 'react-native';
+
+/**
+ * define props => same Block
+ *
+ * TouchableOpacity is very cool
+ */
+
+const styles = StyleSheet.create({
+ block: {
+ flex: 1,
+ },
+});
+
+const Button = ({
+ block,
+ margin,
+ padding,
+ width,
+ height,
+ border,
+ borderWidth,
+ borderColor,
+ borderRadius,
+ color,
+ fontSize,
+ textColor,
+ style,
+ textStyle,
+ centered,
+ middle,
+ children,
+ shadow,
+ ...props
+}) => {
+ const styleComponent = [
+ block && styles.block,
+ margin && {margin},
+ padding && {padding},
+ width && {width},
+ height && {height},
+ border && {borderWidth: 1, borderColor: 'gray'},
+ borderWidth && {borderWidth},
+ borderColor && {borderColor},
+ borderRadius && {borderRadius},
+ color && {backgroundColor: color},
+ centered && {justifyContent: 'center'},
+ middle && {alignItems: 'center'},
+ shadow && {
+ shadowOpacity: 0.12,
+ shadowRadius: 15,
+ shadowColor: 'gray',
+ shadowOffset: {height: 0, width: 0},
+ },
+ style,
+ ];
+ const styleText = [
+ fontSize && {fontSize},
+ textColor && {color: textColor},
+ textStyle,
+ ];
+
+ if (typeof children == 'string') {
+ return (
+
+ {children}
+
+ );
+ }
+
+ return (
+
+ {children}
+
+ );
+};
+
+export default Button;
diff --git a/src/components/covidui/Input.js b/src/components/covidui/Input.js
new file mode 100644
index 0000000..029e1f8
--- /dev/null
+++ b/src/components/covidui/Input.js
@@ -0,0 +1,49 @@
+import React from 'react';
+import {View, Text, TextInput} from 'react-native';
+
+/**
+ * define props
+ * margin,
+ * padding,
+ * value,
+ * onTextChange => event change value
+ *
+ *
+ * vvv.....
+ * ...props => inheritance props of component InputText
+ *
+ */
+
+const Input = ({
+ margin,
+ padding,
+ value,
+ border,
+ radius,
+ onTextChange,
+ secureTextEntry,
+ style,
+ placeholder,
+ fontSize, // fontSize
+ ...props
+}) => {
+ const styleComponent = [
+ margin && {margin},
+ padding && {padding},
+ border && {borderWidth: 1, borderColor: 'gray'},
+ radius && {borderRadius: 8},
+ fontSize && {fontSize},
+ style,
+ ];
+ return (
+
+ );
+};
+
+export default Input;
diff --git a/src/components/covidui/TextView.js b/src/components/covidui/TextView.js
new file mode 100644
index 0000000..0a50d8b
--- /dev/null
+++ b/src/components/covidui/TextView.js
@@ -0,0 +1,58 @@
+import React from 'react';
+import {View, Text} from 'react-native';
+
+/**
+ * define props
+ * margin
+ * padding
+ * bgColor => background color for text
+ * color => color of text
+ * size => fontSize
+ * bold => if text is bold
+ * define heading size
+ * vv.....
+ */
+
+const TextView = ({
+ margin,
+ padding,
+ bgColor,
+ color,
+ size,
+ bold,
+ center,
+ h1,
+ h2,
+ h3,
+ h4,
+ h5,
+ h6,
+ style,
+ children,
+ ...props
+}) => {
+ const styleComponet = [
+ {fontSize: 14}, // default h6
+ margin && {margin},
+ padding && {padding},
+ bgColor && {backgroundColor: bgColor},
+ color && {color},
+ size && {fontSize: size},
+ bold && {fontWeight: 'bold'},
+ h1 && {fontSize: 44, fontWeight: 'bold'},
+ h2 && {fontSize: 38, fontWeight: 'bold'},
+ h3 && {fontSize: 32, fontWeight: 'bold'},
+ h4 && {fontSize: 28, fontWeight: 'bold'},
+ h5 && {fontSize: 22, fontWeight: 'bold'},
+ h6 && {fontSize: 18, fontWeight: 'bold'},
+ center && {textAlign: 'center'},
+ style,
+ ];
+ return (
+
+ {children}
+
+ );
+};
+
+export default TextView;
diff --git a/src/components/covidui/index.js b/src/components/covidui/index.js
new file mode 100644
index 0000000..eb4d30d
--- /dev/null
+++ b/src/components/covidui/index.js
@@ -0,0 +1,6 @@
+import Block from './Block';
+import TextView from './TextView';
+import Input from './Input';
+import Button from './Button';
+
+export {Block, TextView, Input, Button};
diff --git a/src/navigation/AppStack.js b/src/navigation/AppStack.js
index 48d84b2..f902070 100644
--- a/src/navigation/AppStack.js
+++ b/src/navigation/AppStack.js
@@ -11,7 +11,9 @@ import {
WalletScreen,
GroupScreen,
EditProfileScreen,
- ScanScreen
+ ScanScreen,
+ ShareCodeScreen,
+ SafetyMeasuresScreen
} from '../screens';
@@ -77,6 +79,23 @@ const HomeStack = ({ navigation }) => (
}
}}
/>
+
);
@@ -106,6 +125,23 @@ const ProfileStack = ({ navigation }) => (
}
}}
/>
+
);
diff --git a/src/navigation/ProfileProvider.js b/src/navigation/ProfileProvider.js
index 1544678..2e7ffc3 100644
--- a/src/navigation/ProfileProvider.js
+++ b/src/navigation/ProfileProvider.js
@@ -1,17 +1,53 @@
-import React, {createContext, useState} from 'react';
+import React, { createContext, useState, useContext } from 'react';
import auth from '@react-native-firebase/auth';
+import firestore from '@react-native-firebase/firestore';
+
+import { AuthContext } from './AuthProvider';
export const ProfileContext = createContext();
-export const ProfileProvider = ({children}) => {
+export const ProfileProvider = ({ children }) => {
+ const [deviceToken, setdeviceToken] = useState(null)
+
+ const { user } = useContext(AuthContext);
return (
{
+ deviceToken,
+ setdeviceToken,
+ storeCurrentDeviceInfo: async (deviceToken) => {
try {
- await auth().signInWithEmailAndPassword(email, password);
+
+ firestore()
+ .collection('users')
+ .doc(user.uid)
+ .set(
+ { deviceToken: deviceToken.token },
+ { merge: true }
+ )
+
+ } catch (e) {
+ console.log(e);
+ }
+ },
+ getCurrentDeviceInfo: async () => {
+ try {
+
+ firestore()
+ .collection('users')
+ .doc(user.uid)
+ .get()
+ .then((documentSnapshot) => {
+ let deviceToken = 'NA';
+ if (documentSnapshot.exists) {
+ deviceToken = documentSnapshot.data().deviceToken;
+ setdeviceToken(deviceToken);
+
+ }
+ })
+
} catch (e) {
console.log(e);
}
diff --git a/src/navigation/Routes.js b/src/navigation/Routes.js
index 37a24f2..38db395 100644
--- a/src/navigation/Routes.js
+++ b/src/navigation/Routes.js
@@ -1,11 +1,13 @@
import React, {useContext, useState, useEffect} from 'react';
+import { View } from 'react-native'
import {NavigationContainer} from '@react-navigation/native';
import auth from '@react-native-firebase/auth';
import {AuthContext} from './AuthProvider';
-
import AuthStack from './AuthStack';
import AppStack from './AppStack';
+import { PushController } from '../service'
+
export default function Routes() {
const {user, setUser} = useContext(AuthContext);
const [initializing, setInitializing] = useState(true);
@@ -25,6 +27,8 @@ export default function Routes() {
return (
{user ? : }
+ { user && }
+
);
};
diff --git a/src/navigation/index.js b/src/navigation/index.js
index 24d13b4..1c6f1a4 100644
--- a/src/navigation/index.js
+++ b/src/navigation/index.js
@@ -1,11 +1,18 @@
import React from 'react';
+
import { AuthProvider } from './AuthProvider';
+import { ProfileProvider } from './ProfileProvider';
+
import Routes from './Routes';
const Providers = () => {
+
+
return (
-
+
+
+
);
}
diff --git a/src/screens/HomeScreen/HomeScreen.js b/src/screens/HomeScreen/HomeScreen.js
index cff3951..a4cbc10 100644
--- a/src/screens/HomeScreen/HomeScreen.js
+++ b/src/screens/HomeScreen/HomeScreen.js
@@ -1,25 +1,141 @@
-import React ,{useContext} from 'react';
+import React, { useContext } from 'react';
import {
View,
- Text
+ Text,
+ Image,
+ ScrollView,
} from 'react-native';
+import moment from 'moment';
-
+import { Block, Button, TextView } from '../../components/covidui';
+import { color } from '../../utils/color';
+import Feather from 'react-native-vector-icons/Feather';
import styles from './styles';
-import {AuthContext} from '../../navigation/AuthProvider';
+import FormButton from '../../components/FormButton';
+import { AuthContext } from '../../navigation/AuthProvider';
export default function HomeScreen({ navigation }) {
const { logout } = useContext(AuthContext);
-
+ const ItemDot = ({ color1, color2, num, title }) => {
+ return (
+
+
+
+
+
+
+ {num}
+
+
+ {title}
+
+
+
+ );
+ };
return (
-
- This is HomeScreen
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Case Update
+ Newest update { moment().format("MMM Do YY") }
+
+
+
+
+
+
-
+
+
+
+
+ Spread of Virus
+
+
+
+
+
+
+
+ navigation.navigate('SafetyMeasures')}
+ />
+
+
+
+
);
diff --git a/src/screens/HomeScreen/styles.js b/src/screens/HomeScreen/styles.js
index 66047d4..922f8d2 100644
--- a/src/screens/HomeScreen/styles.js
+++ b/src/screens/HomeScreen/styles.js
@@ -1,11 +1,50 @@
import { StyleSheet, Dimensions } from 'react-native';
export default StyleSheet.create({
- container: {
- backgroundColor: '#f9fafd',
- flex: 1,
- justifyContent: 'center',
- alignItems: 'center',
- padding: 20,
- }
+ container: {
+ backgroundColor: '#f9fafd',
+ flex: 1,
+ justifyContent: 'center',
+ alignItems: 'center',
+ padding: 20,
+ },
+ img: {
+ width: '100%',
+ height: 300,
+ },
+ doctor: {
+ position: 'absolute',
+ top: 100,
+ left: 60,
+
+ // width: 50,
+ // height: 80,
+ },
+ wrapperimage: {
+ position: 'absolute',
+ bottom: 0,
+
+ alignSelf: 'center',
+ width: Dimensions.get('window').width,
+ height: 300,
+ },
+ bg: {
+ position: 'absolute',
+ width: 1000,
+ height: 1000,
+ top: -(930 - Dimensions.get('window').width / 2),
+ alignSelf: 'center',
+ // top: 500 - Dimensions.get('window').width / 2,
+ // left: 500 - Dimensions.get('window').width / 2,
+ borderRadius: 1000,
+ overflow: 'hidden',
+ },
+ containerHeader: {
+ position: 'relative',
+ },
+ map: {
+ borderRadius: 8,
+ marginTop: 15,
+ padding: 15,
+ },
})
\ No newline at end of file
diff --git a/src/screens/ProfileScreen/ProfileScreen.js b/src/screens/ProfileScreen/ProfileScreen.js
index 16c9097..706521a 100644
--- a/src/screens/ProfileScreen/ProfileScreen.js
+++ b/src/screens/ProfileScreen/ProfileScreen.js
@@ -81,7 +81,7 @@ export default function ProfileScreen({ navigation }) {
- { }}>
+ navigation.navigate('ShareCode')}>
Share your code
diff --git a/src/screens/SafetyMeasuresScreen/SafetyMeasuresScreen.js b/src/screens/SafetyMeasuresScreen/SafetyMeasuresScreen.js
new file mode 100644
index 0000000..2bcb4f4
--- /dev/null
+++ b/src/screens/SafetyMeasuresScreen/SafetyMeasuresScreen.js
@@ -0,0 +1,93 @@
+import React from 'react';
+import { Image, ScrollView } from 'react-native';
+
+import { Block, Button, TextView } from '../../components/covidui';
+import { color } from '../../utils/color';
+
+import styles from './styles';
+
+export default function SafetyMeasuresScreen({ navigation }) {
+
+ const Item = ({ icon, title }) => {
+ return (
+
+
+
+ );
+ };
+
+ const ItemField = ({ icon, title, desc }) => {
+ return (
+
+ );
+ };
+
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+ Symptomps
+
+
+
+
+
+
+
+
+
+ Prevention
+
+
+
+
+
+
+
+ );
+
+
+
+}
\ No newline at end of file
diff --git a/src/screens/SafetyMeasuresScreen/styles.js b/src/screens/SafetyMeasuresScreen/styles.js
new file mode 100644
index 0000000..341ceaf
--- /dev/null
+++ b/src/screens/SafetyMeasuresScreen/styles.js
@@ -0,0 +1,73 @@
+import { StyleSheet, Dimensions } from 'react-native';
+
+export default StyleSheet.create({
+ container: {
+ backgroundColor: '#f9fafd',
+ flex: 1,
+ justifyContent: 'center',
+ alignItems: 'center',
+ padding: 20,
+ },
+ img: {
+ width: '100%',
+ height: 300,
+ },
+ doctor: {
+ position: 'absolute',
+ top: 100,
+ left: -30,
+
+ // width: 50,
+ // height: 80,
+ },
+ wrapperimage: {
+ position: 'absolute',
+ bottom: 0,
+
+ alignSelf: 'center',
+ width: Dimensions.get('window').width,
+ height: 300,
+ },
+ bg: {
+ position: 'absolute',
+ width: 1000,
+ height: 1000,
+ top: -(930 - Dimensions.get('window').width / 2),
+ alignSelf: 'center',
+ // top: 500 - Dimensions.get('window').width / 2,
+ // left: 500 - Dimensions.get('window').width / 2,
+ borderRadius: 1000,
+ overflow: 'hidden',
+ },
+ containerHeader: {
+ position: 'relative',
+ },
+ map: {
+ borderRadius: 8,
+ marginTop: 15,
+ padding: 15,
+ },
+
+ img_item: {
+ width: (1.2 * Dimensions.get('window').width) / 3,
+ height: (1.2 * Dimensions.get('window').width) / 3,
+ },
+ field_con: {
+ // marginLeft: Dimensions.get('window').width / 2,
+ position: 'absolute',
+ width: (2 * Dimensions.get('window').width) / 3,
+ left: Dimensions.get('window').width / 3 + 10,
+ top: 10,
+ paddingVertical: 10,
+ },
+ textDesc: {
+ lineHeight: 20,
+ marginTop: 10,
+ maxWidth: (2 * Dimensions.get('window').width) / 3.4,
+ },
+ btn: {
+ position: 'absolute',
+ bottom: 10,
+ right: 10,
+ },
+})
\ No newline at end of file
diff --git a/src/screens/ScanScreen/ScanScreen.js b/src/screens/ScanScreen/ScanScreen.js
index 012d5cc..2ad1764 100644
--- a/src/screens/ScanScreen/ScanScreen.js
+++ b/src/screens/ScanScreen/ScanScreen.js
@@ -9,11 +9,8 @@ import Scanner from '../../components/Scanner';
import styles from './styles';
-import {AuthContext} from '../../navigation/AuthProvider';
-
export default function ScanScreen({ navigation }) {
- const { logout } = useContext(AuthContext);
const [isSocketRead, setIsSocketRead] = useState(false)
const onCancel = () => {
diff --git a/src/screens/ShareCodeScreen/ShareCodeScreen.js b/src/screens/ShareCodeScreen/ShareCodeScreen.js
new file mode 100644
index 0000000..bcd541a
--- /dev/null
+++ b/src/screens/ShareCodeScreen/ShareCodeScreen.js
@@ -0,0 +1,27 @@
+import React ,{useContext} from 'react';
+import {
+ View,
+ Text
+} from 'react-native';
+
+
+
+import styles from './styles';
+
+
+
+export default function ShareCodeScreen({ navigation }) {
+
+
+
+
+ return (
+
+ This is ShareCodeScreen
+
+
+ );
+
+
+
+}
\ No newline at end of file
diff --git a/src/screens/ShareCodeScreen/styles.js b/src/screens/ShareCodeScreen/styles.js
new file mode 100644
index 0000000..66047d4
--- /dev/null
+++ b/src/screens/ShareCodeScreen/styles.js
@@ -0,0 +1,11 @@
+import { StyleSheet, Dimensions } from 'react-native';
+
+export default StyleSheet.create({
+ container: {
+ backgroundColor: '#f9fafd',
+ flex: 1,
+ justifyContent: 'center',
+ alignItems: 'center',
+ padding: 20,
+ }
+})
\ No newline at end of file
diff --git a/src/screens/index.js b/src/screens/index.js
index 71db4bf..dea7bea 100644
--- a/src/screens/index.js
+++ b/src/screens/index.js
@@ -7,4 +7,6 @@ export { default as ProfileScreen } from './ProfileScreen/ProfileScreen';
export { default as WalletScreen } from './WalletScreen/WalletScreen';
export { default as GroupScreen } from './GroupScreen/GroupScreen';
export { default as EditProfileScreen } from './EditProfileScreen/EditProfileScreen';
-export { default as ScanScreen } from './ScanScreen/ScanScreen';
\ No newline at end of file
+export { default as ScanScreen } from './ScanScreen/ScanScreen';
+export { default as ShareCodeScreen } from './ShareCodeScreen/ShareCodeScreen';
+export { default as SafetyMeasuresScreen } from './SafetyMeasuresScreen/SafetyMeasuresScreen';
\ No newline at end of file
diff --git a/src/service/PushController.js b/src/service/PushController.js
new file mode 100644
index 0000000..ac9f54e
--- /dev/null
+++ b/src/service/PushController.js
@@ -0,0 +1,63 @@
+import React, { useContext, useState, useEffect } from 'react';
+import {
+ View,
+ Text
+} from 'react-native';
+import PushNotification from "react-native-push-notification";
+
+import AsyncStorage from '@react-native-async-storage/async-storage';
+
+import { ProfileContext } from '../navigation/ProfileProvider';
+
+export default function PushController({ navigation }) {
+ const { storeCurrentDeviceInfo, getCurrentDeviceInfo, deviceToken } = useContext(ProfileContext);
+
+ useEffect(() => {
+
+ getCurrentDeviceInfo();
+ PushNotification.configure({
+
+ onRegister: function (token) {
+
+ console.log("CURRENT TOKEN: ", token);
+ if (deviceToken != token.token) {
+ storeCurrentDeviceInfo(token).then(() => {
+ console.log('data saved to db')
+
+ })
+
+ } else {
+ console.log('token already stored in db')
+ }
+ },
+ onNotification: function (notification) {
+ console.log("NOTIFICATION:", notification);
+ // notification.finish(PushNotificationIOS.FetchResult.NoData);
+ },
+ onAction: function (notification) {
+ console.log("ACTION:", notification.action);
+ console.log("NOTIFICATION:", notification);
+ },
+ onRegistrationError: function (err) {
+ console.error(err.message, err);
+ },
+ senderID: "1090501687137",
+ permissions: {
+ alert: true,
+ badge: true,
+ sound: true,
+ },
+ popInitialNotification: true,
+ requestPermissions: true,
+ });
+ }, []);
+
+
+ return (
+
+
+ );
+
+
+
+}
\ No newline at end of file
diff --git a/src/service/index.js b/src/service/index.js
new file mode 100644
index 0000000..ef9d931
--- /dev/null
+++ b/src/service/index.js
@@ -0,0 +1 @@
+export { default as PushController } from './PushController';
\ No newline at end of file
diff --git a/src/utils/color.js b/src/utils/color.js
index 6397ef5..926351f 100644
--- a/src/utils/color.js
+++ b/src/utils/color.js
@@ -1,3 +1,11 @@
export const color = {
- "lightthemesecondary":"#2e64e5"
+ lightthemesecondary: "#2e64e5",
+ blue: '#3B00AB',
+ blue1: '#405DC9',
+ carot: '#FF7500',
+ carot_op: '#FFEDE3',
+ red: '#FF003D',
+ red_op: '#FFD6D8',
+ green: '#00D200',
+ green_op: '#CBFFD0',
}
\ No newline at end of file
diff --git a/yarn.lock b/yarn.lock
index e66703e..8dae4fc 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1944,6 +1944,11 @@
resolved "https://registry.yarnpkg.com/@react-native-firebase/auth/-/auth-9.3.5.tgz#4bd14b575a4cc33828e0b2d35b9b2c9c6a52d1ca"
integrity sha512-Z3ik2CASWFJ4YaMbuAMHY1DyBugv6BetPrz796zUIoEjNuAPUFOtYgGGhIcfBVLlj2W099fWgZUD1aKaOdHbwg==
+"@react-native-firebase/firestore@^7.10.3":
+ version "7.10.3"
+ resolved "https://registry.yarnpkg.com/@react-native-firebase/firestore/-/firestore-7.10.3.tgz#2f318e4f757ec42f81a976b1de8a55ab1d01561d"
+ integrity sha512-+RBgYAFEaWnGdnmWXR9mC9tTgCrmPcFtqsP+W0hLH3VBYGpxZCPJozzFWJhQHo6Scc8NR3Qpxxc4V8gm9+bImg==
+
"@react-navigation/bottom-tabs@^5.11.1":
version "5.11.1"
resolved "https://registry.yarnpkg.com/@react-navigation/bottom-tabs/-/bottom-tabs-5.11.1.tgz#58c4f784d3262f7fb6f3075b41f64e9617054087"
@@ -6048,6 +6053,11 @@ mkdirp@^0.5.1:
dependencies:
minimist "^1.2.5"
+moment@^2.29.1:
+ version "2.29.1"
+ resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3"
+ integrity sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==
+
ms@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
@@ -6832,6 +6842,11 @@ react-native-paper@^4.3.1:
color "^3.1.2"
react-native-safe-area-view "^0.14.9"
+react-native-push-notification@^6.1.3:
+ version "6.1.3"
+ resolved "https://registry.yarnpkg.com/react-native-push-notification/-/react-native-push-notification-6.1.3.tgz#e377e91fc931d541f23b3a156f3451bae5f441a2"
+ integrity sha512-qNbFCkObCXwSFQbK6hJyx1Bym1D7V4XM8iN2L6eL3GAdNLmeBTdLdx3mPbKJtuaDJ1+deniFTQ2rz6hU4ELOXA==
+
react-native-really-awesome-button@^1.6.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/react-native-really-awesome-button/-/react-native-really-awesome-button-1.6.0.tgz#71700f960aa6d419058beff177c7b6cf18694ef7"