components#SnackbarContent JavaScript Examples

The following examples show how to use components#SnackbarContent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Login.jsx    From crypto-manager with MIT License 5 votes vote down vote up
render() {
        const { from } = this.props.location.state || {from: {pathname: '/dashboard'}};
        const { redirectToReferrer } = this.state;

        if (redirectToReferrer) {
            return (
                <Redirect to={from}/>
            )
        }
        const { email, password, userDetailsSubmitted, errorOccured, userAlreadyLoggedIn } = this.state;
        return (
            <div>
                {
                    userAlreadyLoggedIn ?
                    "" :
                    <div className="local-bootstrap">
                        <div className="registerActivity">
                            <div className="auth-wrapper">
                                <div className="auth-inner">
                                    <form name="form" onSubmit={this.handleSubmit}>
                                        <h3>Sign In</h3>

                                        <div className={'form-group' + (userDetailsSubmitted && !email ? ' has-error' : '')}>
                                            <label>Email address</label>
                                            <input type="email" className="form-control" placeholder="Enter email" name="email" value={email} onChange={this.handleChange} />
                                        </div>

                                        <div className={'form-group' + (userDetailsSubmitted && !password ? ' has-error' : '')}>
                                            <label>Password</label>
                                            <input type="password" className="form-control" placeholder="Enter password" name="password" value={password} onChange={this.handleChange} />
                                        </div>
                                        <p className="forgot-password text-right">
                                            Forgot <a href="#">password?</a>
                                        </p>
                                        {/* <div className="form-group">
                                            <div class="custom-control custom-checkbox">
                                                <input type="checkbox" className="custom-control-input" id="customCheck1" />
                                                <label className="custom-control-label" htmlFor="customCheck1">Remember me</label>
                                            </div>
                                        </div> */}

                                        <button type="submit" className="btn btn-primary btn-block">Submit</button>

                                        <div className="already-registered">
                                            <p className="forgot-password text-right">
                                                Not registered yet <a href="/signup">Sign up?</a>
                                            </p>
                                        </div>
                                    </form>

                                    {
                                        errorOccured ?
                                        <SnackbarContent
                                            message={
                                            'Login unsuccessful'
                                            }
                                            color="danger"
                                        /> :
                                        ""
                                    }

                                </div>
                            </div>
                        </div>
                    </div>
                }
            </div>
        );
    }
