-
-
Notifications
You must be signed in to change notification settings - Fork 41
/
Home_.elm
106 lines (97 loc) · 3.32 KB
/
Home_.elm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
module Pages.Home_ exposing (page)
import Html exposing (..)
import Html.Attributes exposing (..)
import Route.Path
import View exposing (View)
type alias Link =
{ label : String
, path : Route.Path.Path
}
page : View msg
page =
{ title = "Homepage"
, body =
[ h1 [] [ text "🏡 Homepage" ]
, p [] [ text "Click a link below to learn how URLs work in Elm Land" ]
, section []
[ h3 [] [ text "🧑\u{200D}💻 Users" ]
, viewLinks
[ { label = "@elm-land"
, path = Route.Path.User_ { user = "elm-land" }
}
, { label = "@ryannhg"
, path = Route.Path.User_ { user = "ryannhg" }
}
, { label = "@elm"
, path = Route.Path.User_ { user = "elm" }
}
]
]
, section []
[ h3 [] [ text "📦 Repos" ]
, viewLinks
[ { label = "@elm-land/vscode"
, path =
Route.Path.User__Repo_
{ user = "elm-land"
, repo = "vscode"
}
}
, { label = "@ryannhg/graphql"
, path =
Route.Path.User__Repo_
{ user = "ryannhg"
, repo = "graphql"
}
}
, { label = "@elm/compiler"
, path =
Route.Path.User__Repo_
{ user = "elm"
, repo = "compiler"
}
}
]
]
, section []
[ h3 [] [ text "🗃 File Explorer" ]
, viewLinks
[ { label = "README from @elm-land/vscode"
, path =
Route.Path.User__Repo__Tree_Branch__ALL_
{ user = "elm-land"
, repo = "vscode"
, branch = "main"
, all_ = [ "README.md" ]
}
}
, { label = "`Decode.elm` from @ryannhg/graphql"
, path =
Route.Path.User__Repo__Tree_Branch__ALL_
{ user = "ryannhg"
, repo = "graphql"
, branch = "main"
, all_ = [ "src", "GraphQL", "Decode.elm" ]
}
}
, { label = "`Compile.hs` from @elm/compiler"
, path =
Route.Path.User__Repo__Tree_Branch__ALL_
{ user = "elm"
, repo = "compiler"
, branch = "master"
, all_ = [ "compiler", "src", "Compile.hs" ]
}
}
]
]
]
}
viewLinks : List Link -> Html msg
viewLinks links =
ul [] (List.map viewLink links)
viewLink : Link -> Html msg
viewLink link =
li []
[ a [ Route.Path.href link.path ] [ text link.label ]
]