Rocket.Chat.ReactNative/app/views/RoomsListView/ListHeader/Directory.js

45 lines
1.3 KiB
JavaScript
Raw Normal View History

import React from 'react';
2019-12-04 16:39:53 +00:00
import { View, Text, StyleSheet } from 'react-native';
import PropTypes from 'prop-types';
2019-12-04 16:39:53 +00:00
import Touch from '../../../utils/touch';
import { CustomIcon } from '../../../lib/Icons';
import I18n from '../../../i18n';
import styles from '../styles';
import DisclosureIndicator from '../../../containers/DisclosureIndicator';
2019-12-04 16:39:53 +00:00
import { themes } from '../../../constants/colors';
import { withTheme } from '../../../theme';
2020-02-13 19:24:39 +00:00
const Directory = React.memo(({ goDirectory, theme, searching }) => {
if (searching > 0) {
return null;
}
2019-12-04 16:39:53 +00:00
const color = { color: themes[theme].headerSecondaryText };
return (
<Touch
onPress={goDirectory}
theme={theme}
style={{ backgroundColor: themes[theme].headerSecondaryBackground }}
>
<View
style={[
styles.dropdownContainerHeader,
{ borderBottomWidth: StyleSheet.hairlineWidth, borderColor: themes[theme].separatorColor }
]}
>
<CustomIcon style={[styles.directoryIcon, color]} size={22} name='directory' />
2019-12-04 16:39:53 +00:00
<Text style={[styles.directoryText, color]}>{I18n.t('Directory')}</Text>
<DisclosureIndicator theme={theme} />
</View>
</Touch>
);
});
Directory.propTypes = {
2020-02-13 19:24:39 +00:00
searching: PropTypes.bool,
2019-12-04 16:39:53 +00:00
goDirectory: PropTypes.func,
theme: PropTypes.string
};
2019-12-04 16:39:53 +00:00
export default withTheme(Directory);