Example #2
Source File: Notifications.jsx    From crypto-manager with MIT License 4 votes vote down vote up
render() {
    return (
      <RegularCard
        cardTitle="Notifications"
        cardSubtitle={
          <P>
            Handcrafted by our friends from{" "}
            <A target="_blank" href="https://material-ui-next.com/">
              Material UI
            </A>{" "}
            and styled by{" "}
            <A target="_blank" href="https://www.creative-tim.com/">
              Creative Tim
            </A>. Please checkout the{" "}
            <A href="#pablo" target="_blank">
              full documentation
            </A>.
          </P>
        }
        content={
          <div>
            <Grid container>
              <ItemGrid xs={12} sm={12} md={6}>
                <h5>Notifications Style</h5>
                <br />
                <SnackbarContent message={"This is a plain notification"} />
                <br />
                <SnackbarContent
                  message={"This is a notification with close button."}
                  close
                />
                <br />
                <SnackbarContent
                  message={"This is a notification with close button and icon."}
                  close
                  icon={AddAlert}
                />
                <br />
                <SnackbarContent
                  message={
                    "This is a notification with close button and icon and have many lines. You can see that the icon and the close button are always vertically aligned. This is a beautiful notification. So you don't have to worry about the style."
                  }
                  close
                  icon={AddAlert}
                />
                <br />
              </ItemGrid>
              <ItemGrid xs={12} sm={12} md={6}>
                <h5>Notifications States</h5>
                <br />
                <SnackbarContent
                  message={
                    'INFO - This is a regular notification made with color="info"'
                  }
                  close
                  color="info"
                />
                <br />
                <SnackbarContent
                  message={
                    'SUCCESS - This is a regular notification made with color="success"'
                  }
                  close
                  color="success"
                />
                <br />
                <SnackbarContent
                  message={
                    'WARNING - This is a regular notification made with color="warning"'
                  }
                  close
                  color="warning"
                />
                <br />
                <SnackbarContent
                  message={
                    'DANGER - This is a regular notification made with color="danger"'
                  }
                  close
                  color="danger"
                />
                <br />
                <SnackbarContent
                  message={
                    'PRIMARY - This is a regular notification made with color="primary"'
                  }
                  close
                  color="primary"
                />
                <br />
              </ItemGrid>
            </Grid>
            <br />
            <br />
            <Grid container justify="center">
              <ItemGrid xs={12} sm={12} md={6} style={{ textAlign: "center" }}>
                <h5>
                  Notifications Places
                  <Small>Click to view notifications</Small>
                </h5>
              </ItemGrid>
            </Grid>
            <Grid container justify="center">
              <ItemGrid xs={12} sm={12} md={10} lg={8}>
                <Grid container>
                  <ItemGrid xs={12} sm={12} md={4}>
                    <Button
                      fullWidth
                      color="primary"
                      onClick={() => this.showNotification("tl")}
                    >
                      Top Left
                    </Button>
                    <Snackbar
                      place="tl"
                      color="info"
                      icon={AddAlert}
                      message="Welcome to MATERIAL DASHBOARD React - a beautiful freebie for every web developer."
                      open={this.state.tl}
                      closeNotification={() => this.setState({ tl: false })}
                      close
                    />
                  </ItemGrid>
                  <ItemGrid xs={12} sm={12} md={4}>
                    <Button
                      fullWidth
                      color="primary"
                      onClick={() => this.showNotification("tc")}
                    >
                      Top Center
                    </Button>
                    <Snackbar
                      place="tc"
                      color="info"
                      icon={AddAlert}
                      message="Welcome to MATERIAL DASHBOARD React - a beautiful freebie for every web developer."
                      open={this.state.tc}
                      closeNotification={() => this.setState({ tc: false })}
                      close
                    />
                  </ItemGrid>
                  <ItemGrid xs={12} sm={12} md={4}>
                    <Button
                      fullWidth
                      color="primary"
                      onClick={() => this.showNotification("tr")}
                    >
                      Top Right
                    </Button>
                    <Snackbar
                      place="tr"
                      color="info"
                      icon={AddAlert}
                      message="Welcome to MATERIAL DASHBOARD React - a beautiful freebie for every web developer."
                      open={this.state.tr}
                      closeNotification={() => this.setState({ tr: false })}
                      close
                    />
                  </ItemGrid>
                </Grid>
              </ItemGrid>
            </Grid>
            <Grid container justify={"center"}>
              <ItemGrid xs={12} sm={12} md={10} lg={8}>
                <Grid container>
                  <ItemGrid xs={12} sm={12} md={4}>
                    <Button
                      fullWidth
                      color="primary"
                      onClick={() => this.showNotification("bl")}
                    >
                      Bottom Left
                    </Button>
                    <Snackbar
                      place="bl"
                      color="info"
                      icon={AddAlert}
                      message="Welcome to MATERIAL DASHBOARD React - a beautiful freebie for every web developer."
                      open={this.state.bl}
                      closeNotification={() => this.setState({ bl: false })}
                      close
                    />
                  </ItemGrid>
                  <ItemGrid xs={12} sm={12} md={4}>
                    <Button
                      fullWidth
                      color="primary"
                      onClick={() => this.showNotification("bc")}
                    >
                      Bottom Center
                    </Button>
                    <Snackbar
                      place="bc"
                      color="info"
                      icon={AddAlert}
                      message="Welcome to MATERIAL DASHBOARD React - a beautiful freebie for every web developer."
                      open={this.state.bc}
                      closeNotification={() => this.setState({ bc: false })}
                      close
                    />
                  </ItemGrid>
                  <ItemGrid xs={12} sm={12} md={4}>
                    <Button
                      fullWidth
                      color="primary"
                      onClick={() => this.showNotification("br")}
                    >
                      Bottom Right
                    </Button>
                    <Snackbar
                      place="br"
                      color="info"
                      icon={AddAlert}
                      message="Welcome to MATERIAL DASHBOARD React - a beautiful freebie for every web developer."
                      open={this.state.br}
                      closeNotification={() => this.setState({ br: false })}
                      close
                    />
                  </ItemGrid>
                </Grid>
              </ItemGrid>
            </Grid>
          </div>
        }
      />
    );
  }
