WIP: bulma modal caps + remove some warnings.

This commit is contained in:
Philippe Pittoli 2024-01-21 02:51:49 +01:00
parent 047c21103f
commit 22053089af
2 changed files with 10 additions and 11 deletions

View File

@ -255,11 +255,11 @@ render state
modal_rr_delete rr_id =
Bulma.modal
[ Bulma.modal_background
, Bulma.modal_card [Bulma.modal_header "Deleting a resource record", modal_body]
, Bulma.modal_card [Bulma.modal_header "Deleting a resource record"
, Bulma.modal_body [ warning_message ]]
, Bulma.modal_foot [modal_delete_button, Bulma.modal_cancel_button CancelModal]
]
where
modal_body = HH.section [HP.classes C.modal_card_body] [ warning_message ]
modal_delete_button
= HH.button [ HP.classes (C.button <> C.is_success)
, HE.onClick \_ -> RemoveRR rr_id
@ -276,19 +276,16 @@ render state
Bulma.modal
[ Bulma.modal_background
, Bulma.modal_card [Bulma.modal_header "New A resource record"
, modal_body $ Bulma.p "hello, new A RR!"]
, Bulma.modal_body [ Bulma.p "hello, new A RR!" ]]
, Bulma.modal_foot [Bulma.modal_cancel_button CancelModal]
]
_ ->
Bulma.modal
[ Bulma.modal_background
, Bulma.modal_card [Bulma.modal_header "New ?? resource record"
, modal_body $ Bulma.p "hello, new ?? RR!"]
, Bulma.modal_body [ Bulma.p "hello, new ?? RR!" ]]
, Bulma.modal_foot [Bulma.modal_cancel_button CancelModal]
]
where
modal_body x = HH.section [HP.classes C.modal_card_body] [ x ]
-- modal_foot = HH.div [HP.classes C.modal_card_foot]
handleAction :: forall m. MonadAff m => Action -> H.HalogenM State Action () Output m Unit
handleAction = case _ of
@ -685,7 +682,7 @@ render_records errors records
]
]
from_error_array_to_td :: Validation.Errors -> Validation.Attribute -> _
from_error_array_to_td :: forall w i. Validation.Errors -> Validation.Attribute -> Array (HH.HTML w i)
from_error_array_to_td [] _ = []
from_error_array_to_td errors attribute = case A.uncons errors of
Just { head: (Tuple attr err), tail: xs } -> if attr == attribute
@ -802,7 +799,7 @@ render_new_records state
render_new_record_column_simple :: forall (w :: Type)
. (SimpleRR ()) -> Hash.HashMap RRId Validation.Errors -> HH.HTML w Action
render_new_record_column_simple rr errors
render_new_record_column_simple rr _
= Bulma.column_ $ [ Bulma.zone_rr_title $ S.joinWith ", " baseRecords
, type_selection
, Bulma.hr
@ -839,7 +836,7 @@ render_new_record_column_simple rr errors
render_new_record_colunm_mx :: forall (w :: Type)
. (MXRR ()) -> Hash.HashMap RRId Validation.Errors -> HH.HTML w Action
render_new_record_colunm_mx rr errors
render_new_record_colunm_mx rr _
= Bulma.column_
[ Bulma.zone_rr_title "MX"
, Bulma.hr
@ -854,7 +851,7 @@ render_new_record_colunm_mx rr errors
render_new_record_colunm_srv :: forall (w :: Type)
. (SRVRR ()) -> Hash.HashMap RRId Validation.Errors -> HH.HTML w Action
render_new_record_colunm_srv rr errors
render_new_record_colunm_srv rr _
= Bulma.column_
[ Bulma.zone_rr_title "SRV"
, Bulma.hr

View File

@ -453,6 +453,8 @@ modal_header :: forall w i. String -> HH.HTML w i
modal_header title = HH.header [HP.classes C.modal_card_head]
[ HH.p [HP.classes C.modal_card_title] [HH.text title]
]
modal_body :: forall w i. Array (HH.HTML w i) -> HH.HTML w i
modal_body = HH.section [HP.classes C.modal_card_body]
modal_foot :: forall w i. Array (HH.HTML w i) -> HH.HTML w i
modal_foot = HH.div [HP.classes C.modal_card_foot]