Change the way current & pending email addresses are displayed.

caa
Philippe PITTOLI 2024-07-10 00:57:05 +02:00
parent b3be75c2fb
commit 3b7cbb55ac
1 changed files with 11 additions and 9 deletions

View File

@ -16,6 +16,7 @@ import Web.Event.Event as Event
import Web.Event.Event (Event) import Web.Event.Event (Event)
import Bulma as Bulma import Bulma as Bulma
import CSSClasses as C
import App.Type.Email as Email import App.Type.Email as Email
import App.Validation.Email as E import App.Validation.Email as E
@ -108,15 +109,16 @@ render { modal, newPasswordForm, new_email_address, emails } =
where where
b e = Bulma.column_ e b e = Bulma.column_ e
render_emails (Tuple current pending) render_emails (Tuple current pending) = HH.div [] $ render_current current <> render_pending pending
= HH.div [] where
[ case current of render_current (Just (Email.Email e)) = [ Bulma.p $ "Current email address: " ] <>
Just (Email.Email e) -> Bulma.p $ "Current email address: " <> e [ Bulma.btn_ro (C.is_small <> C.is_warning) e]
Nothing -> Bulma.p "You do not currently have a validated email address!" render_current Nothing = [ Bulma.p "You do not currently have a validated email address!" ]
, case pending of
Just (Email.Email e) -> Bulma.p $ "Pending email address: " <> e render_pending (Just (Email.Email e)) = [ Bulma.p $ "Pending email address: " ] <>
Nothing -> Bulma.p "You do not have a pending email address." [ Bulma.btn_ro (C.is_small <> C.is_warning) e]
] render_pending Nothing = []
render_delete_account = Bulma.alert_btn "Delete my account" DeleteAccountPopup render_delete_account = Bulma.alert_btn "Delete my account" DeleteAccountPopup
render_new_email_form = HH.form render_new_email_form = HH.form