Skip to content

Commit

Permalink
feat: add basic app structure dependencies and RNCAsyncStorage package
Browse files Browse the repository at this point in the history
  • Loading branch information
onehassan committed Apr 24, 2024
1 parent a092ca9 commit aa606fb
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 7 deletions.
6 changes: 6 additions & 0 deletions examples/react_native/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1113,6 +1113,8 @@ PODS:
- React-jsi (= 0.73.7)
- React-logger (= 0.73.7)
- React-perflogger (= 0.73.7)
- RNCAsyncStorage (1.23.1):
- React-Core
- RNScreens (3.30.1):
- glog
- RCT-Folly (= 2022.05.16.00)
Expand Down Expand Up @@ -1194,6 +1196,7 @@ DEPENDENCIES:
- React-runtimescheduler (from `../node_modules/react-native/ReactCommon/react/renderer/runtimescheduler`)
- React-utils (from `../node_modules/react-native/ReactCommon/react/utils`)
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
- "RNCAsyncStorage (from `../node_modules/@react-native-async-storage/async-storage`)"
- RNScreens (from `../node_modules/react-native-screens`)
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)

Expand Down Expand Up @@ -1311,6 +1314,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/react/utils"
ReactCommon:
:path: "../node_modules/react-native/ReactCommon"
RNCAsyncStorage:
:path: "../node_modules/@react-native-async-storage/async-storage"
RNScreens:
:path: "../node_modules/react-native-screens"
Yoga:
Expand Down Expand Up @@ -1377,6 +1382,7 @@ SPEC CHECKSUMS:
React-runtimescheduler: a884a55560e2a90caa1cbe0b9eaa24a5add4fa2c
React-utils: d07d009101c7dabff68b710da5c4a47b7a850d98
ReactCommon: 8cae78d3c3eceff20ee4bbca8bb73b675a45fd5d
RNCAsyncStorage: 826b603ae9c0f88b5ac4e956801f755109fa4d5c
RNScreens: b6b64d956af3715adbfe84808694ae82d3fec74f
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
Yoga: c716aea2ee01df6258550c7505fa61b248145ced
Expand Down
1 change: 1 addition & 0 deletions examples/react_native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"dependencies": {
"@nhost/react": "workspace:*",
"@react-native-async-storage/async-storage": "^1.23.1",
"@react-navigation/native": "^6.1.17",
"@react-navigation/native-stack": "^6.9.26",
"react": "18.2.0",
Expand Down
7 changes: 6 additions & 1 deletion examples/react_native/src/root.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import React from 'react';

import {NhostClient, NhostProvider} from '@nhost/react';
import AsyncStorage from '@react-native-async-storage/async-storage';
import Main from './screens/Main';

const nhost = new NhostClient({subdomain: 'local'});
const nhost = new NhostClient({
subdomain: 'local',
clientStorageType: 'react-native',
clientStorage: AsyncStorage,
});

function App() {
return (
Expand Down
10 changes: 5 additions & 5 deletions examples/react_native/src/screens/SignUp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,21 @@ export default function SignUp() {
});

if (isError) {
Alert.alert('An error has happened');
console.log({error});
return;
}

if (needsEmailVerification) {
Alert.alert(
"Click on the link we've sent to your inbox to verify your account",
'Check your inbox',
"Click on the link we've sent to your inbox to verify your account and sign in",
);
return;
}

// Everything went fine

console.log({user});
console.log({
user,
});
};

return (
Expand Down
20 changes: 19 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit aa606fb

Please sign in to comment.