Skip to content

Commit

Permalink
feature(ui): Mark private ones
Browse files Browse the repository at this point in the history
  • Loading branch information
gillchristian committed Jul 28, 2019
1 parent 988872d commit 90bd8cc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Cx.elm
Expand Up @@ -49,7 +49,7 @@ gistsList =

gistItem : Style -> Html.Styled.Attribute msg
gistItem modifier =
css [ display block, fontSize <| px 13, modifier ]
css [ fontSize <| px 13, modifier ]


gistItemGrid : Style
Expand Down
22 changes: 17 additions & 5 deletions src/Main.elm
Expand Up @@ -353,7 +353,7 @@ renderGists { display, showFiles, gists } =


renderGist : Display -> Bool -> Gist -> Html Msg
renderGist display showFiles { id, html_url, owner, files } =
renderGist display showFiles { id, html_url, owner, files, public } =
let
filesLs =
Dict.values files
Expand All @@ -372,10 +372,21 @@ renderGist display showFiles { id, html_url, owner, files } =

fsHtml =
if showFiles then
List.map renderFile <| Maybe.withDefault [] <| List.tail filesLs
div []
<< List.map renderFile
<< Maybe.withDefault []
<|
List.tail filesLs

else
[]
text ""

privateLabel =
if public then
text ""

else
span [] [ text " *" ]
in
div [ styles ]
[ a
Expand All @@ -384,8 +395,9 @@ renderGist display showFiles { id, html_url, owner, files } =
, target "_blank"
, title gistName
]
[ text <| "/" ++ gistName ]
, div [] fsHtml
-- TODO: show a lable similar to GitHub's (solve problem with layout)
[ text <| "/" ++ gistName, privateLabel ]
, fsHtml
]


Expand Down

0 comments on commit 90bd8cc

Please sign in to comment.