How to use the react-native-snackbar.LENGTH_INDEFINITE function in react-native-snackbar

To help you get started, we’ve selected a few react-native-snackbar examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lXSPandora / TwitterClone-RelayModern / src / components / user / Login.js View on Github external
action: {
            title: 'OK',
            color: 'rgb(0, 148, 255)',
          },
        });
        return;
      }

      await AsyncStorage.setItem('token', token); // Stores the token on the storage

      return this.startViewAnimated();
    } catch (err) {
      console.log(err.message);
      Snackbar.show({
        title: 'An unexpected error occurred',
        duration: Snackbar.LENGTH_INDEFINITE,
        action: {
          title: 'OK',
          color: 'rgb(0, 148, 255)',
        },
      });
    }
  };
github lXSPandora / TwitterClone-RelayModern / src / components / user / SignUp.js View on Github external
}

      Snackbar.show({
        title: 'The user has been added! Want to make the login?',
        duration: Snackbar.LENGTH_INDEFINITE,
        action: {
          title: 'MAKE LOGIN',
          color: 'rgb(0, 148, 255)',
          action: () => this.goToFeed(token),
        },
      });
    } catch (err) {
      console.log(err.message);
      Snackbar.show({
        title: 'An unexpected error occurred',
        duration: Snackbar.LENGTH_INDEFINITE,
        action: {
          title: 'OK',
          color: 'rgb(0, 148, 255)',
        },
      });
    }
  };
github lXSPandora / TwitterClone-RelayModern / src / components / user / SignUp.js View on Github external
if (token == null) {
        Snackbar.show({
          title: 'Email already in use',
          duration: 3000,
          action: {
            title: 'DISMISS',
            color: 'rgb(0, 148, 255)',
            action: () => this.goToFeed(),
          },
        });
        return;
      }

      Snackbar.show({
        title: 'The user has been added! Want to make the login?',
        duration: Snackbar.LENGTH_INDEFINITE,
        action: {
          title: 'MAKE LOGIN',
          color: 'rgb(0, 148, 255)',
          action: () => this.goToFeed(token),
        },
      });
    } catch (err) {
      console.log(err.message);
      Snackbar.show({
        title: 'An unexpected error occurred',
        duration: Snackbar.LENGTH_INDEFINITE,
        action: {
          title: 'OK',
          color: 'rgb(0, 148, 255)',
        },
      });
github lXSPandora / TwitterClone-RelayModern / src / components / tweetsFeed / Feed.js View on Github external
render={({ error, props }) => {
      if (error) {
        return Snackbar.show({
          title: 'An unexpected error occurred',
          duration: Snackbar.LENGTH_INDEFINITE,
          action: {
            title: 'OK',
            color: 'rgb(0, 148, 255)',
          },
        });
      } else if (props) {
        return ;
      }
      return (
github bitnami-labs / cabin / src / utils / SnackbarUtils.js View on Github external
http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
*/
import Colors from 'styles/Colors';
import Snackbar from 'react-native-snackbar';

export default class SnackbarUtils {

  static DURATION_SHORT = Snackbar.LENGTH_SHORT;
  static DURATION_LONG = Snackbar.LENGTH_LONG;
  static DURATION_INDEFINITE = Snackbar.LENGTH_INDEFINITE;

  static showWarning(options) {
    SnackbarUtils.showAlert({
      type: 'warning',
      ...options,
    });
  }

  static showInfo(options) {
    SnackbarUtils.showAlert({
      type: 'info',
      ...options,
    });
  }

  static showSuccess(options) {
github RSG-Group / RSG-Chess-mobile / src / components / CheckmateSnackBar.js View on Github external
componentDidUpdate(prevProps) {
    if (this.props.checkmate !== prevProps.checkmate && this.props.checkmate) {
      Snackbar.show({
        title: strings.gameOver[this.props.lang],
        duration: Snackbar.LENGTH_INDEFINITE,
        action: {
          title: strings.takeLook[this.props.lang],
          color: "green",
          onPress: () => {
            this.props.navigate("Play");
          }
        }
      });
    }
  }

react-native-snackbar

Material Design "Snackbar" component for Android and iOS.

MIT
Latest version published 1 year ago

Package Health Score

57 / 100
Full package analysis