Skip to content

Instantly share code, notes, and snippets.

@girishso
Last active December 28, 2017 02:20
Show Gist options
  • Save girishso/c070f95706ccfd3127775797f038ea54 to your computer and use it in GitHub Desktop.
Save girishso/c070f95706ccfd3127775797f038ea54 to your computer and use it in GitHub Desktop.
view : Model -> Html Msg
view model =
section [ class "section" ]
[ div [ class "container" ]
[ h1 [ class "title" ]
[ text model.projectName ]
, p [ class "subtitle" ]
[ button [ class "button", onClick TogglePopup ]
[ text "Show Popup"
]
]
, if model.isPopUpActive then
renderModal model
else
Html.text ""
]
]
renderModal : Model -> Html Msg
renderModal model =
div [ class "modal is-active", attribute "aria-label" "Modal title" ]
[ div [ class "modal-background", onClick TogglePopup ]
[]
, div [ class "modal-card" ]
[ header [ class "modal-card-head" ]
[ p [ class "modal-card-title" ]
[ text "Modal title" ]
, button [ class "delete", onClick TogglePopup, attribute "aria-label" "close" ]
[]
]
, section [ class "modal-card-body" ]
[ text "Modal contents" ]
, footer [ class "modal-card-foot" ]
[ button [ class "button", onClick TogglePopup, attribute "aria-label" "cancel" ]
[ text "Cancel" ]
]
]
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment