1
0
Fork 0

NotificationFilter type.

This commit is contained in:
Nicolas Perriault 2017-04-30 11:46:51 +02:00
parent dbb32037b7
commit 3530f3c79d
No known key found for this signature in database
GPG Key ID: DA5E4C83904F7A2A
3 changed files with 13 additions and 3 deletions

View File

@ -60,6 +60,7 @@ init flags location =
, viewer = Nothing , viewer = Nothing
, currentView = LocalTimelineView , currentView = LocalTimelineView
, currentUser = Nothing , currentUser = Nothing
, notificationFilter = NotificationAll
} }
! [ Command.initCommands flags.registration flags.client authCode ] ! [ Command.initCommands flags.registration flags.client authCode ]

View File

@ -111,6 +111,14 @@ type alias Draft =
} }
type NotificationFilter
= NotificationAll
| NotificationOnlyMentions
| NotificationOnlyBoosts
| NotificationOnlyFavourites
| NotificationOnlyFollows
type ScrollDirection type ScrollDirection
= ScrollTop = ScrollTop
| ScrollBottom | ScrollBottom
@ -148,4 +156,5 @@ type alias Model =
, viewer : Maybe Viewer , viewer : Maybe Viewer
, currentUser : Maybe Account , currentUser : Maybe Account
, currentView : CurrentView , currentView : CurrentView
, notificationFilter : NotificationFilter
} }

View File

@ -500,8 +500,8 @@ notificationEntryView currentUser notification =
] ]
notificationListView : CurrentUser -> List NotificationAggregate -> Html Msg notificationListView : CurrentUser -> NotificationFilter -> List NotificationAggregate -> Html Msg
notificationListView currentUser notifications = notificationListView currentUser filter notifications =
div [ class "col-md-3 column" ] div [ class "col-md-3 column" ]
[ div [ class "panel panel-default notifications-panel" ] [ div [ class "panel panel-default notifications-panel" ]
[ a [ a
@ -764,7 +764,7 @@ homepageView model =
"home" "home"
currentUser currentUser
model.userTimeline model.userTimeline
, notificationListView currentUser model.notifications , notificationListView currentUser model.notificationFilter model.notifications
, case model.currentView of , case model.currentView of
LocalTimelineView -> LocalTimelineView ->
timelineView timelineView