Example #3
Source File: Signup.jsx    From crypto-manager with MIT License 4 votes vote down vote up
render() {
		const { firstName, lastName, email, password, aadharCardNo, panCardNo, mobileNo, userDetailsSubmitted, userCheckSubmitted, userDetailsPassed, accountCreated, errorOccured, userAlreadyLoggedIn } = this.state;
		return (
			<div>
				{
					userAlreadyLoggedIn ?
					"" :
					<div className="local-bootstrap">
						<div className="registerActivity">
							<div className="auth-wrapper">
								<div className="auth-inner">
									<form name="form" onSubmit={this.handleSubmit}>
										<h3>Sign Up</h3>

										{
											userDetailsPassed ? 
											<div className={'form-group' + (userCheckSubmitted && !aadharCardNo ? ' has-error' : '')}>
												<label>Aadhar Card No</label>
												<input type="text" className="form-control" placeholder="Aadhar Number" name="aadharCardNo" value={aadharCardNo} onChange={this.handleChange} />
											</div> :
											<div className={'form-group' + (userDetailsSubmitted && !firstName ? ' has-error' : '')}>
												<label>First name</label>
												<input type="text" className="form-control" placeholder="First name" name="firstName" value={firstName} onChange={this.handleChange} />
											</div>							
										}

										{
											userDetailsPassed ?
											<div className={'form-group' + (userCheckSubmitted && !panCardNo ? ' has-error' : '')}>
												<label>Pan Card Number</label>
												<input type="text" className="form-control" placeholder="Pan Number" name="panCardNo" value={panCardNo} onChange={this.handleChange} />
											</div> :
											<div className={'form-group' + (userDetailsSubmitted && !lastName ? ' has-error' : '')}>
												<label>Last name</label>
												<input type="text" className="form-control" placeholder="Last name" name="lastName" value={lastName} onChange={this.handleChange} />
											</div>
										}

										{
											userDetailsPassed ?
											<div className={'form-group' + (userCheckSubmitted && !mobileNo ? ' has-error' : '')}>
												<label>Mobile Number</label>
												<input type="number" className="form-control" placeholder="Mobile Number" name="mobileNo" value={mobileNo} onChange={this.handleChange} />
											</div> :
											<div className={'form-group' + (userDetailsSubmitted && !email ? ' has-error' : '')}>
												<label>Email address</label>
												<input type="email" className="form-control" placeholder="Enter email" name="email" value={email} onChange={this.handleChange} />
											</div>
										}

										{
											userDetailsPassed ?
											'' :
											<div className={'form-group' + (userDetailsSubmitted && !password ? ' has-error' : '')}>
												<label>Password</label>
												<input type="password" className="form-control" placeholder="Enter password" name="password" value={password} onChange={this.handleChange} />
											</div>
										}
										
										{
											userDetailsPassed ?
											<button type="submit" className="btn btn-primary btn-block">Register</button> :
											<button type="submit" className="btn btn-primary btn-block">Continue</button>
										}
										
										<p className="signed-up text-right">
											Already registered <a href="/login">Sign in?</a>
										</p>
									</form>

									{
										accountCreated ?
										<SnackbarContent
											message={
											'Account created successfully. Head over to login'
											}
											color="success"
										/> :
										""
									}

									{
										errorOccured ?
										<SnackbarContent
											message={
											'Account not created'
											}
											color="danger"
										/> :
										""
									}

								</div>
							</div>
						</div>
					</div>
				}
			</div>
        );
    }