2020-10-30 13:59:44 +00:00
|
|
|
import React from 'react';
|
2021-09-13 20:41:05 +00:00
|
|
|
import { StyleSheet, Text, View } from 'react-native';
|
2020-10-30 13:59:44 +00:00
|
|
|
|
|
|
|
import sharedStyles from '../../views/Styles';
|
|
|
|
import { themes } from '../../constants/colors';
|
2022-03-17 19:25:31 +00:00
|
|
|
import { useTheme } from '../../theme';
|
2020-10-30 13:59:44 +00:00
|
|
|
import { PADDING_HORIZONTAL } from './constants';
|
|
|
|
import I18n from '../../i18n';
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
container: {
|
|
|
|
paddingTop: 8,
|
|
|
|
paddingHorizontal: PADDING_HORIZONTAL
|
|
|
|
},
|
|
|
|
text: {
|
|
|
|
fontSize: 14,
|
|
|
|
...sharedStyles.textRegular
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2022-03-17 19:25:31 +00:00
|
|
|
interface IListInfo {
|
2021-09-13 20:41:05 +00:00
|
|
|
info: string;
|
2022-01-17 16:10:39 +00:00
|
|
|
translateInfo?: boolean;
|
2021-09-13 20:41:05 +00:00
|
|
|
}
|
|
|
|
|
2022-03-17 19:25:31 +00:00
|
|
|
const ListInfo = React.memo(({ info, translateInfo = true }: IListInfo) => {
|
|
|
|
const { theme } = useTheme();
|
|
|
|
return (
|
|
|
|
<View style={styles.container}>
|
|
|
|
<Text style={[styles.text, { color: themes[theme].infoText }]}>{translateInfo ? I18n.t(info) : info}</Text>
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
});
|
2020-10-30 13:59:44 +00:00
|
|
|
|
|
|
|
ListInfo.displayName = 'List.Info';
|
|
|
|
|
2022-03-17 19:25:31 +00:00
|
|
|
export default ListInfo;
|