Skip to content

Instantly share code, notes, and snippets.

@crawftv
Created January 21, 2022 04:48
Show Gist options
  • Save crawftv/3d8972f2cddea44118292165ffd0092e to your computer and use it in GitHub Desktop.
Save crawftv/3d8972f2cddea44118292165ffd0092e to your computer and use it in GitHub Desktop.
view : Model -> Html Msg
view model =
case model.selectedGender of
Just x ->
case x of
Masculine ->
div [] [
div []
[ button [onClick (SelectGender Masculine), style "background-color" "blue"] [text "Masculine"]
, button [onClick (SelectGender Feminine)] [text "Feminine"]
, button [onClick (SelectGender Neuter)] [text "Neuter"]
]
, div [] [text (Debug.toString model)]
]
Feminine ->
div [] [
div []
[ button [onClick (SelectGender Masculine)] [text "Masculine"]
, button [onClick (SelectGender Feminine), style "background-color" "blue"] [text "Feminine"]
, button [onClick (SelectGender Neuter)] [text "Neuter"]
]
, div [] [text (Debug.toString model)]
]
Neuter ->
div [] [
div []
[ button [onClick (SelectGender Masculine)] [text "Masculine"]
, button [onClick (SelectGender Feminine)] [text "Feminine"]
, button [onClick (SelectGender Neuter), style "background-color" "blue" ] [text "Neuter"]
]
, div [] [text (Debug.toString model)]
]
Nothing ->
div []
[ button [onClick (SelectGender Masculine)] [text "Masculine"]
, button [onClick (SelectGender Feminine)] [text "Feminine"]
, button [onClick (SelectGender Neuter)] [text "Neuter"]
,div [] [text (Debug.toString model)]
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment