2019-06-10 16:22:35 +00:00
|
|
|
import React from 'react';
|
2019-12-04 16:39:53 +00:00
|
|
|
import { View, Text, StyleSheet } from 'react-native';
|
2019-06-10 16:22:35 +00:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
2019-12-04 16:39:53 +00:00
|
|
|
import Touch from '../../../utils/touch';
|
2019-06-10 16:22:35 +00:00
|
|
|
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';
|
2019-06-10 16:22:35 +00:00
|
|
|
|
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='discover' />
|
|
|
|
<Text style={[styles.directoryText, color]}>{I18n.t('Directory')}</Text>
|
|
|
|
<DisclosureIndicator theme={theme} />
|
|
|
|
</View>
|
|
|
|
</Touch>
|
|
|
|
);
|
|
|
|
});
|
2019-06-10 16:22:35 +00:00
|
|
|
|
|
|
|
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-06-10 16:22:35 +00:00
|
|
|
};
|
|
|
|
|
2019-12-04 16:39:53 +00:00
|
|
|
export default withTheme(Directory);
|