This repository was archived by the owner on Jul 19, 2022. It is now read-only.
File tree 8 files changed +69
-37
lines changed
8 files changed +69
-37
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import RemoteData exposing (RemoteData(..))
15
15
import UI
16
16
import UI.Button as Button exposing (Button )
17
17
import UI.Icon as Icon
18
+ import UI.Toolbar as Toolbar
18
19
19
20
20
21
type alias Model =
@@ -114,7 +115,7 @@ viewEmptyStateCodebase : AppContext -> Html Msg
114
115
viewEmptyStateCodebase appContext =
115
116
let
116
117
button =
117
- Button . iconThenLabel Find Icon . search " Find Definitions "
118
+ Button . iconThenLabel Find Icon . search " Find Definition "
118
119
|> Button . primaryMono
119
120
|> Button . medium
120
121
in
@@ -168,17 +169,28 @@ view env model =
168
169
viewLoading
169
170
170
171
Success ( Namespace _ _ { readme } ) ->
171
- case readme of
172
- Just r ->
173
- container
174
- [ div [ class " perspective-landing-readme" ]
175
- [ header [] [ Icon . view Icon . doc, text " README" ]
176
- , Readme . view OpenReference ToggleDocFold model r
177
- ]
178
- ]
179
-
180
- Nothing ->
181
- viewEmptyStateNamespace fqn
172
+ let
173
+ content =
174
+ case readme of
175
+ Just r ->
176
+ container
177
+ [ div [ class " perspective-landing-readme" ]
178
+ [ header [ class " title" ] [ Icon . view Icon . doc, text " README" ]
179
+ , Readme . view OpenReference ToggleDocFold model r
180
+ ]
181
+ ]
182
+
183
+ Nothing ->
184
+ viewEmptyStateNamespace fqn
185
+ in
186
+ div []
187
+ [ Button . iconThenLabel Find Icon . search " Find Definition"
188
+ |> Button . small
189
+ |> Button . view
190
+ |> Toolbar . toolbar
191
+ |> Toolbar . view
192
+ , content
193
+ ]
182
194
183
195
Failure error ->
184
196
viewError fqn ( Api . errorToString error)
Original file line number Diff line number Diff line change
1
+ module UI.Toolbar exposing (..)
2
+
3
+ import Html exposing (Html , header )
4
+ import Html.Attributes exposing (class )
5
+
6
+
7
+ type alias Toolbar msg =
8
+ { content : Html msg
9
+ }
10
+
11
+
12
+ toolbar : Html msg -> Toolbar msg
13
+ toolbar =
14
+ Toolbar
15
+
16
+
17
+ view : Toolbar msg -> Html msg
18
+ view { content } =
19
+ header [ class " toolbar" ] [ content ]
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ import Perspective exposing (Perspective)
28
28
import Task
29
29
import UI.Button as Button
30
30
import UI.Icon as Icon
31
+ import UI.Toolbar as Toolbar
31
32
import Workspace.WorkspaceItem as WorkspaceItem exposing (Item , WorkspaceItem )
32
33
import Workspace.WorkspaceItems as WorkspaceItems exposing (WorkspaceItems )
33
34
@@ -499,10 +500,11 @@ view model =
499
500
500
501
WorkspaceItems . WorkspaceItems _ ->
501
502
article [ id " workspace" ]
502
- [ header
503
- [ id " workspace-toolbar" ]
504
- [ Button . iconThenLabel Find Icon . search " Find Definition" |> Button . small |> Button . view
505
- ]
503
+ [ Button . iconThenLabel Find Icon . search " Find Definition"
504
+ |> Button . small
505
+ |> Button . view
506
+ |> Toolbar . toolbar
507
+ |> Toolbar . view
506
508
, section
507
509
[ id " workspace-content" ]
508
510
[ section [ class " definitions-pane" ] ( viewWorkspaceItems model. workspaceItems) ]
Original file line number Diff line number Diff line change 179
179
@import "./elements/fully-qualified-name.css" ;
180
180
@import "./elements/card.css" ;
181
181
@import "./elements/hashvatar.css" ;
182
+ @import "./elements/toolbar.css" ;
Original file line number Diff line number Diff line change
1
+ .toolbar {
2
+ height : var (--toolbar-height );
3
+ padding-left : 2.625rem ;
4
+ padding-right : 1rem ;
5
+ font-size : var (--font-size-medium );
6
+ background : var (--color-main-bg );
7
+ border-bottom : 1px solid var (--color-main-border );
8
+ display : flex;
9
+ flex-direction : row;
10
+ align-items : center;
11
+ }
12
+
13
+ .toolbar .right {
14
+ margin-left : auto;
15
+ }
Original file line number Diff line number Diff line change 6
6
--main-sidebar-collapsed-width : 4.5rem ;
7
7
--main-content-width : 45.5rem ;
8
8
--border-radius-base : 0.25rem ;
9
+ --toolbar-height : 3.5rem ;
9
10
10
11
/* -- Layers ------------------------------------------------------------- */
11
12
--layer-beneath : 0 ;
Original file line number Diff line number Diff line change 146
146
justify-content : flex-end;
147
147
}
148
148
149
- .perspective-landing-readme header {
149
+ .perspective-landing-readme header . title {
150
150
font-size : var (--font-size-medium );
151
151
font-weight : bold;
152
152
height : 1.5rem ;
153
153
line-height : 1 ;
154
154
display : flex;
155
155
flex-direction : row;
156
+ align-items : center;
156
157
}
157
158
158
159
.perspective-landing-readme header .icon {
Original file line number Diff line number Diff line change 6
6
background : var (--color-workspace-bg );
7
7
color : var (--color-workspace-fg );
8
8
9
- --workspace-toolbar-height : 3.5rem ;
10
9
--workspace-content-width : var (--main-content-width );
11
10
}
12
11
13
- # workspace-toolbar {
14
- height : var (--workspace-toolbar-height );
15
- padding-left : 2.625rem ;
16
- padding-right : 1rem ;
17
- font-size : var (--font-size-medium );
18
- background : var (--color-workspace-item-bg );
19
- border-bottom : 1px solid var (--color-workspace-border );
20
- display : flex;
21
- flex-direction : row;
22
- align-items : center;
23
- }
24
-
25
- # workspace-toolbar .right {
26
- margin-left : auto;
27
- }
28
-
29
12
# workspace-content {
30
13
overflow : auto;
31
- height : calc (
32
- calc (100vh - var (--workspace-toolbar-height )) - var (--app-header-height )
33
- );
14
+ height : calc (calc (100vh - var (--toolbar-height )) - var (--app-header-height ));
34
15
padding-top : 2rem ;
35
16
scroll-behavior : smooth;
36
17
scrollbar-width : auto;
You can’t perform that action at this time.
0 commit comments