From 267a122f3c2401d176b8823b93ad4c03bbafebae Mon Sep 17 00:00:00 2001 From: Arif Ali <51419655+arifali123@users.noreply.github.com> Date: Sun, 1 Dec 2024 16:35:01 -0800 Subject: [PATCH] working on sdk 52 --- .gitignore | 3 + app.json | 8 +- app/(auth)/profile.tsx | 58 +- app/(public)/login.tsx | 93 +- app/(public)/register.tsx | 108 +- app/(public)/reset.tsx | 63 +- app/_layout.tsx | 30 +- babel.config.js | 6 +- eas.json | 24 + index.js | 1 - package-lock.json | 26121 ------------------------------------ package.json | 54 +- yarn.lock | 6900 ++++++++++ 13 files changed, 7216 insertions(+), 26253 deletions(-) create mode 100644 eas.json delete mode 100644 index.js delete mode 100644 package-lock.json create mode 100644 yarn.lock diff --git a/.gitignore b/.gitignore index ec8a36a..dc0b6a3 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,9 @@ npm-debug.* *.mobileprovision *.orig.* web-build/ +ios/ +android/ +.env # macOS .DS_Store diff --git a/app.json b/app.json index 8bb1985..51cba9f 100644 --- a/app.json +++ b/app.json @@ -7,7 +7,11 @@ "name": "clerkApp", "slug": "clerkApp", "plugins": [ - "expo-router" - ] + "expo-router", + "expo-secure-store" + ], + "ios": { + "bundleIdentifier": "com.anonymous.clerkApp" + } } } diff --git a/app/(auth)/profile.tsx b/app/(auth)/profile.tsx index 9680444..28f0ad7 100644 --- a/app/(auth)/profile.tsx +++ b/app/(auth)/profile.tsx @@ -1,34 +1,52 @@ -import { View, Text, Button, TextInput, StyleSheet } from 'react-native'; -import { useState } from 'react'; -import { useUser } from '@clerk/clerk-expo'; +import { View, Text, Button, TextInput, StyleSheet } from "react-native"; +import { useState } from "react"; +import { useUser } from "@clerk/clerk-expo"; const Profile = () => { const { user } = useUser(); - const [firstName, setFirstName] = useState(user.firstName); - const [lastName, setLastName] = useState(user.lastName); + const [firstName, setFirstName] = useState(user?.firstName ?? ""); + const [lastName, setLastName] = useState(user?.lastName ?? ""); const onSaveUser = async () => { try { - // This is not working! - const result = await user.update({ - firstName: 'John', - lastName: 'Doe', + await user.update({ + firstName, + lastName, }); - console.log('🚀 ~ file: profile.tsx:16 ~ onSaveUser ~ result:', result); - } catch (e) { - console.log('🚀 ~ file: profile.tsx:18 ~ onSaveUser ~ e', JSON.stringify(e)); + } catch (e: any) { + alert(e.errors[0].message); } }; return ( - - Good morning {user.firstName} {user.lastName}! + + Good morning {user?.firstName} {user?.lastName}! - - - + + + + + + + +