diff --git a/App.tsx b/App.tsx index 75585965..6ad02009 100644 --- a/App.tsx +++ b/App.tsx @@ -8,115 +8,27 @@ * @format */ -import React, {type PropsWithChildren} from 'react'; -import { - SafeAreaView, - ScrollView, - StatusBar, - StyleSheet, - Text, - useColorScheme, - View, -} from 'react-native'; - -import { - Colors, - DebugInstructions, - Header, - LearnMoreLinks, - ReloadInstructions, -} from 'react-native/Libraries/NewAppScreen'; - -const Section: React.FC< - PropsWithChildren<{ - title: string; - }> -> = ({children, title}) => { - const isDarkMode = useColorScheme() === 'dark'; - return ( - - - {title} - - - {children} - - - ); -}; +import React from 'react'; +import {SafeAreaView, Text} from 'react-native'; +import data from './src/data/data.json'; +import RenderingEngine from './src/components/formRenderingEngine'; +import {Provider} from 'react-redux'; +import store, {persistor} from './src/store/store'; +import {PersistGate} from 'redux-persist/integration/react'; const App = () => { - const isDarkMode = useColorScheme() === 'dark'; - - const backgroundStyle = { - backgroundColor: isDarkMode ? Colors.darker : Colors.lighter, - }; - + // const [hasBeenManuplated, setHasBeenManuplated] = useState(false); return ( - - - -
- -
- Edit App.tsx to - change this screen and then come back to see your edits. -
-
- -
-
- -
-
- Read the docs to discover what to do next: -
- -
- - + + Loading...} + persistor={persistor}> + + + + + ); }; -const styles = StyleSheet.create({ - sectionContainer: { - marginTop: 32, - paddingHorizontal: 24, - }, - sectionTitle: { - fontSize: 24, - fontWeight: '600', - }, - sectionDescription: { - marginTop: 8, - fontSize: 18, - fontWeight: '400', - }, - highlight: { - fontWeight: '700', - }, -}); - export default App; diff --git a/android/app/build.gradle b/android/app/build.gradle index b38d1870..5e875e4c 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -1,5 +1,5 @@ apply plugin: "com.android.application" - +apply plugin: 'com.google.gms.google-services' import com.android.build.OutputFile import org.apache.tools.ant.taskdefs.condition.Os diff --git a/android/app/google-services.json b/android/app/google-services.json new file mode 100644 index 00000000..c4688956 --- /dev/null +++ b/android/app/google-services.json @@ -0,0 +1,39 @@ +{ + "project_info": { + "project_number": "60755663443", + "project_id": "address-verification-app", + "storage_bucket": "address-verification-app.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:60755663443:android:988149d3da3c00d38584a6", + "android_client_info": { + "package_name": "com.avapp" + } + }, + "oauth_client": [ + { + "client_id": "60755663443-40k0fbrbbqv4ci4hrjlbrphab5fj387b.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyA70_d2M2ke-Mu0OHGZ6iZilBbD6A-_z0c" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "60755663443-40k0fbrbbqv4ci4hrjlbrphab5fj387b.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/android/build.gradle b/android/build.gradle index 8569fee3..85099672 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -25,6 +25,7 @@ buildscript { classpath("de.undercouch:gradle-download-task:5.0.1") // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files + classpath 'com.google.gms:google-services:4.3.14' } } diff --git a/index.js b/index.js index a850d031..60d4cb4b 100644 --- a/index.js +++ b/index.js @@ -5,5 +5,8 @@ import {AppRegistry} from 'react-native'; import App from './App'; import {name as appName} from './app.json'; +import database from '@react-native-firebase/database'; + +database().setPersistenceEnabled(true); AppRegistry.registerComponent(appName, () => App); diff --git a/package.json b/package.json index 4dcae65d..f20409f5 100644 --- a/package.json +++ b/package.json @@ -8,11 +8,19 @@ "start": "react-native start", "test": "jest", "prettier:write": "npx prettier --write **/*.{js,jsx,ts,tsx,json} && npx prettier --write *.{js,jsx,ts,tsx,json}", - "lint": "tsc --noEmit && eslint --ext .js,.jsx,.ts,.tsx ./" + "lint": "tsc --noEmit && eslint --ext .js,.jsx,.ts,.tsx ./", + "release": "react-native run-android --variant=release && cd android && ./gradlew assembleDebug" }, "dependencies": { + "@react-native-async-storage/async-storage": "1.17.11", + "@react-native-firebase/app": "^16.4.6", + "@react-native-firebase/database": "^16.4.6", + "@reduxjs/toolkit": "1.9.1", "react": "18.1.0", - "react-native": "0.70.6" + "react-native": "0.70.6", + "react-redux": "8.0.5", + "redux": "4.2.0", + "redux-persist": "6.0.0" }, "devDependencies": { "@babel/core": "7.12.9", diff --git a/src/action/index.ts b/src/action/index.ts new file mode 100644 index 00000000..3ecfa9bf --- /dev/null +++ b/src/action/index.ts @@ -0,0 +1,11 @@ +export const ADD_TODO = 'ADD_TODO'; + +let todoId = 0; + +export const addTodo = (task: any) => ({ + type: ADD_TODO, + payload: { + id: ++todoId, + task, + }, +}); diff --git a/src/components/formRenderingEngine/index.tsx b/src/components/formRenderingEngine/index.tsx new file mode 100644 index 00000000..38ef19a3 --- /dev/null +++ b/src/components/formRenderingEngine/index.tsx @@ -0,0 +1,38 @@ +// @ts-nocheck +import {Button, Text, View} from 'react-native'; +import React from 'react'; +import {Template} from './types'; +import {useDispatch, useSelector} from 'react-redux'; +import {RootState} from '../../store/store'; +import { increaseByOne } from '../../reducer/caseReducre'; + +interface RenderingEngine { + data: Template; +} + +const RenderingEngine: React.FC = props => { + const dispatch = useDispatch(); + const journey = props?.data?.journeys; + const journeyOrder = props?.data?.journey_order; + console.log(journey, journeyOrder, 'journey '); + const data = useSelector((state: RootState) => state.counter.value); + + console.log(data, 'cda'); + + journeyOrder.map(eachJourney => console.log(journey[eachJourney])); + + const handlePress = () => { + dispatch(increaseByOne()); + }; + + return ( + + Rendering Engine {data} +