mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-30 23:06:10 +03:00
Make Repository URL optional in airtable response.
This commit is contained in:
parent
c789bb4a38
commit
4ea2e47e98
@ -62,14 +62,15 @@ entryView entry =
|
||||
, Element.row [ Element.width Element.fill ]
|
||||
[ categoriesView entry.categories
|
||||
, Element.row [ Element.alignRight ]
|
||||
[ if entry.repoUrl == "" then
|
||||
Element.none
|
||||
[ case entry.repoUrl of
|
||||
Just repoUrl ->
|
||||
Element.newTabLink []
|
||||
{ url = repoUrl
|
||||
, label = FontAwesome.icon "fas fa-code-branch"
|
||||
}
|
||||
|
||||
else
|
||||
Element.newTabLink []
|
||||
{ url = entry.repoUrl
|
||||
, label = FontAwesome.icon "fas fa-code-branch"
|
||||
}
|
||||
Nothing ->
|
||||
Element.none
|
||||
]
|
||||
]
|
||||
]
|
||||
@ -97,7 +98,7 @@ type alias Entry =
|
||||
, authorName : String
|
||||
, authorUrl : String
|
||||
, categories : List String
|
||||
, repoUrl : String
|
||||
, repoUrl : Maybe String
|
||||
}
|
||||
|
||||
|
||||
@ -117,7 +118,7 @@ entryDecoder =
|
||||
(Decode.field "Author" Decode.string)
|
||||
(Decode.field "Author URL" Decode.string)
|
||||
(Decode.field "Categories" (Decode.list Decode.string))
|
||||
(Decode.field "Repository URL" Decode.string)
|
||||
(Decode.maybe (Decode.field "Repository URL" Decode.string))
|
||||
|
||||
|
||||
staticRequest : StaticHttp.Request (List Entry)
|
||||
|
Loading…
Reference in New Issue
Block a user