render()

in source/client/src/liveness/components/ResultMessage.tsx [29:55]


  render() {
    const title = this.props.success ? SUCCESS_TITLE : FAIL_TITLE;
    const message = this.props.success ? SUCCESS_MESSAGE : FAIL_MESSAGE;
    const buttonText = this.props.success ? SUCCESS_BUTTON : FAIL_BUTTON;
    const resultImg = this.props.success ? positiveFace : negativeFace;
    const lottieOptions = {
      // @ts-ignore
      animationData: this.props.success ? successData.default : failData.default,
      loop: false
    };

    return (
      <div className="text-center container">
        <div className="result-frame">
          <div className="result-animation">
            <Lottie options={lottieOptions} height={56} width={56} />
          </div>
          <img src={resultImg} alt="Positive face" className="result-face" />
        </div>
        <h2 className="mt-5 font-weight-bold">{title}</h2>
        <p className="mt-2 gray-darker">{message}</p>
        <button type="button" className="btn btn-primary btn-lg mt-5 btn-block" onClick={this.props.onRestart}>
          {buttonText}
        </button>
      </div>
    );
  }