on master help sign in
Filter out elm-stuff/ and .hidden paths
495a5f8Evan Czaplicki
ui/browser/src/Index.elm+11−7
@@ -141,21 +141,25 @@ viewFiles : List String -> List File -> Html msg
141viewFiles dirs files =
141viewFiles dirs files =
142 Skeleton.box
142 Skeleton.box
143 { title = "File Navigation"
143 { title = "File Navigation"
144− , items = List.map viewDir dirs ++ List.map viewFile files
144+ , items = List.filterMap viewDir dirs ++ List.filterMap viewFile files
145 , footer = Nothing
145 , footer = Nothing
146 }
146 }
147
147
148
148
149−viewDir : String -> List (Html msg)
149+viewDir : String -> Maybe (List (Html msg))
150viewDir dir =
150viewDir dir =
151+ if String.startsWith "." dir || dir == "elm-stuff" then
152+ Nothing
153+ else
151− [ a [ href dir ] [ Icon.folder, text dir ]
154+ Just [ a [ href dir ] [ Icon.folder, text dir ] ]
152− ]
153
155
154
156
155−viewFile : File -> List (Html msg)
157+viewFile : File -> Maybe (List (Html msg))
156viewFile {name} =
158viewFile {name} =
159+ if String.startsWith "." name then
160+ Nothing
161+ else
157− [ a [ href name ] [ Icon.lookup name, text name ]
162+ Just [ a [ href name ] [ Icon.lookup name, text name ] ]
158− ]
159
163
160
164
161
165