Skip to content

Commit 872e208

Browse files
committed
Add webhooks empty state
1 parent b8ae0e0 commit 872e208

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

src/UnisonShare/Page/ProjectSettingsPage.elm

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,8 @@ viewCollaborators model =
440440

441441
content =
442442
if List.isEmpty collaborators then
443-
( div [ class "collaborators_empty-state" ]
444-
[ div [ class "collaborators_empty-state_text" ]
443+
( div [ class "list_empty-state" ]
444+
[ div [ class "list_empty-state_text" ]
445445
[ Icon.view Icon.userGroup, text "You haven't invited any collaborators yet" ]
446446
]
447447
, addButton_
@@ -524,7 +524,7 @@ viewWebhook webhook =
524524
div [ class "webhook" ]
525525
[ div
526526
[ class "webhook_details" ]
527-
[ strong [ class "webhook_url" ] [ Icon.view Icon.wireframeGlobe, text (Url.toString webhook.url) ]
527+
[ strong [ class "webhook_url" ] [ Icon.view Icon.chain, text (Url.toString webhook.url) ]
528528
, div [ class "webhook_events" ] viewTopics
529529
]
530530
, div
@@ -548,9 +548,18 @@ viewWebhooks session model =
548548
content =
549549
case model.webhooks of
550550
Success webhooks ->
551-
[ header [ class "project-settings_card_header" ] [ h2 [] [ text "Webhooks" ], addButton ]
552-
, div [ class "webhooks" ] (webhooks |> List.map viewWebhook |> List.intersperse divider)
553-
]
551+
if List.isEmpty webhooks then
552+
[ header [ class "project-settings_card_header" ] [ h2 [] [ text "Webhooks" ], addButton ]
553+
, div [ class "list_empty-state" ]
554+
[ div [ class "list_empty-state_text" ]
555+
[ Icon.view Icon.wireframeGlobe, text "You haven't set up any webhooks yet" ]
556+
]
557+
]
558+
559+
else
560+
[ header [ class "project-settings_card_header" ] [ h2 [] [ text "Webhooks" ], addButton ]
561+
, div [ class "webhooks" ] (webhooks |> List.map viewWebhook |> List.intersperse divider)
562+
]
554563

555564
Failure e ->
556565
[ StatusBanner.bad "An unexpected error occurred, please try again."

src/css/unison-share/page/project-settings-page.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@
6262
color: var(--u-color_text_subdued);
6363
}
6464

65-
.project-settings-page .collaborators_empty-state {
65+
.project-settings-page .list_empty-state {
6666
display: flex;
6767
flex-direction: column;
6868
gap: 1rem;
6969
}
7070

71-
.project-settings-page .collaborators_empty-state_text {
71+
.project-settings-page .list_empty-state_text {
7272
color: var(--u-color_text_subdued);
7373
display: flex;
7474
flex-direction: row;
@@ -77,7 +77,7 @@
7777
font-size: var(--font-size-base);
7878
}
7979

80-
.project-settings-page .collaborators_empty-state_text .icon {
80+
.project-settings-page .list_empty-state_text .icon {
8181
font-size: var(--font-size-base);
8282
color: var(--u-color_icon_subdued);
8383
}

0 commit comments

Comments
 (0)