Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .expo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
> Why do I have a folder named ".expo" in my project?
The ".expo" folder is created when an Expo project is started using "expo start" command.
> What do the files contain?
- "devices.json": contains information about devices that have recently opened this project. This is used to populate the "Development sessions" list in your development builds.
- "settings.json": contains the server configuration that is used to serve the application manifest.
> Should I commit the ".expo" folder?
No, you should not share the ".expo" folder. It does not contain any information that is relevant for other developers working on the project, it is specific to your machine.
Upon project creation, the ".expo" folder is already added to your ".gitignore" file.
3 changes: 3 additions & 0 deletions .expo/devices.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"devices": []
}
38 changes: 38 additions & 0 deletions RDSExpoApp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files

# dependencies
node_modules/

# Expo
.expo/
dist/
web-build/
expo-env.d.ts

# Native
*.orig.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision

# Metro
.metro-health-check*

# debug
npm-debug.*
yarn-debug.*
yarn-error.*

# macOS
.DS_Store
*.pem

# local env files
.env*.local

# typescript
*.tsbuildinfo

app-example
85 changes: 85 additions & 0 deletions RDSExpoApp/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import NetInfo from '@react-native-community/netinfo';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import createSagaMiddleware from '@redux-saga/core';
import React, { useContext, useEffect, useState } from 'react';
import Toast from 'react-native-toast-message';
import { Provider, useSelector } from 'react-redux';
import { applyMiddleware, compose, createStore } from 'redux';

import AuthScreen from './app/screens/AuthScreen/AuthScreen';
import ConnectionScreen from './app/screens/ConnectionScreen/ConnectionScreen';
import AuthContext, { AuthProvider } from './components/context/AuthContext';
import TabNavigation from './components/navigations/TabNavigation/TabNavigation';
import reducers from './components/reducers';
import rootSaga from './components/sagas/rootSaga';
import LoadingScreen from './components/src/LoadingScreen';


const sagaMiddleware = createSagaMiddleware();
const store = compose(applyMiddleware(sagaMiddleware))(createStore)(reducers);
sagaMiddleware.run(rootSaga);


const Stack = createStackNavigator();

const App = () => {

const { isLoading, loggedInUserData } = useContext(AuthContext);

Check failure on line 29 in RDSExpoApp/App.tsx

View workflow job for this annotation

GitHub Actions / build (18.x)

'isProdEnvironment' is assigned a value but never used

Check failure on line 30 in RDSExpoApp/App.tsx

View workflow job for this annotation

GitHub Actions / build (18.x)

'store' is already declared in the upper scope on line 19 column 7
const [isConnected, setIsConnected] = useState<boolean>(false);


const { isProdEnvironment } = useSelector((store: any) => store.localFeatureFlag);


const retryConnection = async () => {
try {
const state = await NetInfo.fetch();
setIsConnected(state.isConnected ?? false);
} catch (error) {
console.error(error);
}
};


useEffect(() => {
const unsubscribe = NetInfo.addEventListener((state) => {
setIsConnected(state.isConnected ?? false);
});

return () => {
unsubscribe();
};
}, []);


if (isLoading) {
return <LoadingScreen />;
}


if (!isConnected) {
return <ConnectionScreen retryConnect={retryConnection} />;
}

return (
<Provider store={store}>
<AuthProvider>
<NavigationContainer>
<Stack.Navigator>
{loggedInUserData ? (
<Stack.Screen name="Home" component={TabNavigation} />
) : (
<Stack.Screen name="Auth" component={AuthScreen} />
)}
</Stack.Navigator>
</NavigationContainer>
</AuthProvider>
<Toast />
</Provider>
);
};

export default App;
50 changes: 50 additions & 0 deletions RDSExpoApp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Welcome to your Expo app 👋

This is an [Expo](https://expo.dev) project created with [`create-expo-app`](https://www.npmjs.com/package/create-expo-app).

## Get started

1. Install dependencies

```bash
npm install
```

2. Start the app

```bash
npx expo start
```

In the output, you'll find options to open the app in a

- [development build](https://docs.expo.dev/develop/development-builds/introduction/)
- [Android emulator](https://docs.expo.dev/workflow/android-studio-emulator/)
- [iOS simulator](https://docs.expo.dev/workflow/ios-simulator/)
- [Expo Go](https://expo.dev/go), a limited sandbox for trying out app development with Expo

You can start developing by editing the files inside the **app** directory. This project uses [file-based routing](https://docs.expo.dev/router/introduction).

## Get a fresh project

When you're ready, run:

```bash
npm run reset-project
```

This command will move the starter code to the **app-example** directory and create a blank **app** directory where you can start developing.

## Learn more

To learn more about developing your project with Expo, look at the following resources:

- [Expo documentation](https://docs.expo.dev/): Learn fundamentals, or go into advanced topics with our [guides](https://docs.expo.dev/guides).
- [Learn Expo tutorial](https://docs.expo.dev/tutorial/introduction/): Follow a step-by-step tutorial where you'll create a project that runs on Android, iOS, and the web.

## Join the community

Join our community of developers creating universal apps.

- [Expo on GitHub](https://github.com/expo/expo): View our open source platform and contribute.
- [Discord community](https://chat.expo.dev): Chat with Expo users and ask questions.
41 changes: 41 additions & 0 deletions RDSExpoApp/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"expo": {
"name": "RDSExpoApp",
"slug": "RDSExpoApp",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/rdsLogo.png",
"scheme": "myapp",
"userInterfaceStyle": "automatic",
"newArchEnabled": true,
"ios": {
"supportsTablet": true
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/home.png",
"backgroundColor": "#ffffff"
}
},
"web": {
"bundler": "metro",
"output": "static",
"favicon": "./assets/images/favicon.png"
},
"plugins": [
[
"expo-splash-screen",
{
"image": "./assets/images/splash-icon.png",
"imageWidth": 200,
"resizeMode": "contain",
"backgroundColor": "#ffffff"
}
],
"expo-secure-store"
],
"experiments": {
"typedRoutes": true
}
}
}
Loading
Loading