|
| 1 | +import React, { Component } from "react"; |
| 2 | +import ReleaseCard from "../components/releasecard/ReleaseCard"; |
| 3 | +import Button from "../components/button/Button"; |
| 4 | +import ButtonsGroup from "../components/button/ButtonsGroup"; |
| 5 | +import { FormattedMessage } from "react-intl"; |
| 6 | +import { betas } from "../firmware/betas"; |
| 7 | + |
| 8 | +import styles from "./sass/Releases.module.sass"; |
| 9 | + |
| 10 | +type BetaState = { |
| 11 | + input: string; |
| 12 | + fieldCompleted: boolean; |
| 13 | +}; |
| 14 | + |
| 15 | +export default class Beta extends Component<{}, BetaState> { |
| 16 | + constructor(props: {}) { |
| 17 | + super(props); |
| 18 | + |
| 19 | + this.state = { |
| 20 | + input: "", |
| 21 | + fieldCompleted: false, |
| 22 | + }; |
| 23 | + |
| 24 | + this.onChange = this.onChange.bind(this); |
| 25 | + } |
| 26 | + |
| 27 | + onChange(e: any) { |
| 28 | + const value = e.target.value; |
| 29 | + this.setState({ input: value }); |
| 30 | + if ( |
| 31 | + value.toLowerCase() === |
| 32 | + "je suis d'accord et ne me rendrai jamais en examen avec une beta" || |
| 33 | + value.toLowerCase() === |
| 34 | + "je suis d'accord et ne me rendrai jamais en examen avec une bêta" || |
| 35 | + value.toLowerCase() === |
| 36 | + "i agree and will never go to exam with a beta" |
| 37 | + ) { |
| 38 | + this.setState({ fieldCompleted: true }); |
| 39 | + } else { |
| 40 | + this.setState({ fieldCompleted: false }); |
| 41 | + } |
| 42 | + } |
| 43 | + |
| 44 | + render() { |
| 45 | + return ( |
| 46 | + <div className="content"> |
| 47 | + <div className={styles.banner}> |
| 48 | + <div className={styles.title}>Omega 1.21</div> |
| 49 | + <div className={styles.description}> |
| 50 | + <FormattedMessage |
| 51 | + defaultMessage="Welcome to the Omega beta program." |
| 52 | + id="beta.welcome" |
| 53 | + /> |
| 54 | + </div> |
| 55 | + <ButtonsGroup style={{ display: "inline-block" }}> |
| 56 | + <Button |
| 57 | + href="https://github.com/Omega-Numworks/Omega/issues/new?assignees=&labels=Status%3A+Triage%2C+Type%3A+Bug&template=omega-beta-only---bug-report.md&title=%5BBETA-1.21%5D+…" |
| 58 | + leftIcon="web" |
| 59 | + > |
| 60 | + <FormattedMessage |
| 61 | + defaultMessage="REPORT A BUG ON GITHUB" |
| 62 | + id="beta.report.github" |
| 63 | + /> |
| 64 | + </Button> |
| 65 | + <Button |
| 66 | + |
| 67 | + leftIcon="mail" |
| 68 | + > |
| 69 | + <FormattedMessage |
| 70 | + defaultMessage="REPORT A BUG BY MAIL" |
| 71 | + id="beta.report.mail" |
| 72 | + /> |
| 73 | + </Button> |
| 74 | + </ButtonsGroup> |
| 75 | + </div> |
| 76 | + <div style={{ height: "16px" }}></div> |
| 77 | + <div className={styles.cards}> |
| 78 | + <div className={styles.warning}> |
| 79 | + <FormattedMessage |
| 80 | + defaultMessage="Warning: Omega betas are NOT made for exam and do not have Omega exam mode. By going with for exams, you put yourself in danger and risk several years of prohibition of exams. May be even more serious depending on the applicable legislation in your country. By installing an Omega beta, you agree that neither NumWorks nor Omega can be held responsible for any issues with exam mode. If you agree to this, type this sentence in the following field: I agree and will never go to exam with a beta" |
| 81 | + id="beta.report.exammode" |
| 82 | + /> |
| 83 | + </div> |
| 84 | + <input |
| 85 | + className={styles.warningField} |
| 86 | + type="text" |
| 87 | + value={this.state.input} |
| 88 | + onChange={this.onChange} |
| 89 | + ></input> |
| 90 | + <ReleaseCard |
| 91 | + version={betas.firmwares[0]} |
| 92 | + name="Beta 1" |
| 93 | + hidden={!this.state.fieldCompleted} |
| 94 | + /> |
| 95 | + </div> |
| 96 | + <div style={{ height: "16px" }}></div> |
| 97 | + </div> |
| 98 | + ); |
| 99 | + } |
| 100 | +} |
0 commit comments