Fakultas Ilmu Komputer UI

Commit 392b556c authored by wulanmantiri's avatar wulanmantiri
Browse files

[REFACTOR] Change some styles and remove codes

parent 87bad41f
Pipeline #79776 passed with stages
in 11 minutes and 11 seconds
......@@ -6,7 +6,7 @@
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest --maxWorkers=7 --coverage --watchAll=false --verbose --collectCoverageFrom=\"src/**/*.tsx\"",
"test": "jest --runInBand --coverage --watchAll=false --verbose --collectCoverageFrom=\"src/**/*.tsx\"",
"test-only": "jest --verbose -t",
"lint": "eslint . --ext .ts,.tsx --fix",
"prettify": "prettier --write src",
......
......@@ -46,6 +46,7 @@ export const styles = StyleSheet.create({
},
button: {
padding: 10,
paddingHorizontal: 0,
backgroundColor: colors.primaryYellow,
},
finishButton: {
......
export { default as useApi } from './useApi';
export { default as useDownloadFiles } from './useDownloadFiles';
export { default as useForm } from './useForm';
export { default as useLinkingEffect } from './useLinkingEffect';
export { default as useSignupEffect } from './useSignupEffect';
import { useEffect } from 'react';
import { Linking } from 'react-native';
import { useNavigation } from '@react-navigation/native';
import * as ROUTES from 'constants/routes';
const useLinkingEffect = () => {
const navigation = useNavigation();
const getQueryParams = (path: string | null) => {
return path
? JSON.parse(
'{"' +
decodeURI(path.replace(/&/g, '","').replace(/[=]/g, '":"')) +
'"}',
)
: {};
};
useEffect(() => {
const navigate = (url: string | null) => {
if (url) {
const splitUrl = url.split('?');
const path = splitUrl[0].split('/').slice(3).join('/');
const queryParams = getQueryParams(splitUrl[1]);
if (path === 'payment') {
navigation.reset({
index: 0,
routes: [{ name: ROUTES.paymentResult, params: queryParams }],
});
}
}
};
const handleOpenURL = (event: { url: string }) => {
navigate(event.url);
};
Linking.addEventListener('url', handleOpenURL);
return () => {
Linking.removeEventListener('url', handleOpenURL);
};
}, [navigation]);
};
export default useLinkingEffect;
......@@ -6128,9 +6128,9 @@ react-is@^17.0.1:
integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==
react-native-document-picker@^5.0.3:
version "5.0.3"
resolved "https://registry.yarnpkg.com/react-native-document-picker/-/react-native-document-picker-5.0.3.tgz#f31f18ee7a90fb8ea94f301d7a5fdb069322dcd8"
integrity sha512-OLTUB9SvY2J6bYZ6F/b4FKwDfEimP+sRsEP3OSp1oosYD4+G9C5J3CKiJ69B7CCXmA89Bi/QBr5j2lW9y9rWlQ==
version "5.0.4"
resolved "https://registry.yarnpkg.com/react-native-document-picker/-/react-native-document-picker-5.0.4.tgz#86a874e093284b21896581985b8b6e13e04a4251"
integrity sha512-PN3NYZFgz6McbcfH5Cu3yf3nE4UBAiJYdL26F5cjypOoCFhdfLz0NM13V/tVOLGhWZXNUmI3g4dhPQBthq+pJg==
react-native-dotenv@^2.5.5:
version "2.5.5"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment