Last active
June 23, 2016 12:54
-
-
Save sethlivingston/a483aae67fa94939d3c1ce74bcb9c40f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Components.Tab exposing (Model, Msg, init, view, update) | |
import Html exposing (Html, div, text, i) | |
import Html.Attributes exposing (class) | |
import Html.Events exposing (onClick) | |
-- MODEL | |
type alias Model = | |
{ icon : String | |
, title : String | |
} | |
init: String -> String -> Model | |
init icon title = | |
Model icon title | |
-- MESSAGES | |
type Msg | |
= Click | |
-- VIEW | |
view : Model -> Html Msg | |
view model = | |
div | |
[ class "tab" | |
, onClick Click | |
] | |
[ i [ class ("fa fa-" ++ model.icon) ] [] | |
, text model.title | |
] | |
-- UPDATE | |
update : Msg -> Model -> ( Model, Cmd Msg ) | |
update message model = | |
case message of | |
Click value -> | |
( model, Cmd.none) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment