const handlePress = useCallback(() => {
// handle press
}, [])
<Button onPress={handlePress} />
// set it up | |
firebase.storage().ref().constructor.prototype.putFiles = function(files) { | |
var ref = this; | |
return Promise.all(files.map(function(file) { | |
return ref.child(file.name).put(file); | |
})); | |
} | |
// use it! | |
firebase.storage().ref().putFiles(files).then(function(metadatas) { |
import { createAction } from 'redux-actions'; | |
import { | |
NAVIGATION_PUSH, | |
NAVIGATION_POP, | |
NAVIGATION_RESET_TO, | |
NAVIGATION_POP_TO_ROOT | |
} from './actions'; | |
export const push = createAction(NAVIGATION_PUSH); | |
export const pop = createAction(NAVIGATION_POP); |
export const toCamelCase = (e) => { | |
return e.replace(/_([a-z])/g, (g) => g[1].toUpperCase()); | |
}; | |
export const toSnakeCase = (e) => { | |
return e.match(/([A-Z])/g).reduce( | |
(str, c) => str.replace(new RegExp(c), '_' + c.toLowerCase()), | |
e | |
) | |
.substring((e.slice(0, 1).match(/([A-Z])/g)) ? 1 : 0); |
import { BottomSheetModalProvider } from "@gorhom/bottom-sheet"; | |
/** | |
* This gist describes how to build a global alert system that follows a similar | |
* API as RN's Alert.alert(). | |
* | |
* This can be cleaned up and improved, especially in the GlobalAlertManager | |
* side, but it's a good starting point. | |
*/ |
import React from "react"; | |
import { | |
View, | |
SafeAreaView, | |
useWindowDimensions, | |
TextInput, | |
} from "react-native"; | |
import Animated, { | |
Extrapolate, | |
interpolate, |