-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
94 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
module Pages.Undo exposing (Model, Msg, page) | ||
|
||
import Effect exposing (Effect) | ||
import Html.Attributes as HA | ||
import Html.Styled as SH exposing (..) | ||
import Html.Styled.Attributes exposing (attribute) | ||
import Ion.Button | ||
import Ion.Icon | ||
import Layouts | ||
import Page exposing (Page) | ||
import Route exposing (Route) | ||
import Shared | ||
import View exposing (View) | ||
|
||
|
||
page : Shared.Model -> Route () -> Page Model Msg | ||
page shared route = | ||
Page.new | ||
{ init = init | ||
, update = update | ||
, subscriptions = subscriptions | ||
, view = view shared | ||
} | ||
|> Page.withLayout toLayout | ||
|
||
|
||
{-| Use the appframe layout on this page | ||
-} | ||
toLayout : Model -> Layouts.Layout Msg | ||
toLayout model = | ||
Layouts.AppFrame | ||
{} | ||
|
||
|
||
|
||
-- INIT | ||
|
||
|
||
type alias Model = | ||
{} | ||
|
||
|
||
init : () -> ( Model, Effect Msg ) | ||
init () = | ||
( {} | ||
, Effect.none | ||
) | ||
|
||
|
||
|
||
-- UPDATE | ||
|
||
|
||
type Msg | ||
= NoOp | ||
|
||
|
||
update : Msg -> Model -> ( Model, Effect Msg ) | ||
update msg model = | ||
case msg of | ||
NoOp -> | ||
( model | ||
, Effect.none | ||
) | ||
|
||
|
||
|
||
-- SUBSCRIPTIONS | ||
|
||
|
||
subscriptions : Model -> Sub Msg | ||
subscriptions model = | ||
Sub.none | ||
|
||
|
||
|
||
-- VIEW | ||
|
||
|
||
view : Shared.Model -> Model -> View Msg | ||
view shared model = | ||
let | ||
viewChange profileChange = | ||
node "ion-item" | ||
[] | ||
[ text (Shared.profileChangeToString profileChange) | ||
, SH.fromUnstyled <| Ion.Button.button [ HA.attribute "slot" "end" ] [ Ion.Icon.basic "arrow-undo-circle-outline" ] | ||
] | ||
in | ||
{ title = "UI History (undo)" | ||
, body = | ||
[ node "ion-list" [] (List.map viewChange shared.uiHistory) | ||
] | ||
} |