* Add recently used section and section icons * Improve section scrolling indication * Modify Makefile and use onMomentumScrollEnd * Make sure top section maintains highlight when scrolled to top * Sort emojis by startsWith then includes when filtering
23 lines
No EOL
569 B
JavaScript
23 lines
No EOL
569 B
JavaScript
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
|
// See License.txt for license information.
|
|
|
|
import {ViewTypes} from 'app/constants';
|
|
|
|
export default function recentEmojis(state = [], action) {
|
|
switch (action.type) {
|
|
case ViewTypes.ADD_RECENT_EMOJI: {
|
|
const nextState = [...state];
|
|
|
|
const index = nextState.indexOf(action.emoji);
|
|
if (index !== -1) {
|
|
nextState.splice(index, 1);
|
|
}
|
|
|
|
nextState.unshift(action.emoji);
|
|
|
|
return nextState;
|
|
}
|
|
default:
|
|
return state;
|
|
}
|
|
} |