Skip to content

Commit

Permalink
Remove kyc feat
Browse files Browse the repository at this point in the history
  • Loading branch information
donguks committed Mar 4, 2021
1 parent a6a21a3 commit ecc5307
Show file tree
Hide file tree
Showing 79 changed files with 73 additions and 4,784 deletions.
27 changes: 7 additions & 20 deletions AppMain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,13 @@ import {
AppStateStatus,
} from 'react-native';
import * as Localization from 'expo-localization';
import { Kyc } from './src/modules/kyc/Kyc';
import { More } from './src/modules/more/More';
import { Products } from './src/modules/products/Products';
import { Account } from './src/modules/account/Account';

import { KycStatus } from './src/enums/KycStatus';
import LocaleType from './src/enums/LocaleType';
import LegacyRefundStatus from './src/enums/LegacyRefundStatus';
import currentLocale, { currentLocalization } from './src/utiles/currentLocale';
import { currentLocalization } from './src/utiles/currentLocale';
import { Dashboard } from './src/modules/dashboard/Dashboard';
import Main from './src/modules/main/Main';
import Notification, { isNotification } from './src/types/Notification';
Expand Down Expand Up @@ -63,7 +61,6 @@ interface AppInformation {
email: string;
firstName: string;
lastName: string;
kycStatus: KycStatus;
gender: string;
language: LocaleType;
currency: CurrencyType;
Expand All @@ -78,7 +75,6 @@ interface AppInformation {
ownerships: OwnershipResponse[];
balance: string;
changeLanguage: () => void;
setKycStatus: () => void;
notifications: Notification[];
Server: Server;
expoPushToken: string;
Expand All @@ -95,7 +91,6 @@ const defaultState = {
firstName: '',
lastName: '',
gender: '',
kycStatus: KycStatus.NONE,
language: currentLocalization(),
currency: CurrencyType.USD,
ethAddresses: [],
Expand All @@ -108,10 +103,9 @@ const defaultState = {
},
ownerships: [],
balance: '0',
changeLanguage: () => {},
setKycStatus: () => {},
changeLanguage: () => { },
notifications: [],
Server: new Server(() => {}, ''),
Server: new Server(() => { }, ''),
expoPushToken: '',
elPrice: 0,
krwPrice: 0,
Expand Down Expand Up @@ -426,12 +420,6 @@ const AppMain = () => {
user: { ...state.user, currency: newCurrency },
});
},
setKycStatus: () => {
setState({
...state,
user: { ...state.user, kycStatus: KycStatus.PENDING },
});
},
signIn,
signOut,
refreshUser,
Expand Down Expand Up @@ -490,16 +478,15 @@ const AppMain = () => {
) : state.signedIn === SignInStatus.SIGNIN ? (
<>
<RootStack.Screen name={'Main'} component={Main} />
<RootStack.Screen name={'Kyc'} component={Kyc} />
<RootStack.Screen name={'Dashboard'} component={Dashboard} />
<RootStack.Screen name={'More'} component={More} />
<RootStack.Screen name={'Product'} component={Products} />
</>
) : (
<>
<RootStack.Screen name={'Account'} component={Account} />
</>
)}
<>
<RootStack.Screen name={'Account'} component={Account} />
</>
)}
<RootStack.Screen
name={'BlockScreen'}
component={BlockScreen}
Expand Down
4 changes: 0 additions & 4 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"infoPlist": {
"NSPhotoLibraryUsageDescription": "Give permission to select photos.",
"NSPhotoLibraryAddUsageDescription": "Give permission to save photos.",
"NSCameraUsageDescription": "This app uses the camera for kyc certifications.",
"NSAppTransportSecurity": {
"NSAllowsArbitraryLoads": true
}
Expand All @@ -47,9 +46,6 @@
}
},
"permissions": [
"CAMERA",
"READ_EXTERNAL_STORAGE",
"WRITE_EXTERNAL_STORAGE",
"USE_FINGERPRINT",
"USE_BIOMETRIC",
"WRITE_SETTINGS",
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"eslint-config-prettier": "^6.11.0",
"ethers": "^5.0.24",
"expo": "^39.0.0",
"expo-camera": "~9.0.0",
"expo-clipboard": "^1.0.1",
"expo-constants": "^9.2.0",
"expo-device": "^2.3.0",
Expand Down
37 changes: 1 addition & 36 deletions src/api/server.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* eslint-disable @typescript-eslint/camelcase */
import AsyncStorage from '@react-native-community/async-storage';
import axios, { AxiosInstance, AxiosResponse } from 'axios';
import { Platform } from 'react-native';
import { espressoClient, authenticatedEspressoClient } from './axiosInstances';
import { AccountResponse, UserResponse } from '../types/AccountResponse';
import { OwnershipResponse } from '../types/Ownership';
Expand Down Expand Up @@ -128,39 +127,6 @@ export default class Server {
}
};

kycInit = async (): Promise<AxiosResponse> => {
return this.authenticatedEspressoClient.post('/v2/kyc/');
};

