diff --git a/javascript/apps/taiga/src/app/modules/auth/feature-sign-up/components/signup/signup.component.html b/javascript/apps/taiga/src/app/modules/auth/feature-sign-up/components/signup/signup.component.html index a625db304..6336d46b4 100644 --- a/javascript/apps/taiga/src/app/modules/auth/feature-sign-up/components/signup/signup.component.html +++ b/javascript/apps/taiga/src/app/modules/auth/feature-sign-up/components/signup/signup.component.html @@ -29,6 +29,14 @@ + +

+ {{ t('signup.warnings.only_emojis') }} +

+
{ + this.fullNameOnlyEmojis = this.isOnlyEmojis(value); + }); } public onSubmit() { @@ -174,4 +189,11 @@ export class SignupComponent implements OnInit { public signUpDone() { this.signUpSuccess.next(this.signUpForm.value); } + + public isOnlyEmojis(str: string): boolean { + const regEx = + /^(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])+$/g; + + return regEx.test(str.replaceAll(' ', '').trim()); + } } diff --git a/javascript/apps/taiga/src/assets/i18n/auth/en-US.json b/javascript/apps/taiga/src/assets/i18n/auth/en-US.json index 7dc3cb4db..f9a440f2d 100644 --- a/javascript/apps/taiga/src/assets/i18n/auth/en-US.json +++ b/javascript/apps/taiga/src/assets/i18n/auth/en-US.json @@ -38,6 +38,9 @@ "resend_email_label": "Sorry, something went wrong sending the email", "resend_email_message": "Wait a few minutes and try again" }, + "warnings": { + "only_emojis": "Some people might not understand your full name correctly if it only has emojis." + }, "delete_account_success_title": "Your account was deleted successfully.", "delete_account_success_subtitle": "👋 Sorry to see you go!" },