https://github.com/pie6k/react-native-toolbox
This is set of common react-native tools.
https://github.com/pie6k/react-native-toolbox
react-native tools toolset
Last synced: about 1 year ago
JSON representation
This is set of common react-native tools.
- Host: GitHub
- URL: https://github.com/pie6k/react-native-toolbox
- Owner: pie6k
- License: mit
- Created: 2018-11-21T03:59:45.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-21T23:54:34.000Z (over 7 years ago)
- Last Synced: 2025-01-11T12:18:13.045Z (about 1 year ago)
- Topics: react-native, tools, toolset
- Language: TypeScript
- Homepage:
- Size: 4.88 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-native-toolbox
This is set of common react-native tools.
Hopefully it'll grow with time.
```
yarn add react-native-toolbox
```
## Quick showcase
```ts
import {
alertPromise,
confirmChoice,
showActionSheetIOS,
waitForInteractionsToEnd,
} from 'react-native-toolbox';
class SomeComponent extends Component {
async showAlert() {
await alertPromise({
title: 'Title',
message: 'Message',
closeLabel: 'Close',
});
console.log('alert is closed now');
}
async deleteSomething() {
const isConfirmed = await confirmChoice({
title: 'Are you sure?',
subtitle: 'This cannot be undone',
confirmLabel: 'Remove',
cancelLabel: 'Cancel',
isDestructive: true, // will make 'Remove' red
});
if (isConfirmed) {
callSomeRemoveApi();
}
}
showActionSheet() {
showActionSheetIOS({
title: 'Title',
message: 'Some message',
options: [
{
label: 'Option A',
isDestructive: false,
selectCallback: () => console.log('Option A selected'),
},
{
label: 'Option A',
isDestructive: true,
selectCallback: () => console.log('Option B selected'),
},
],
cancelLabel: 'Cancel',
onCancel: () => console.log('cancelled'),
});
}
async someActionThatHasToBeSmooth() {
await waitForInteractionsToEnd();
// perform heavy operation
}
}
```