2020-10-30 17:35:07 +00:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
import { FILTER } from '../filters';
|
|
|
|
import I18n from '../../../i18n';
|
2021-09-13 20:41:05 +00:00
|
|
|
import DropdownItem from './DropdownItem';
|
2020-10-30 17:35:07 +00:00
|
|
|
|
|
|
|
const DropdownItemHeader = ({ currentFilter, onPress }) => {
|
|
|
|
let text;
|
|
|
|
switch (currentFilter) {
|
|
|
|
case FILTER.FOLLOWING:
|
|
|
|
text = I18n.t('Threads_displaying_following');
|
|
|
|
break;
|
|
|
|
case FILTER.UNREAD:
|
|
|
|
text = I18n.t('Threads_displaying_unread');
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
text = I18n.t('Threads_displaying_all');
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return <DropdownItem text={text} iconName='filter' onPress={onPress} />;
|
|
|
|
};
|
|
|
|
|
|
|
|
DropdownItemHeader.propTypes = {
|
|
|
|
currentFilter: PropTypes.string,
|
|
|
|
onPress: PropTypes.func
|
|
|
|
};
|
|
|
|
|
|
|
|
export default DropdownItemHeader;
|