From 8fe25f8acac296218d2a01a549bcdf8ebbf7554f Mon Sep 17 00:00:00 2001 From: Philippe Pittoli Date: Sat, 1 Jul 2023 17:32:15 +0200 Subject: [PATCH] Bulma select. --- src/App/DNSManagerDomainsInterface.purs | 2 +- src/Bulma.purs | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/App/DNSManagerDomainsInterface.purs b/src/App/DNSManagerDomainsInterface.purs index 59b7e95..014b905 100644 --- a/src/App/DNSManagerDomainsInterface.purs +++ b/src/App/DNSManagerDomainsInterface.purs @@ -235,7 +235,7 @@ render { list_acceptable_domains = [ Bulma.h3 "Acceptable domains:" - , HH.ul_ $ map (\domain -> HH.li_ [ HH.text domain ]) accepted_domains + , Bulma.select $ map Bulma.option accepted_domains ] list_of_own_domains diff --git a/src/Bulma.purs b/src/Bulma.purs index 11d5066..7536a96 100644 --- a/src/Bulma.purs +++ b/src/Bulma.purs @@ -31,6 +31,10 @@ class_label :: Array (HH.ClassName) class_label = [HH.ClassName "label" ] class_control :: Array (HH.ClassName) class_control = [HH.ClassName "control" ] +class_select :: Array (HH.ClassName) +class_select = [HH.ClassName "select" ] +class_primary :: Array (HH.ClassName) +class_primary = [HH.ClassName "is-primary" ] columns :: forall (w :: Type) (i :: Type). @@ -329,3 +333,10 @@ p str = HH.p_ [ HH.text str ] box :: forall w i. Array (HH.HTML w i) -> HH.HTML w i box = HH.div [HP.classes class_box] + +option :: forall w i. String -> HH.HTML w i +option value = HH.option_ [HH.text value] + +select :: forall w i. Array (HH.HTML w i) -> HH.HTML w i +select options = HH.div [HP.classes (class_select <> class_primary)] + [ HH.select_ options]