kycUpload = async (photo: string, type: string): Promise<AxiosResponse> => {
const formData = new FormData();
formData.append('image', {
uri: Platform.OS === 'android' ? photo : photo.replace('file://', ''),
name: 'image.png',
type: 'image/png',
});
formData.append('type', type);
return this.authenticatedEspressoClient.post('/v2/kyc/upload', formData);
};

kycInformation = async (
firstName: string,
lastName: string,
nationality: string,
dateOfBirth: string,
gender: string,
idType: string,
): Promise<AxiosResponse> => {
return this.authenticatedEspressoClient.post('/v2/kyc/information', {
firstName,
lastName,
nationality,
dateOfBirth,
gender,
idType,
});
};

notification = async (): Promise<AxiosResponse<Notification[]>> => {
return this.authenticatedEspressoClient.get(`/notifications`);
};
Expand Down Expand Up @@ -316,8 +282,7 @@ export default class Server {

getBalance = (address: string): Promise<AxiosResponse<BalanceResponse>> => {
return axios.get(
`https://api.etherscan.io/api?module=account&action=tokenbalance&contractaddress=${
getEnvironment().elAddress
`https://api.etherscan.io/api?module=account&action=tokenbalance&contractaddress=${getEnvironment().elAddress
}&address=${address}&tag=latest&apikey=AD6WVV4IKCM7R4764UTDWVA52V7ARDYIP7`,
);
};
Expand Down
24 changes: 11 additions & 13 deletions src/contexts/FunctionContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { CurrencyResponse } from '../types/CurrencyResponse';
type FunctionContextType = {
setLanguage: (input: LocaleType) => void;
setCurrency: (input: CurrencyType) => void;
setKycStatus: () => void;
signIn: () => void;
signOut: (signInStatus: SignOut) => void;
refreshUser: () => Promise<void>;
Expand All @@ -23,18 +22,17 @@ type FunctionContextType = {
};

const FunctionContext = createContext<FunctionContextType>({
setLanguage: () => {},
setCurrency: () => {},
setKycStatus: () => {},
signIn: async () => {},
signOut: async (_signInStatus: SignOut) => {},
refreshUser: async () => {},
setCurrencyPrice: (_currency: CurrencyResponse[]) => {},
setNotifications: (_notifications: Notification[]) => {},
setEthAddress: (_address: string) => {},
setUserExpoPushToken: (_expoPushToken: string) => {},
setRefundStatus: (_legacyRefundStatus: LegacyRefundStatus) => {},
Server: new Server(() => {}, ''),
setLanguage: () => { },
setCurrency: () => { },
signIn: async () => { },
signOut: async (_signInStatus: SignOut) => { },
refreshUser: async () => { },
setCurrencyPrice: (_currency: CurrencyResponse[]) => { },
setNotifications: (_notifications: Notification[]) => { },
setEthAddress: (_address: string) => { },
setUserExpoPushToken: (_expoPushToken: string) => { },
setRefundStatus: (_legacyRefundStatus: LegacyRefundStatus) => { },
Server: new Server(() => { }, ''),
});

export default FunctionContext;
22 changes: 0 additions & 22 deletions src/contexts/KycContext.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/contexts/UserContext.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { createContext } from 'react';
import { KycStatus } from '../enums/KycStatus';
import LocaleType from '../enums/LocaleType';
import { SignInStatus } from '../enums/SignInStatus';
import Notification from '../types/Notification';
Expand All @@ -16,7 +15,6 @@ type UserContextType = {
email: string;
firstName: string;
lastName: string;
kycStatus: KycStatus;
gender: string;
language: LocaleType;
currency: CurrencyType;
Expand All @@ -43,7 +41,6 @@ const UserContext = createContext<UserContextType>({
firstName: '',
lastName: '',
gender: '',
kycStatus: KycStatus.NONE,
ethAddresses: [],
expoPushTokens: [],
language: currentLocalization(),
Expand Down
6 changes: 0 additions & 6 deletions src/enums/KycStatus.ts

This file was deleted.

13 changes: 0 additions & 13 deletions src/enums/pageEnum.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
export enum KycPage {
StartKYC = 'StartKYC',
Argos = 'Argos',
SelectID = 'SelectID',
TakeID = 'TakeID',
ConfirmID = 'ConfirmID',
TakeSelfieBefore = 'TakeSelfieBefore',
TakeSelfie = 'TakeSelfie',
ConfirmSelfie = 'ConfirmSelfie',
PersonalDataInput = 'PersonalDataInput',
}

export enum ProductPage {
MainList = 'MainList',
ProductStory = 'ProductStory',
Expand Down Expand Up @@ -56,7 +44,6 @@ export enum DashboardPage {
OwnershipDetail = 'OwnershipDetail',
ProductData = 'ProductData',
ProductNotice = 'ProductNotice',
PreparingInvestment = 'PreparingInvestment',
InvestmentGuide = 'InvestmentGuide',
RemainingBalance = 'RemainingBalance',
EventList = 'EventList',
Expand Down
Loading

0 comments on commit ecc5307

Please sign in to comment.