add Contact Page

This commit is contained in:
David Rodenkirchen
2024-08-27 14:50:42 +02:00
parent ab01c3d9a4
commit 81ec29cda1
9 changed files with 186 additions and 4 deletions
+8
View File
@@ -14,6 +14,8 @@ MINIMUM_PASSWORD_LENGTH = 6
logger = logging.getLogger(__name__.split(".")[-1])
class RegisterPage(Component):
display_printing: list[bool] = [False]
def on_pw_change(self, _: TextInputChangeEvent) -> None:
if not (self.pw_1.text == self.pw_2.text) or len(self.pw_1.text) < MINIMUM_PASSWORD_LENGTH:
self.pw_1.is_valid = False
@@ -86,6 +88,11 @@ class RegisterPage(Component):
await self.display_save_result_animation(True, optional_text="Erfolgreich registriert!")
async def display_save_result_animation(self, success: bool, optional_text: Optional[str] = None) -> None:
if self.display_printing[0]:
return
else:
self.display_printing[0] = True
self.info_text.text = ""
if success:
self.info_text.style = TextStyle(
@@ -107,6 +114,7 @@ class RegisterPage(Component):
self.info_text.text = self.info_text.text + c
await self.info_text.force_refresh()
await sleep(0.04)
self.display_printing[0] = False
@event.on_populate
async def on_populate(self) -> None: