Include a notice during account creation for under-18 users (#927)

This commit is contained in:
Paul Frazee 2023-06-30 11:34:52 -05:00 committed by GitHub
parent c72e24f841
commit 48844aa4c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 4 deletions

View file

@ -31,13 +31,21 @@ export class CreateAccountModel {
makeAutoObservable(this, {}, {autoBind: true})
}
get isAge13() {
return getAge(this.birthDate) >= 13
}
get isAge18() {
return getAge(this.birthDate) >= 18
}
// form state controls
// =
next() {
this.error = ''
if (this.step === 2) {
if (getAge(this.birthDate) < 13) {
if (!this.isAge13) {
this.error =
'Unfortunately, you do not meet the requirements to create an account.'
return