From 3530f3c79d6f42506b31a1a64a1aad96aa6e0f9d Mon Sep 17 00:00:00 2001 From: Nicolas Perriault Date: Sun, 30 Apr 2017 11:46:51 +0200 Subject: [PATCH] NotificationFilter type. --- src/Model.elm | 1 + src/Types.elm | 9 +++++++++ src/View.elm | 6 +++--- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Model.elm b/src/Model.elm index 6834f83..438239c 100644 --- a/src/Model.elm +++ b/src/Model.elm @@ -60,6 +60,7 @@ init flags location = , viewer = Nothing , currentView = LocalTimelineView , currentUser = Nothing + , notificationFilter = NotificationAll } ! [ Command.initCommands flags.registration flags.client authCode ] diff --git a/src/Types.elm b/src/Types.elm index 7ce9882..fdc3e14 100644 --- a/src/Types.elm +++ b/src/Types.elm @@ -111,6 +111,14 @@ type alias Draft = } +type NotificationFilter + = NotificationAll + | NotificationOnlyMentions + | NotificationOnlyBoosts + | NotificationOnlyFavourites + | NotificationOnlyFollows + + type ScrollDirection = ScrollTop | ScrollBottom @@ -148,4 +156,5 @@ type alias Model = , viewer : Maybe Viewer , currentUser : Maybe Account , currentView : CurrentView + , notificationFilter : NotificationFilter } diff --git a/src/View.elm b/src/View.elm index adbc1f1..382b62e 100644 --- a/src/View.elm +++ b/src/View.elm @@ -500,8 +500,8 @@ notificationEntryView currentUser notification = ] -notificationListView : CurrentUser -> List NotificationAggregate -> Html Msg -notificationListView currentUser notifications = +notificationListView : CurrentUser -> NotificationFilter -> List NotificationAggregate -> Html Msg +notificationListView currentUser filter notifications = div [ class "col-md-3 column" ] [ div [ class "panel panel-default notifications-panel" ] [ a @@ -764,7 +764,7 @@ homepageView model = "home" currentUser model.userTimeline - , notificationListView currentUser model.notifications + , notificationListView currentUser model.notificationFilter model.notifications , case model.currentView of LocalTimelineView -> timelineView