feat: integrate login, registration steps and splash screen changes
This commit is contained in:
@@ -0,0 +1,204 @@
|
|||||||
|
Diagnose log at 2026-05-08T08:22:50Z
|
||||||
|
|
||||||
|
AppPath: C:\Users\Lincpay\AppData\Local\Programs\Git\mingw64\bin\git-credential-manager.exe
|
||||||
|
InstallDir: C:\Users\Lincpay\AppData\Local\Programs\Git\mingw64\bin\
|
||||||
|
Version: 2.5.0+d34930736e131ad80e5690e5634ced1808aff3e2
|
||||||
|
|
||||||
|
------------
|
||||||
|
Diagnostic: Environment
|
||||||
|
Skipped: False
|
||||||
|
Success: True
|
||||||
|
Exception: None
|
||||||
|
Log:
|
||||||
|
OSType: Windows
|
||||||
|
OSVersion: 10.0 (build 26200)
|
||||||
|
Reading environment variables... OK
|
||||||
|
Variables:
|
||||||
|
HOMEPATH=\Users\Lincpay
|
||||||
|
DriverData=C:\Windows\System32\Drivers\DriverData
|
||||||
|
COMPUTERNAME=DESKTOP-TAFQRBL
|
||||||
|
GIT_TRACE2_PARENT_SID=3fbdeb66-dea1-404d-b65e-01414608f6f1
|
||||||
|
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
|
||||||
|
OneDrive=C:\Users\Lincpay\OneDrive
|
||||||
|
CODEX_THREAD_ID=019e0662-b081-7d10-a202-980cf9131ff1
|
||||||
|
SESSIONNAME=Console
|
||||||
|
TMP=C:\Users\Lincpay\AppData\Local\Temp
|
||||||
|
PROCESSOR_REVISION=8e0c
|
||||||
|
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW;.CPL
|
||||||
|
USERNAME=Lincpay
|
||||||
|
GIT_EXEC_PATH=C:/Users/Lincpay/AppData/Local/Programs/Git/mingw64/libexec/git-core
|
||||||
|
TEMP=C:\Users\Lincpay\AppData\Local\Temp
|
||||||
|
LOCALAPPDATA=C:\Users\Lincpay\AppData\Local
|
||||||
|
MSYSTEM=MINGW64
|
||||||
|
TERM=xterm-256color
|
||||||
|
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 142 Stepping 12, GenuineIntel
|
||||||
|
ProgramData=C:\ProgramData
|
||||||
|
windir=C:\WINDOWS
|
||||||
|
JAVA_HOME=C:\Program Files\Microsoft\jdk-17.0.14.7-hotspot\
|
||||||
|
USERDOMAIN=DESKTOP-TAFQRBL
|
||||||
|
PROCESSOR_LEVEL=6
|
||||||
|
NUMBER_OF_PROCESSORS=8
|
||||||
|
TMPDIR=C:\Users\Lincpay\AppData\Local\Temp
|
||||||
|
VSCODE_IPC_HOOK=\\.\pipe\547cb42d-1.107.0-main-sock
|
||||||
|
ProgramFiles(x86)=C:\Program Files (x86)
|
||||||
|
PUBLIC=C:\Users\Public
|
||||||
|
VSCODE_NLS_CONFIG={"userLocale":"en-us","osLocale":"en-in","resolvedLanguage":"en","defaultMessagesFile":"C:\\Users\\Lincpay\\AppData\\Local\\Programs\\Antigravity\\resources\\app\\out\\nls.messages.json","locale":"en-us","availableLanguages":{}}
|
||||||
|
CommonProgramFiles=C:\Program Files (x86)\Common Files
|
||||||
|
VSCODE_ESM_ENTRYPOINT=vs/workbench/api/node/extensionHostProcess
|
||||||
|
GRADLE_HOME=C:\ProgramData\chocolatey\lib\gradle\tools\gradle-8.12.1
|
||||||
|
ProgramFiles=C:\Program Files (x86)
|
||||||
|
PLINK_PROTOCOL=ssh
|
||||||
|
COLORTERM=truecolor
|
||||||
|
MSYS=enable_pcon
|
||||||
|
PATH=C:/Users/Lincpay/AppData/Local/Programs/Git/mingw64/libexec/git-core;C:\Users\Lincpay\AppData\Local\Programs\Git\mingw64\bin;C:\Users\Lincpay\AppData\Local\Programs\Git\usr\bin;C:\Users\Lincpay\bin;C:\Users\Lincpay\.codex\tmp\arg0\codex-arg0wLCfTN;C:\Python313\Scripts\;C:\Python313\;C:\Program Files\Microsoft\jdk-17.0.14.7-hotspot\bin;C:\Program Files\Java\jdk-17\bin;C:\Users\Lincpay\AppData\Local\Android\Sdk\platform-tools;C:\ProgramData\chocolatey\bin;C:\Users\DELL\AppData\Local\nvm;C:\nvm4w\nodejs;C:\Users\Lincpay\AppData\Local\Android\Sdk\emulator;C:\Program Files\nodejs\;C:\Windows\System32;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Users\Lincpay\.console-ninja\.bin;C:\Users\Lincpay\AppData\Local\Microsoft\WindowsApps;C:\Users\Lincpay\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Lincpay\AppData\Local\Programs\Git\cmd;C:\Users\Lincpay\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\MongoDB Atlas CLI\;C:\Users\Lincpay\AppData\Local\Programs\Antigravity\bin;C:\Users\Lincpay\AppData\Local\Android\Sdk\emulator;C:\Users\Lincpay\AppData\Local\Android\Sdk\platform-tools;C:\Users\Lincpay\AppData\Local\Programs\cursor\resources\app\bin;c:\Users\Lincpay\.antigravity\extensions\openai.chatgpt-26.506.21252-win32-x64\bin\windows-x86_64
|
||||||
|
ChocolateyInstall=C:\ProgramData\chocolatey
|
||||||
|
DEBUG=release
|
||||||
|
VSCODE_L10N_BUNDLE_LOCATION=
|
||||||
|
VSCODE_CODE_CACHE_PATH=C:\Users\Lincpay\AppData\Roaming\Antigravity\CachedData\15487b3041e65228cae24980a3f796c905ef582c
|
||||||
|
ProgramW6432=C:\Program Files
|
||||||
|
NVM_SYMLINK=C:\nvm4w\nodejs
|
||||||
|
NVM_HOME=C:\Users\DELL\AppData\Local\nvm
|
||||||
|
HOME=C:\Users\Lincpay
|
||||||
|
VSCODE_HANDLES_UNCAUGHT_ERRORS=true
|
||||||
|
LC_CTYPE=C.UTF-8
|
||||||
|
CommonProgramW6432=C:\Program Files\Common Files
|
||||||
|
ZES_ENABLE_SYSMAN=1
|
||||||
|
LOGONSERVER=\\DESKTOP-TAFQRBL
|
||||||
|
VSCODE_CWD=C:\Users\Lincpay\AppData\Local\Programs\Antigravity
|
||||||
|
EFC_10100_1592913036=1
|
||||||
|
SystemRoot=C:\WINDOWS
|
||||||
|
CODEX_INTERNAL_ORIGINATOR_OVERRIDE=codex_vscode
|
||||||
|
USERDOMAIN_ROAMINGPROFILE=DESKTOP-TAFQRBL
|
||||||
|
APPDATA=C:\Users\Lincpay\AppData\Roaming
|
||||||
|
HOMEDRIVE=C:
|
||||||
|
RUST_LOG=warn
|
||||||
|
VSCODE_PID=14604
|
||||||
|
PSModulePath=C:\Users\Lincpay\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
|
||||||
|
ELECTRON_RUN_AS_NODE=1
|
||||||
|
CHROME_CRASHPAD_PIPE_NAME=\\.\pipe\crashpad_14604_MTACWRXOBAGKDEGK
|
||||||
|
PROCESSOR_ARCHITEW6432=AMD64
|
||||||
|
PROCESSOR_ARCHITECTURE=x86
|
||||||
|
USERPROFILE=C:\Users\Lincpay
|
||||||
|
OS=Windows_NT
|
||||||
|
ComSpec=C:\WINDOWS\system32\cmd.exe
|
||||||
|
SystemDrive=C:
|
||||||
|
VSCODE_CRASH_REPORTER_PROCESS_TYPE=extensionHost
|
||||||
|
OneDriveConsumer=C:\Users\Lincpay\OneDrive
|
||||||
|
ALLUSERSPROFILE=C:\ProgramData
|
||||||
|
|
||||||
|
|
||||||
|
------------
|
||||||
|
Diagnostic: File system
|
||||||
|
Skipped: False
|
||||||
|
Success: True
|
||||||
|
Exception: None
|
||||||
|
Log:
|
||||||
|
Temporary directory is 'C:\Users\Lincpay\AppData\Local\Temp\'...
|
||||||
|
Checking basic file I/O...
|
||||||
|
Writing to temporary file 'C:\Users\Lincpay\AppData\Local\Temp\96ba4635bdd4d82432d7df06'... OK
|
||||||
|
Reading from temporary file 'C:\Users\Lincpay\AppData\Local\Temp\96ba4635bdd4d82432d7df06'... OK
|
||||||
|
Deleting temporary file 'C:\Users\Lincpay\AppData\Local\Temp\96ba4635bdd4d82432d7df06'... OK
|
||||||
|
Testing IFileSystem instance...
|
||||||
|
UserHomePath: C:\Users\Lincpay
|
||||||
|
UserDataDirectoryPath: C:\Users\Lincpay\.gcm
|
||||||
|
GetCurrentDirectory(): D:\ProcureLinc\Procurelinc
|
||||||
|
|
||||||
|
------------
|
||||||
|
Diagnostic: Networking
|
||||||
|
Skipped: False
|
||||||
|
Success: True
|
||||||
|
Exception: None
|
||||||
|
Log:
|
||||||
|
Checking networking and HTTP stack...
|
||||||
|
Creating HTTP client... OK
|
||||||
|
IsNetworkAvailable: True
|
||||||
|
Sending HEAD request to http://example.com...Sending HEAD request to https://example.com... OK
|
||||||
|
OK
|
||||||
|
Acquiring free TCP port... OK
|
||||||
|
Testing local HTTP loopback connections...
|
||||||
|
Creating new HTTP listener for http://localhost:55697/... OK
|
||||||
|
Waiting for loopback connection... OK
|
||||||
|
Writing response... OK
|
||||||
|
Waiting for response data... OK
|
||||||
|
Loopback connection data OK
|
||||||
|
|
||||||
|
------------
|
||||||
|
Diagnostic: Git
|
||||||
|
Skipped: False
|
||||||
|
Success: True
|
||||||
|
Exception: None
|
||||||
|
Log:
|
||||||
|
Getting Git version... OK
|
||||||
|
Git version is '2.45.2.windows.1'
|
||||||
|
Locating current repository...Git repository at 'D:/ProcureLinc/Procurelinc/.git'
|
||||||
|
OK
|
||||||
|
Listing all Git configuration... OK
|
||||||
|
Git configuration:
|
||||||
|
file:C:/Users/Lincpay/AppData/Local/Programs/Git/etc/gitconfig diff.astextplain.textconv=astextplain
|
||||||
|
file:C:/Users/Lincpay/AppData/Local/Programs/Git/etc/gitconfig filter.lfs.clean=git-lfs clean -- %f
|
||||||
|
file:C:/Users/Lincpay/AppData/Local/Programs/Git/etc/gitconfig filter.lfs.smudge=git-lfs smudge -- %f
|
||||||
|
file:C:/Users/Lincpay/AppData/Local/Programs/Git/etc/gitconfig filter.lfs.process=git-lfs filter-process
|
||||||
|
file:C:/Users/Lincpay/AppData/Local/Programs/Git/etc/gitconfig filter.lfs.required=true
|
||||||
|
file:C:/Users/Lincpay/AppData/Local/Programs/Git/etc/gitconfig http.sslbackend=openssl
|
||||||
|
file:C:/Users/Lincpay/AppData/Local/Programs/Git/etc/gitconfig http.sslcainfo=C:/Users/Lincpay/AppData/Local/Programs/Git/mingw64/etc/ssl/certs/ca-bundle.crt
|
||||||
|
file:C:/Users/Lincpay/AppData/Local/Programs/Git/etc/gitconfig core.autocrlf=true
|
||||||
|
file:C:/Users/Lincpay/AppData/Local/Programs/Git/etc/gitconfig core.fscache=true
|
||||||
|
file:C:/Users/Lincpay/AppData/Local/Programs/Git/etc/gitconfig core.symlinks=false
|
||||||
|
file:C:/Users/Lincpay/AppData/Local/Programs/Git/etc/gitconfig pull.rebase=false
|
||||||
|
file:C:/Users/Lincpay/AppData/Local/Programs/Git/etc/gitconfig credential.helper=manager
|
||||||
|
file:C:/Users/Lincpay/AppData/Local/Programs/Git/etc/gitconfig credential.https://dev.azure.com.usehttppath=true
|
||||||
|
file:C:/Users/Lincpay/AppData/Local/Programs/Git/etc/gitconfig init.defaultbranch=master
|
||||||
|
file:C:/Users/Lincpay/.gitconfig user.email=abintoppo96@gmail.com
|
||||||
|
file:C:/Users/Lincpay/.gitconfig user.name=Abin Toppo
|
||||||
|
file:C:/Users/Lincpay/.gitconfig credential.https://git.lincpay.in.provider=generic
|
||||||
|
file:C:/Users/Lincpay/.gitconfig credential.https://git.zeptic.in.provider=generic
|
||||||
|
file:C:/Users/Lincpay/.gitconfig credential.http://dev1.lincpay:3000.provider=generic
|
||||||
|
file:.git/config core.repositoryformatversion=0
|
||||||
|
file:.git/config core.filemode=false
|
||||||
|
file:.git/config core.bare=false
|
||||||
|
file:.git/config core.logallrefupdates=true
|
||||||
|
file:.git/config core.symlinks=false
|
||||||
|
file:.git/config core.ignorecase=true
|
||||||
|
file:.git/config remote.origin.url=http://dev1.lincpay:3000/rohit/Procurelinc.git
|
||||||
|
file:.git/config remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
|
||||||
|
file:.git/config branch.dev.remote=origin
|
||||||
|
file:.git/config branch.dev.merge=refs/heads/dev
|
||||||
|
file:.git/config branch.dev.vscode-merge-base=origin/main
|
||||||
|
file:.git/config branch.featureDSc/device.vscode-merge-base=origin/dev
|
||||||
|
|
||||||
|
|
||||||
|
------------
|
||||||
|
Diagnostic: Credential storage
|
||||||
|
Skipped: False
|
||||||
|
Success: True
|
||||||
|
Exception: None
|
||||||
|
Log:
|
||||||
|
ICredentialStore instance is of type: CredentialStore
|
||||||
|
Writing test credential... OK
|
||||||
|
Reading test credential... OK
|
||||||
|
Deleting test credential... OK
|
||||||
|
|
||||||
|
------------
|
||||||
|
Diagnostic: Microsoft authentication (AAD/MSA)
|
||||||
|
Skipped: False
|
||||||
|
Success: True
|
||||||
|
Exception: None
|
||||||
|
Log:
|
||||||
|
Broker is not enabled.
|
||||||
|
Flow type is: Auto
|
||||||
|
Gathering MSAL token cache data... OK
|
||||||
|
CacheDirectory: C:\Users\Lincpay\AppData\Local\.IdentityService
|
||||||
|
CacheFileName: msal.cache
|
||||||
|
CacheFilePath: C:\Users\Lincpay\AppData\Local\.IdentityService\msal.cache
|
||||||
|
Creating cache helper... OK
|
||||||
|
Verifying MSAL token cache persistence... OK
|
||||||
|
|
||||||
|
------------
|
||||||
|
Diagnostic: GitHub API
|
||||||
|
Skipped: False
|
||||||
|
Success: True
|
||||||
|
Exception: None
|
||||||
|
Log:
|
||||||
|
Using 'https://github.com/' as API target.
|
||||||
|
Querying '/meta' endpoint... OK
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect, useCallback } from 'react';
|
||||||
import { View, Text, StyleSheet, KeyboardAvoidingView, Platform, ScrollView, TouchableOpacity, Dimensions, StatusBar, TextInput, Image } from 'react-native';
|
import { View, Text, StyleSheet, KeyboardAvoidingView, Platform, ScrollView, TouchableOpacity, Dimensions, StatusBar, TextInput, Image } from 'react-native';
|
||||||
import { Formik } from 'formik';
|
import { Formik } from 'formik';
|
||||||
import * as Yup from 'yup';
|
import * as Yup from 'yup';
|
||||||
@@ -15,9 +15,11 @@ import { setToken } from '../../Redux/Slices/Token';
|
|||||||
import NavigationString from '../../Constant/NavigationString';
|
import NavigationString from '../../Constant/NavigationString';
|
||||||
import ImagePath from '../../Constant/ImagePath';
|
import ImagePath from '../../Constant/ImagePath';
|
||||||
import { TENDER_LOGIN, LOG_IN_URL } from '../../Services/ApiCall/ApiUrls';
|
import { TENDER_LOGIN, LOG_IN_URL } from '../../Services/ApiCall/ApiUrls';
|
||||||
import { showErrorAlert } from '../../Constant/ShowDailog';
|
import { showErrorAlert, showToast } from '../../Constant/ShowDailog';
|
||||||
import AppBackground from '../../components/AppBackground';
|
import AppBackground from '../../components/AppBackground';
|
||||||
import FontsFamily from '../../Constant/FontsFamily';
|
import FontsFamily from '../../Constant/FontsFamily';
|
||||||
|
import { useRagistrationState } from '../../Services/ApiCall/Hooks';
|
||||||
|
import AsyncStorage from '@react-native-async-storage/async-storage';
|
||||||
|
|
||||||
const { width, height } = Dimensions.get('window');
|
const { width, height } = Dimensions.get('window');
|
||||||
|
|
||||||
@@ -35,6 +37,7 @@ const Login = () => {
|
|||||||
const [passwordVisible, setPasswordVisible] = useState(false);
|
const [passwordVisible, setPasswordVisible] = useState(false);
|
||||||
const [activeType, setActiveType] = useState<'tender' | 'auction'>('tender');
|
const [activeType, setActiveType] = useState<'tender' | 'auction'>('tender');
|
||||||
const [showForm, setShowForm] = useState(false);
|
const [showForm, setShowForm] = useState(false);
|
||||||
|
const { mutateAsync: registrationStateMutate } = useRagistrationState();
|
||||||
|
|
||||||
// Animation Shared Values for Reveal
|
// Animation Shared Values for Reveal
|
||||||
const formOpacity = useSharedValue(0);
|
const formOpacity = useSharedValue(0);
|
||||||
@@ -121,17 +124,95 @@ const Login = () => {
|
|||||||
onSuccess: (res) => handleSuccess(res, 'auction'),
|
onSuccess: (res) => handleSuccess(res, 'auction'),
|
||||||
onError: (err) => showErrorAlert(err.message || 'Login failed')
|
onError: (err) => showErrorAlert(err.message || 'Login failed')
|
||||||
});
|
});
|
||||||
|
const routeByOrgType = useCallback((params: { otherId: any; orgType: any }) => {
|
||||||
|
const orgType = String(params.orgType ?? '');
|
||||||
|
if (orgType === '4' || orgType === '5' || orgType === '6') {
|
||||||
|
navigation.replace(NavigationString.StageThreeScreen, params);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const handleSuccess = (res: any, type: string) => {
|
if (orgType === '7') {
|
||||||
if (res.statusCode === 200) {
|
navigation.replace(NavigationString.Partnership, params);
|
||||||
console.log("Response login : ", res)
|
return;
|
||||||
dispatch(setToken({ ...res.data, token: res.token, userType: type }));
|
}
|
||||||
navigation.dispatch(
|
|
||||||
CommonActions.reset({
|
navigation.replace('Dashboard');
|
||||||
|
}, [navigation]);
|
||||||
|
|
||||||
|
const handleGetData = useCallback(async () => {
|
||||||
|
try {
|
||||||
|
const res = await registrationStateMutate();
|
||||||
|
console.log("splash", res);
|
||||||
|
if (res?.status === false) {
|
||||||
|
navigation.reset({
|
||||||
index: 0,
|
index: 0,
|
||||||
|
routes: [{ name: NavigationString.Login }],
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res?.data?.message === 'No Response From Server' && res?.data?.success === false) {
|
||||||
|
navigation.reset({
|
||||||
|
index: 0,
|
||||||
|
routes: [{ name: NavigationString.Login }],
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (res?.statusCode === 404 || res?.statusCode === 401) {
|
||||||
|
navigation.replace('Registration');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res?.statusCode === 200 && res?.data) {
|
||||||
|
const { registrationStatus, contOtherId, contOrganization } = res.data;
|
||||||
|
const params = { otherId: contOtherId, orgType: contOrganization };
|
||||||
|
switch (registrationStatus) {
|
||||||
|
case null:
|
||||||
|
case undefined:
|
||||||
|
navigation.replace(NavigationString.Registration);
|
||||||
|
break;
|
||||||
|
case 'Pending':
|
||||||
|
routeByOrgType(params);
|
||||||
|
break;
|
||||||
|
case 'Complete':
|
||||||
|
case 'Completed':
|
||||||
|
navigation.replace(NavigationString.Home);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
navigation.replace(NavigationString.Login);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.error('API error:', res);
|
||||||
|
showToast(res?.message || 'Something went wrong');
|
||||||
|
navigation.replace('Registration');
|
||||||
|
} catch (error: any) {
|
||||||
|
console.error('Registration status error:', error);
|
||||||
|
showToast(error?.message || 'Something went wrong');
|
||||||
|
|
||||||
|
if (error?.response?.status === 404) {
|
||||||
|
navigation.replace('Registration');
|
||||||
|
} else {
|
||||||
|
await AsyncStorage.removeItem('persist:root');
|
||||||
|
navigation.replace(NavigationString.Login);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [navigation, registrationStateMutate, routeByOrgType]);
|
||||||
|
const handleSuccess = (res: any, type: string) => {
|
||||||
|
dispatch(setToken({ ...res.data, token: res.token, userType: type }));
|
||||||
|
if (res.statusCode === 200) {
|
||||||
|
if (type === 'tender') {
|
||||||
|
handleGetData()
|
||||||
|
} else {
|
||||||
|
console.log("Response login : ", res, type)
|
||||||
|
navigation.dispatch(
|
||||||
|
CommonActions.reset({
|
||||||
|
index: 0,
|
||||||
routes: [{ name: NavigationString.Home }],
|
routes: [{ name: NavigationString.Home }],
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
showErrorAlert(res.message);
|
showErrorAlert(res.message);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import { useSelector } from 'react-redux';
|
|||||||
import Animated, { FadeInUp, FadeInDown } from 'react-native-reanimated';
|
import Animated, { FadeInUp, FadeInDown } from 'react-native-reanimated';
|
||||||
import { useTheme } from '../../Hooks/useTheme';
|
import { useTheme } from '../../Hooks/useTheme';
|
||||||
import AppText from '../../components/AppText';
|
import AppText from '../../components/AppText';
|
||||||
|
import NavigationString from '../../Constant/NavigationString';
|
||||||
|
|
||||||
type RouteParams = {
|
type RouteParams = {
|
||||||
userData?: {
|
userData?: {
|
||||||
@@ -310,27 +311,31 @@ const Registration: React.FC = () => {
|
|||||||
fileData.append('regfile', documents.registrationCertificate as any);
|
fileData.append('regfile', documents.registrationCertificate as any);
|
||||||
|
|
||||||
const res = await contractorStageTwoSubmit(fileData);
|
const res = await contractorStageTwoSubmit(fileData);
|
||||||
|
console.log('Stage Two Res : ', res)
|
||||||
if (res.statusCode === 200) {
|
if (res.statusCode === 200) {
|
||||||
if (res) {
|
if (res) {
|
||||||
|
|
||||||
showToast('Form submitted successfully!');
|
showToast('Form submitted successfully!');
|
||||||
|
|
||||||
const orgType = selectedOrg;
|
const orgType = selectedOrg;
|
||||||
const params = { otherId: res?.data?.contOtherId, orgType: orgType };
|
const params = { otherId: res?.data?.contOtherId, orgType: orgType };
|
||||||
|
console.log("params : ", params)
|
||||||
if ([4, 5, 6].includes(orgType)) {
|
if ([4, 5, 6].includes(orgType)) {
|
||||||
navigation.replace('StageThree' as never, params as never);
|
navigation.replace(NavigationString.StageThreeScreen as never, params as never);
|
||||||
} else if (orgType === 7) {
|
} else if (orgType === 7) {
|
||||||
navigation.replace('PartnerShip' as never, { otherId: res?.data?.contOtherId } as never);
|
navigation.replace(NavigationString.Partnership as never, { otherId: res?.data?.contOtherId } as never);
|
||||||
} else {
|
} else {
|
||||||
navigation.replace('Dashboard' as never);
|
navigation.replace(NavigationString.Home as never);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
showToast('Form submission failed');
|
showToast('Form submission failed');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
showToast(res.message || 'Form submission failed. Please try again.');
|
showToast(res.message || 'Form submission failed. Please try again.');
|
||||||
}
|
}
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
|
console.log("Error in form submission")
|
||||||
if (axios.isAxiosError(error)) {
|
if (axios.isAxiosError(error)) {
|
||||||
} else {
|
} else {
|
||||||
console.error('Unexpected error', error);
|
console.error('Unexpected error', error);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { View } from 'react-native';
|
import { View, TouchableOpacity } from 'react-native';
|
||||||
import DatePicker from 'react-native-date-picker';
|
import DatePicker from 'react-native-date-picker';
|
||||||
import MyInput from '../../../components/MyInput';
|
import MyInput from '../../../components/MyInput';
|
||||||
import MyDropdown from '../../../Component/Dropdown/MyDropdown';
|
import MyDropdown from '../../../Component/Dropdown/MyDropdown';
|
||||||
@@ -50,7 +50,10 @@ const StageOne: React.FC<Props> = ({
|
|||||||
const handleDateConfirm = (selectedDate: Date) => {
|
const handleDateConfirm = (selectedDate: Date) => {
|
||||||
setOpen(false);
|
setOpen(false);
|
||||||
setDate(selectedDate);
|
setDate(selectedDate);
|
||||||
handleChange('expiryDate', selectedDate.toISOString().split('T')[0]);
|
const day = String(selectedDate.getDate()).padStart(2, '0');
|
||||||
|
const month = String(selectedDate.getMonth() + 1).padStart(2, '0');
|
||||||
|
const year = selectedDate.getFullYear();
|
||||||
|
handleChange('expiryDate', `${day}/${month}/${year}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -140,17 +143,20 @@ const StageOne: React.FC<Props> = ({
|
|||||||
|
|
||||||
{selectedAllMSME !== 3 && selectedOrg !== 8 && (
|
{selectedAllMSME !== 3 && selectedOrg !== 8 && (
|
||||||
<>
|
<>
|
||||||
<MyInput
|
<TouchableOpacity onPress={() => setOpen(true)} activeOpacity={0.8}>
|
||||||
label="Expiry Date"
|
<View pointerEvents="none">
|
||||||
placeholder="Select Expiry Date"
|
<MyInput
|
||||||
value={formData.expiryDate}
|
label="Expiry Date"
|
||||||
onChangeText={text => handleChange('expiryDate', text)}
|
placeholder="Select Expiry Date"
|
||||||
onFocus={() => setFocusedField('expiryDate')}
|
value={formData.expiryDate}
|
||||||
onBlur={() => setFocusedField(null)}
|
onChangeText={text => handleChange('expiryDate', text)}
|
||||||
focused={focusedField === 'expiryDate'}
|
onFocus={() => setFocusedField('expiryDate')}
|
||||||
editable={true}
|
onBlur={() => setFocusedField(null)}
|
||||||
rightIconPress={() => setOpen(true)}
|
focused={open || focusedField === 'expiryDate'}
|
||||||
/>
|
editable={false}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
</TouchableOpacity>
|
||||||
<DatePicker
|
<DatePicker
|
||||||
modal
|
modal
|
||||||
open={open}
|
open={open}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import React from 'react';
|
import React, { useState } from 'react';
|
||||||
|
import DatePicker from 'react-native-date-picker';
|
||||||
import {
|
import {
|
||||||
TouchableOpacity,
|
TouchableOpacity,
|
||||||
ActivityIndicator,
|
ActivityIndicator,
|
||||||
@@ -64,6 +65,18 @@ const StageTwo: React.FC<Props> = ({
|
|||||||
selectedOrg,
|
selectedOrg,
|
||||||
}) => {
|
}) => {
|
||||||
const { colors, spacing, shadows } = useTheme();
|
const { colors, spacing, shadows } = useTheme();
|
||||||
|
const [open, setOpen] = useState(false);
|
||||||
|
const [date, setDate] = useState(new Date());
|
||||||
|
|
||||||
|
const handleDateConfirm = (selectedDate: Date) => {
|
||||||
|
setOpen(false);
|
||||||
|
setDate(selectedDate);
|
||||||
|
const day = String(selectedDate.getDate()).padStart(2, '0');
|
||||||
|
const month = String(selectedDate.getMonth() + 1).padStart(2, '0');
|
||||||
|
const year = selectedDate.getFullYear();
|
||||||
|
setPanVerified(false);
|
||||||
|
handleChange('dateOfIncorp', `${day}/${month}/${year}`);
|
||||||
|
};
|
||||||
|
|
||||||
const verifyButtonStyle = {
|
const verifyButtonStyle = {
|
||||||
backgroundColor: colors.primary,
|
backgroundColor: colors.primary,
|
||||||
@@ -101,22 +114,38 @@ const StageTwo: React.FC<Props> = ({
|
|||||||
containerStyle={{ marginBottom: spacing.s }}
|
containerStyle={{ marginBottom: spacing.s }}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<MyInput
|
<TouchableOpacity
|
||||||
label={selectedOrg == 8 ? "Date of Birth" : "Date of Incorporation"}
|
onPress={() => !panVerified && setOpen(true)}
|
||||||
placeholder="DD/MM/YYYY"
|
activeOpacity={0.8}
|
||||||
value={formData.dateOfIncorp}
|
disabled={panVerified}
|
||||||
onChangeText={(text) => {
|
>
|
||||||
const formatted = formatDateInput(text);
|
<View pointerEvents="none">
|
||||||
setPanVerified(false);
|
<MyInput
|
||||||
handleChange('dateOfIncorp', formatted);
|
label={selectedOrg == 8 ? "Date of Birth" : "Date of Incorporation"}
|
||||||
}}
|
placeholder="DD/MM/YYYY"
|
||||||
isVerify={panVerified}
|
value={formData.dateOfIncorp}
|
||||||
onFocus={() => setFocusedField('dob')}
|
onChangeText={(text) => {
|
||||||
onBlur={() => setFocusedField(null)}
|
const formatted = formatDateInput(text);
|
||||||
focused={focusedField === 'dob'}
|
setPanVerified(false);
|
||||||
editable={!panVerified}
|
handleChange('dateOfIncorp', formatted);
|
||||||
keyboardType="numeric"
|
}}
|
||||||
containerStyle={{ marginBottom: spacing.s }}
|
isVerify={panVerified}
|
||||||
|
onFocus={() => setFocusedField('dob')}
|
||||||
|
onBlur={() => setFocusedField(null)}
|
||||||
|
focused={open || focusedField === 'dob'}
|
||||||
|
editable={false}
|
||||||
|
keyboardType="numeric"
|
||||||
|
containerStyle={{ marginBottom: spacing.s }}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
</TouchableOpacity>
|
||||||
|
<DatePicker
|
||||||
|
modal
|
||||||
|
open={open}
|
||||||
|
date={date}
|
||||||
|
onConfirm={handleDateConfirm}
|
||||||
|
onCancel={() => setOpen(false)}
|
||||||
|
mode="date"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<MyInput
|
<MyInput
|
||||||
|
|||||||
@@ -111,6 +111,7 @@ const Signup = () => {
|
|||||||
|
|
||||||
registerContractor(formData, {
|
registerContractor(formData, {
|
||||||
onSuccess: (res: any) => {
|
onSuccess: (res: any) => {
|
||||||
|
console.log('Register Res : ', res)
|
||||||
if (res?.status === '201') {
|
if (res?.status === '201') {
|
||||||
ToastAndroid.show(`${res.message}`, ToastAndroid.SHORT);
|
ToastAndroid.show(`${res.message}`, ToastAndroid.SHORT);
|
||||||
navigation.pop();
|
navigation.pop();
|
||||||
@@ -119,6 +120,7 @@ const Signup = () => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onError: (error: any) => {
|
onError: (error: any) => {
|
||||||
|
console.log('Register Res : ', error)
|
||||||
ToastAndroid.show(error.message, ToastAndroid.SHORT);
|
ToastAndroid.show(error.message, ToastAndroid.SHORT);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ const Splash: React.FC = () => {
|
|||||||
navigation.replace(NavigationString.Home);
|
navigation.replace(NavigationString.Home);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
navigation.replace(NavigationString.Registration);
|
navigation.replace(NavigationString.Login);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// const BASE_URL = `http://192.168.6.194:8090/`
|
// const BASE_URL = `http://192.168.6.194:8090/`
|
||||||
const BASE_URL = `https://procurelinc.in/EProcurementSB/`
|
const BASE_URL = `https://dev.procurelinc.in/api/EProcurementSB/`
|
||||||
// const BASE_URL_Auction = `http://192.168.6.194/AuctionPostgre/api/auction/`
|
// const BASE_URL_Auction = `http://192.168.6.194/AuctionPostgre/api/auction/`
|
||||||
export const BASE_URL_Auction = `https://procurelinc.in/Auction/`
|
export const BASE_URL_Auction = `https://procurelinc.in/Auction/`
|
||||||
// const BASE_URL = `http://192.168.29.226:8090/`
|
// const BASE_URL = `http://192.168.29.226:8090/`
|
||||||
|
|||||||
@@ -302,6 +302,7 @@ export const registerContractor = async (payload: any): Promise<any> => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await axios.post(SAVE_CONTRACTOR_STAGE1, { ...payload, device: "mobileApp" });
|
const response = await axios.post(SAVE_CONTRACTOR_STAGE1, { ...payload, device: "mobileApp" });
|
||||||
|
console.log('Stage One Res : ', response.data)
|
||||||
return response.data;
|
return response.data;
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
throw error.response?.data || error.message;
|
throw error.response?.data || error.message;
|
||||||
|
|||||||
Reference in New Issue
Block a user