From 0fcc4b1c566e4365e07ce5a1c87743db76c07fe6 Mon Sep 17 00:00:00 2001 From: Eugen Rochko <eugen@zeonfederated.com> Date: Tue, 28 Jan 2020 02:20:47 +0100 Subject: [PATCH] Change announcements to be collapsed on page load in web UI (#12990) --- .../features/getting_started/components/announcements.js | 2 +- app/javascript/mastodon/reducers/announcements.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/javascript/mastodon/features/getting_started/components/announcements.js b/app/javascript/mastodon/features/getting_started/components/announcements.js index 1fd28a1199..cf2abdd768 100644 --- a/app/javascript/mastodon/features/getting_started/components/announcements.js +++ b/app/javascript/mastodon/features/getting_started/components/announcements.js @@ -376,7 +376,7 @@ class Announcements extends ImmutablePureComponent { <img className='announcements__mastodon' alt='' draggable='false' src={mascot || elephantUIPlane} /> <div className='announcements__container'> - <ReactSwipeableViews animateHeight index={index} onChangeIndex={this.handleChangeIndex}> + <ReactSwipeableViews animateHeight={!reduceMotion} adjustHeight={reduceMotion} index={index} onChangeIndex={this.handleChangeIndex}> {announcements.map(announcement => ( <Announcement key={announcement.get('id')} diff --git a/app/javascript/mastodon/reducers/announcements.js b/app/javascript/mastodon/reducers/announcements.js index 3215c1c2dc..1653318ce2 100644 --- a/app/javascript/mastodon/reducers/announcements.js +++ b/app/javascript/mastodon/reducers/announcements.js @@ -16,7 +16,7 @@ import { Map as ImmutableMap, List as ImmutableList, Set as ImmutableSet, fromJS const initialState = ImmutableMap({ items: ImmutableList(), isLoading: false, - show: true, + show: false, unread: ImmutableSet(), }); @@ -84,10 +84,11 @@ export default function announcementsReducer(state = initialState, action) { const items = fromJS(action.announcements); map.set('unread', ImmutableSet()); - map.set('items', items); - map.set('isLoading', false); addUnread(map, items); + + map.set('items', items); + map.set('isLoading', false); }); case ANNOUNCEMENTS_FETCH_FAIL: return state.set('isLoading', false);