All Projects → sbalay → React Native Redux Toast

sbalay / React Native Redux Toast

Simple to use, easy to customize Toast component for Android & iOS. Developed with love for redux apps

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Native Redux Toast

Fftoast
A very powerful iOS message notifications and AlertView extensions. It can be easily realized from the top of the screen, the bottom of the screen and the middle of the screen pops up a notification. You can easily customize the pop-up View.
Stars: ✭ 649 (+1172.55%)
Mutual labels:  toast
Vue Snotify
Vuejs 2 Notification Center
Stars: ✭ 755 (+1380.39%)
Mutual labels:  toast
Androidutilcode
AndroidUtilCode 🔥 is a powerful & easy to use library for Android. This library encapsulates the functions that commonly used in Android development which have complete demo and unit test. By using it's encapsulated APIs, you can greatly improve the development efficiency. The program mainly consists of two modules which is utilcode, which is commonly used in development, and subutil which is rarely used in development, but the utils can be beneficial to simplify the main module. 🔥
Stars: ✭ 30,239 (+59192.16%)
Mutual labels:  toast
Devutils
🔥 ( 持续更新,目前含 160+ 工具类 ) DevUtils 是一个 Android 工具库,主要根据不同功能模块,封装快捷使用的工具类及 API 方法调用。该项目尽可能的便于开发人员,快捷、高效开发安全可靠的项目。
Stars: ✭ 680 (+1233.33%)
Mutual labels:  toast
Universaltoast
简洁优雅可点击的toast控件,无BadTokenException风险,关闭通知权限依然正常显示。An elegant and flexible toast which can handle click event , avoid BadTokenException and run fine without notification permission
Stars: ✭ 748 (+1366.67%)
Mutual labels:  toast
Laravel Notify
Flexible Flash notifications for Laravel
Stars: ✭ 787 (+1443.14%)
Mutual labels:  toast
Popupview
Toasts and popups library written with SwiftUI
Stars: ✭ 581 (+1039.22%)
Mutual labels:  toast
Jhud
A full screen of the HUD when loading the data (Objective-C).
Stars: ✭ 1,003 (+1866.67%)
Mutual labels:  toast
Vue Toastification
Vue notifications made easy!
Stars: ✭ 747 (+1364.71%)
Mutual labels:  toast
Sneaker
A lightweight Android library for customizable alerts
Stars: ✭ 928 (+1719.61%)
Mutual labels:  toast
Sweet Alert
A BEAUTIFUL, RESPONSIVE, CUSTOMIZABLE, ACCESSIBLE (WAI-ARIA) REPLACEMENT FOR JAVASCRIPT'S POPUP BOXES FOR LARAVEL
Stars: ✭ 696 (+1264.71%)
Mutual labels:  toast
Anylayer
Android稳定高效的浮层创建管理框架
Stars: ✭ 745 (+1360.78%)
Mutual labels:  toast
Burnttoast
Module for creating and displaying Toast Notifications on Microsoft Windows 10.
Stars: ✭ 796 (+1460.78%)
Mutual labels:  toast
Dialog
🔥空祖家的对话框工具
Stars: ✭ 658 (+1190.2%)
Mutual labels:  toast
Fluttertoast
Android Toast Plugin for Flutter
Stars: ✭ 957 (+1776.47%)
Mutual labels:  toast
Gsmessages
A simple style messages/notifications, in Swift.
Stars: ✭ 595 (+1066.67%)
Mutual labels:  toast
Notie
🔔 a clean and simple notification, input, and selection suite for javascript, with no dependencies
Stars: ✭ 6,170 (+11998.04%)
Mutual labels:  toast
Easyandroid
一系列简单、轻量、方便的Android开发工具集合(持续更新中),包括Android动态权限、SharedPreferences、反射、日志、Toast、Bundle、MVP、线程池、Html、图文混排、蒙层引导、拍照、图库选择等
Stars: ✭ 1,039 (+1937.25%)
Mutual labels:  toast
React Native Easy Toast
A react native module to show toast like android, it works on iOS and Android.
Stars: ✭ 990 (+1841.18%)
Mutual labels:  toast
React Toastify
React notification made easy 🚀 !
Stars: ✭ 8,113 (+15807.84%)
Mutual labels:  toast

React Native Redux Toast

Features

  • Cross platform.
  • Triggered dispatching redux actions
  • 100% written in js. No need to link native dependencies
  • Easy to customize
Android iOS
Toast Android Toast iOS

Installation

npm

npm install --save react-native-redux-toast

yarn

yarn add react-native-redux-toast

Usage

1- Add the toast reducer to your store

import { createStore, combineReducers } from 'redux';
import { toastReducer as toast } from 'react-native-redux-toast';

const reducers = combineReducers({
  toast
});

export default createStore(reducers);

2- Mount the toast component where you want to use it. (Usually at the root level of the app)

import React from 'react';
import { Provider } from 'react-redux';
import { View } from 'react-native';
import { Toast } from 'react-native-redux-toast';

import store from './store';
import App from './app';

export default function main() {
  return (
    <Provider store={store}>
      <View style={{ flex: 1 }}>
        <App />
        <Toast messageStyle={{ color: 'white' }} />
      </View>
    </Provider>
  );
}

3- Dispatch actions

class App extends Component {
  displayErrorToast = () => {
    this.props.dispatch(ToastActionsCreators.displayError('Error toast!'));
  };

  displayWarningToast = () => {
    this.props.dispatch(ToastActionsCreators.displayWarning('Warning toast!', 2000));
  };

  displayInfoToast = () => {
    this.props.dispatch(ToastActionsCreators.displayInfo('Info toast!', 5000));
  };

  render() {
    return (
      <View>
        <Button title={'Info Toast!'} onPress={this.displayInfoToast} />
        <Button title={'Warning Toast!'} onPress={this.displayWarningToast} />
        <Button title={'Error Toast!'} onPress={this.displayErrorToast} />
      </View>
    );
  }
}

API

Props

  • containerStyle: (View.propTypes.style) Styles to apply to the View that wraps the Toast

  • messageStyle: (Text.propTypes.style) Styles to apply to the Text component of the Toast

  • errorStyle: (View.propTypes.style) Same as containerStyle, only applied when the error Toast is being used

  • warningStyle: (View.propTypes.style) Same as containerStyle, only applied when the warning Toast is being used

  • getMessageComponent: (React.PropTypes.func) Function that returns a component to be used inside the Toast. Receives two params: message and an object: { error: bool, warning: bool }. Default value:

Toast.defaultProps = {
  getMessageComponent(message) {
    return (
      <Text style={this.messageStyle}>
        {message}
      </Text>
    );
  }
};

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

This project is maintained by Sebastian Balay and it was written by Wolox.

Wolox

License

react-native-redux-toast is available under the MIT license.

Copyright (c) 2017 Sebastián Balay <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].