Change announcements to be collapsed on page load in web UI (#12990)

master
Eugen Rochko 4 years ago committed by GitHub
parent c2dfd5e4e2
commit 0fcc4b1c56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/javascript/mastodon/features/getting_started/components/announcements.js
  2. 7
      app/javascript/mastodon/reducers/announcements.js

@ -376,7 +376,7 @@ class Announcements extends ImmutablePureComponent {
<img className='announcements__mastodon' alt='' draggable='false' src={mascot || elephantUIPlane} /> <img className='announcements__mastodon' alt='' draggable='false' src={mascot || elephantUIPlane} />
<div className='announcements__container'> <div className='announcements__container'>
<ReactSwipeableViews animateHeight index={index} onChangeIndex={this.handleChangeIndex}> <ReactSwipeableViews animateHeight={!reduceMotion} adjustHeight={reduceMotion} index={index} onChangeIndex={this.handleChangeIndex}>
{announcements.map(announcement => ( {announcements.map(announcement => (
<Announcement <Announcement
key={announcement.get('id')} key={announcement.get('id')}

@ -16,7 +16,7 @@ import { Map as ImmutableMap, List as ImmutableList, Set as ImmutableSet, fromJS
const initialState = ImmutableMap({ const initialState = ImmutableMap({
items: ImmutableList(), items: ImmutableList(),
isLoading: false, isLoading: false,
show: true, show: false,
unread: ImmutableSet(), unread: ImmutableSet(),
}); });
@ -84,10 +84,11 @@ export default function announcementsReducer(state = initialState, action) {
const items = fromJS(action.announcements); const items = fromJS(action.announcements);
map.set('unread', ImmutableSet()); map.set('unread', ImmutableSet());
map.set('items', items);
map.set('isLoading', false);
addUnread(map, items); addUnread(map, items);
map.set('items', items);
map.set('isLoading', false);
}); });
case ANNOUNCEMENTS_FETCH_FAIL: case ANNOUNCEMENTS_FETCH_FAIL:
return state.set('isLoading', false); return state.set('isLoading', false);

Loading…
Cancel
Save