mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-12-20 20:27:07 +00:00
[Glitch] Change announcements to be collapsed on page load in web UI
Port 0fcc4b1c56
to glitch-soc
Signed-off-by: Thibaut Girka <thib@sitedethib.com>
This commit is contained in:
parent
44744e3ce1
commit
ed5fb51168
|
@ -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')}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue