@@ -2,6 +2,7 @@ module Pages.Home_ exposing (..)
2
2
3
3
import Auth
4
4
import Components.Button
5
+ import Components.Dialog
5
6
import Components.EmptyState
6
7
import Components.Icon
7
8
import Components.Layout
@@ -24,7 +25,7 @@ page user shared route =
24
25
{ init = init
25
26
, update = update
26
27
, subscriptions = subscriptions
27
- , view = view route . path
28
+ , view = view user
28
29
}
29
30
|> Page . withLayout
30
31
( \ _ ->
@@ -64,7 +65,7 @@ update msg model =
64
65
case msg of
65
66
ClickedCreateFirstProject ->
66
67
( { model | isDialogOpen = True }
67
- , Effect . none
68
+ , Effect . showDialog { id = ids . createProjectDialog }
68
69
)
69
70
70
71
@@ -81,15 +82,49 @@ subscriptions model =
81
82
-- VIEW
82
83
83
84
84
- view : Path -> Model -> View Msg
85
- view path model =
85
+ ids :
86
+ { createProjectDialog : String
87
+ , createFirstProjectButton : String
88
+ }
89
+ ids =
90
+ { createProjectDialog = " dialog__create-project"
91
+ , createFirstProjectButton = " button__create-first-project"
92
+ }
93
+
94
+
95
+ view : Auth .User -> Model -> View Msg
96
+ view user model =
86
97
{ title = " Jangle | Dashboard"
87
98
, body =
88
99
[ div [ Css . col, Css . fill, Css . align_center ]
89
100
[ Components . EmptyState . viewCreateYourFirstProject
90
- { onClick = ClickedCreateFirstProject
101
+ { id = ids. createFirstProjectButton
102
+ , onClick = ClickedCreateFirstProject
91
103
}
92
104
, div [ Css . h_96 ] []
93
105
]
106
+ , Components . Dialog . new
107
+ { title = " Create a project"
108
+ , content =
109
+ [ div [ Css . col, Css . gap_12, Css . sidebar_link, Css . color_textSecondary ]
110
+ [ p [ Css . line_140 ]
111
+ [ text
112
+ ( " Hey ${name}! 👋 This form isn't quite ready yet..."
113
+ |> String . replace " ${name}"
114
+ ( String . split " " user. name
115
+ |> List . head
116
+ |> Maybe . withDefault user. name
117
+ )
118
+ )
119
+ ]
120
+ , p [ Css . line_140 ]
121
+ [ text " Try hitting the ESC key or clicking the \" X\" icon in the top-right corner!"
122
+ ]
123
+ ]
124
+ ]
125
+ }
126
+ |> Components . Dialog . withSubtitle " Connect to an existing GitHub repository"
127
+ |> Components . Dialog . withId ids. createProjectDialog
128
+ |> Components . Dialog . view
94
129
]
95
130
}
0 commit comments