Skip to content

Commit 372c76c

Browse files
committed
Use icons for entry actions
1 parent 51b32a8 commit 372c76c

File tree

2 files changed

+28
-6
lines changed

2 files changed

+28
-6
lines changed

assets/elm/app/Feeds/Icons.elm

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Feeds.Icons exposing (bookmarkSlashSolid)
1+
module Feeds.Icons exposing (arrowTopRightOnSquareSolid, bookmarkSlashSolid)
22

33
{-| This module contains icons that come from
44
<https://jasonliang.js.org/heroicons-for-elm/>, but are not available in
@@ -12,6 +12,18 @@ import Svg exposing (..)
1212
import Svg.Attributes exposing (..)
1313

1414

15+
arrowTopRightOnSquareSolid : Html msg
16+
arrowTopRightOnSquareSolid =
17+
svg [ fill "none", viewBox "0 0 24 24", strokeWidth "1.5", stroke "currentColor" ]
18+
[ Svg.path
19+
[ strokeLinecap "round"
20+
, strokeLinejoin "round"
21+
, d "M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"
22+
]
23+
[]
24+
]
25+
26+
1527
bookmarkSlashSolid : Html msg
1628
bookmarkSlashSolid =
1729
svg [ viewBox "0 0 24 24", fill "currentColor" ]

assets/elm/app/Feeds/View.elm

+15-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module Feeds.View exposing (view)
22

33
import DateFormat as F
44
import Dict
5-
import Feeds.Icons exposing (bookmarkSlashSolid)
5+
import Feeds.Icons exposing (arrowTopRightOnSquareSolid, bookmarkSlashSolid)
66
import Feeds.Model exposing (..)
77
import Feeds.Msg exposing (..)
88
import Feeds.Options as Options
@@ -42,8 +42,11 @@ viewEntry timezone entry =
4242

4343
else
4444
H.button
45-
[ A.class "px-4 py-2 text-sm font-extrabold bg-blue-700 text-white", E.onClick (MarkAsRead entry) ]
46-
[ H.text "Mark as read" ]
45+
[ A.class "size-6"
46+
, A.attribute "aria-label" "Mark as read"
47+
, E.onClick (MarkAsRead entry)
48+
]
49+
[ checkCircle [] ]
4750

4851
title =
4952
H.div [ A.class "flex flex-col" ]
@@ -56,15 +59,22 @@ viewEntry timezone entry =
5659
, H.span [] [ H.text postedAt ]
5760
]
5861

62+
label =
63+
"View entry "
64+
++ (entry.title
65+
|> Maybe.withDefault "n/a"
66+
)
67+
5968
actions =
6069
H.div [ A.class "md:shrink-0 flex self-start mt-1 ml-auto space-x-4" ]
6170
[ H.a
6271
[ A.href entry.url
6372
, A.target "_blank"
64-
, A.class "self-start px-4 py-2 text-sm font-extrabold bg-blue-700 text-white"
73+
, A.class "size-6"
74+
, A.attribute "aria-label" label
6575
, E.onClick (MarkAsRead entry)
6676
]
67-
[ H.text "View" ]
77+
[ arrowTopRightOnSquareSolid ]
6878
, maybeButton
6979
]
7080
in

0 commit comments

Comments
 (0)