This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // So basically you edit the /node_modules/react-native/react.gradle file | |
| // and add the doLast right after the doFirst block, manually. | |
| doFirst { ... } | |
| doLast { | |
| def moveFunc = { resSuffix -> | |
| File originalDir = file("$buildDir/generated/res/react/release/drawable-${resSuffix}"); | |
| if (originalDir.exists()) { | |
| File destDir = file("$buildDir/../src/main/res/drawable-${resSuffix}"); | |
| ant.move(file: originalDir, tofile: destDir); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // variable to hold the references of the textfields | |
| inputs = {}; | |
| // function to focus the field | |
| focusTheField = (id) => { | |
| this.inputs[id].focus(); | |
| } | |
| // upon submitting the Field 1, we want to focus the Field 2 | |
| render() { | |
| return ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let regString = /^[a-zA-Z ]*$/ | |
| let regEmail = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/ | |
| let regPassword = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{6,}$/g | |
| let regNumber = /^[0-9]*$/ | |
| let regPhoneNumber = /^08[0-9]*$/ | |
| let regAddress = /^(?=.*\w).{2,}$/g | |
| let regRt = /^(?=.*\d).{3,3}$/g | |
| let regFractionNumber = /^[0-9]{1,4}([,.][0-9]{1,2})?$/g |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getApiUrl(releaseChannel) { | |
| if (releaseChannel === undefined) return App.apiUrl.dev // since releaseChannels are undefined in dev, return your default. | |
| if (releaseChannel.indexOf('prod') !== -1) return App.apiUrl.prod // this would pick up prod-v1, prod-v2, prod-v3 | |
| if (releaseChannel.indexOf('staging') !== -1) return App.apiUrl.staging // return staging environment variables | |
| } | |
| // source : https://github.com/expo/expo/issues/7857 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const Schema = Yup.object().shape({ | |
| password: Yup.string().required("This field is required"), | |
| changepassword: Yup.string().when("password", { | |
| is: val => (val && val.length > 0 ? true : false), | |
| then: Yup.string().oneOf( | |
| [Yup.ref("password")], | |
| "Both password need to be the same" | |
| ) | |
| }) | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| openPlayStore() { | |
| const appStoreLink = 'itms://apps.apple.com/us/app/koperasi-namastra/id1487403555' | |
| const playStoreLink = 'market://details?id=com.namastra_mobile_ver_2' | |
| const url = Platform.OS === 'ios' ? appStoreLink : playStoreLink | |
| Linking.openURL(url) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const STATUSBAR_HEIGHT_EXPO = | |
| global.__expo && global.__expo.Constants | |
| ? global.__expo.Constants.statusBarHeight | |
| : 0; | |
| const STATUSBAR_HEIGHT = Platform.select({ | |
| android: STATUSBAR_HEIGHT_EXPO, | |
| ios: Platform.version >= 11 ? 0 : STATUSBAR_HEIGHT_EXPO | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function shadow(elevation) { | |
| elevation, | |
| shadowColor: 'black', | |
| shadowOffset: { width: 0, height: elevation - 1}, | |
| shadowOpacity: 0.24, | |
| shadowRadius: elevation | |
| } |
NewerOlder