Skip to content

Commit

Permalink
(fix) Add cursors everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
dawehner committed Jul 9, 2017
1 parent 375436c commit 656652a
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 25 deletions.
11 changes: 6 additions & 5 deletions src/App/Pages/Home.elm
Expand Up @@ -3,10 +3,11 @@ module App.Pages.Home exposing (view)
import App.Model exposing (..)
import App.Difficulty exposing (..)
import Html exposing (..)
import Html.Attributes exposing (src)
import Html.Attributes exposing (src, style)
import Html.Events exposing (onClick)
import RemoteData exposing (WebData, RemoteData, RemoteData(..))
import App.View.Atom exposing (viewRemoteData)
import App.View.Style exposing (cursorPointer)
import App.View.Molecule exposing (..)
import App.View.Grid exposing (grid4, grid2x2, grid1__2, grid1__1, grid1__, grid4WithStyle)
import Material.List as ML
Expand Down Expand Up @@ -88,19 +89,19 @@ viewCurrentMonthIssue model =
viewCookMenu : Model -> Html Msg
viewCookMenu model =
grid4WithStyle [ Elevation.e3 ]
[ div [ onClick <| SetActivePage <| RecipesPerCategoryPage "Main course" ]
[ div [ onClick <| SetActivePage <| RecipesPerCategoryPage "Main course", style [ cursorPointer ] ]
[ h3 [] [ text "Dinners to impress" ]
, h4 [] [ text "List recipes" ]
]
, div [ onClick <| SetActivePage <| RecipesPerDifficultyPage Easy ]
, div [ onClick <| SetActivePage <| RecipesPerDifficultyPage Easy, style [ cursorPointer ] ]
[ h3 [] [ text "Learn to cook" ]
, h4 [] [ text "Recipes for beginner" ]
]
, div [ onClick <| SetActivePage <| RecipesPerCategoryPage "Dessert" ]
, div [ onClick <| SetActivePage <| RecipesPerCategoryPage "Dessert", style [ cursorPointer ] ]
[ h3 [] [ text "Backed up" ]
, h4 [] [ text "Delicious cake and bakes" ]
]
, div [ onClick <| SetActivePage <| RecipesShorterThanNMinutesPage 20 ]
, div [ onClick <| SetActivePage <| RecipesShorterThanNMinutesPage 20, style [ cursorPointer ] ]
[ h3 [] [ text "Quick and Easy" ]
, h4 [] [ text "20 minutes or less" ]
]
Expand Down
2 changes: 1 addition & 1 deletion src/App/View.elm
Expand Up @@ -13,7 +13,6 @@ import App.Pages.RecipesPerCategoryPage
import App.Pages.RecipesPerDifficultyPage
import App.Pages.RecipesShorterThanNMinutesPage
import Html exposing (..)
import Html.Events exposing (onClick, onInput, onSubmit)
import Html.Attributes exposing (..)
import App.View.Organism exposing (viewHeader, viewFooter)
import App.View.Organism exposing (..)
Expand Down Expand Up @@ -68,6 +67,7 @@ view model =

RecipesPerDifficultyPage category ->
App.Pages.RecipesPerDifficultyPage.view model model.pageRecipesPerDifficulty

RecipesShorterThanNMinutesPage category ->
App.Pages.RecipesShorterThanNMinutesPage.view model model.pageRecipesShorterThan

Expand Down
5 changes: 3 additions & 2 deletions src/App/View/Atom.elm
Expand Up @@ -11,7 +11,8 @@ import Material.Chip as Chip
import Material.Grid as Grid
import Material.Typography as Typography
import Material.Options as Options
import App.View.Components exposing (onClickPreventDefault)
import App.View.Components exposing (..)
import App.View.Style exposing (cursorPointer)
import RemoteData exposing (WebData, RemoteData(..))
import Material.Progress as Progress

Expand Down Expand Up @@ -81,7 +82,7 @@ cardTagsInline tags =
List.map
(\tag ->
Chip.button []
[ Chip.content [] [ span [ onClickPreventDefault (SetActivePage <| RecipesPerTagPage tag) ] [ text tag ] ] ]
[ Chip.content [] [ span [ style [ cursorPointer ], onClickPreventDefault (SetActivePage <| RecipesPerTagPage tag) ] [ text tag ] ] ]
)
tags

Expand Down
17 changes: 2 additions & 15 deletions src/App/View/Components.elm
@@ -1,4 +1,4 @@
module App.View.Components exposing (onClickPreventDefault)
module App.View.Components exposing (..)

import App.Model exposing (..)
import Html exposing (..)
Expand All @@ -13,20 +13,7 @@ import Material.Layout as Layout
import Material.Options as Options


viewTags : List Term -> Html Msg
viewTags terms =
ul []
(List.map
(\tag ->
li [] [ viewTag tag ]
)
terms
)


viewTag : Term -> Html Msg
viewTag term =
a [ onClickPreventDefault (SetActivePage <| RecipesPerTagPage term.name) ] [ text term.name ]
{--This are all things which shouldn't belong here --}


onClickPreventDefault : msg -> Attribute msg
Expand Down
4 changes: 3 additions & 1 deletion src/App/View/Molecule.elm
Expand Up @@ -4,7 +4,8 @@ import App.Model exposing (..)
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (onClick)
import App.View.Components exposing (..)
import App.View.Style exposing (cursorPointer)
import App.View.Components exposing (onClickPreventDefault)
import App.View.Atom exposing (..)
import App.View.Grid exposing (grid2__2, grid2__2_center)
import App.PageType exposing (Page(..))
Expand Down Expand Up @@ -51,6 +52,7 @@ recipeCardWithReverse reverse recipe =
Card.view
[ Options.onClick <| SetActivePage <| RecipeDetailPage recipe.id
, css "width" "100%"
, uncurry css cursorPointer
, Elevation.e2
]
<|
Expand Down
3 changes: 2 additions & 1 deletion src/App/View/Organism.elm
Expand Up @@ -5,6 +5,7 @@ import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (onClick)
import App.View.Atom exposing (..)
import App.View.Style exposing (cursorPointer)
import App.View.Molecule exposing (..)
import App.View.Grid exposing (grid4, grid4WithStyle, grid1__1)
import App.PageType exposing (..)
Expand Down Expand Up @@ -117,7 +118,7 @@ viewTabs =
viewMdlHeader : List (Html Msg)
viewMdlHeader =
[ Layout.row []
[ Layout.title [ Options.onClick (SetActivePage Home), Options.css "cursor" "pointer" ] [ text "Umami, food magazine" ]
[ Layout.title [ Options.onClick (SetActivePage Home), uncurry Options.css cursorPointer ] [ text "Umami, food magazine" ]
, Layout.spacer
, Layout.navigation []
[ Layout.link [ Layout.href "http://www.contentacms.org/" ] [ img [ height 36, src "assets/contenta-lg.png", alt "Contenta Logo" ] [] ]
Expand Down
6 changes: 6 additions & 0 deletions src/App/View/Style.elm
@@ -0,0 +1,6 @@
module App.View.Style exposing (cursorPointer)


cursorPointer : ( String, String )
cursorPointer =
( "cursor", "pointer" )

0 comments on commit 656652a

Please sign in to comment.