halogen-websocket-ipc-playzone/drop/UnusedCode.purs

45 lines
1.5 KiB
Plaintext
Raw Normal View History

2023-07-11 05:46:21 +02:00
-- TODO: wrong type
--home_icon :: forall r w i. Array (HP.IProp r i) -> HH.HTML w i
--home_icon = HH.span
-- [HP.classes [HH.ClassName "icon is-small"]]
-- [HH.i ([HP.classes [HH.ClassName "fas fa-home"]] <> aria) []]
-- where aria = [Aria.hidden "true"]
nav_bar :: forall w i. String -> HH.HTML w i
nav_bar domain
= HH.nav
[ HP.classes $ C.breadcrumb <> C.is_centered <> C.has_succeeds_separator
, Aria.label "breadcrumbs"
] [ HH.ul_
[ HH.li_ [ HH.a [HP.href "/"] [ HH.text "Home"] ]
, HH.li []
[ HH.a
[HP.href "/", aria_current "page"]
[HH.text ("Domain: " <> domain)]
]
]
]
-- type_selection: create a "select" input.
-- Get the changes with "onSelectedIndexChange" which provides an index (from `baseRecords`)
type_selection :: HH.HTML w Action
type_selection = HH.div [HP.classes $ C.select <> C.is_normal]
[ HH.select
[ HE.onSelectedIndexChange (UpdateNewForm <<< Update_New_Form_SRR <<< Update_SRR_Type) ]
$ map type_option baseRecords
]
type_option n
= HH.option
[ HP.value n
, HP.selected (n == rr.rrtype)
] [ HH.text n ]
-- Get the element from the index
H.modify_ _ { _newSRR = changeType state._newSRR (baseRecords A.!! val) }
changeType :: forall (l :: Row Type). (SimpleRR l) -> Maybe String -> (SimpleRR l)
changeType rr Nothing = rr
changeType rr (Just s) = rr { rrtype = s }