2020-10-30 13:59:44 +00:00
|
|
|
import React from 'react';
|
2021-10-01 18:12:19 +00:00
|
|
|
import { StyleSheet, Text, View } from 'react-native';
|
2020-10-30 13:59:44 +00:00
|
|
|
|
|
|
|
import sharedStyles from '../../views/Styles';
|
2022-04-28 18:44:40 +00:00
|
|
|
import { themes } from '../../lib/constants';
|
2022-03-29 18:53:27 +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: {
|
2022-09-23 20:24:37 +00:00
|
|
|
paddingTop: 8,
|
2020-10-30 13:59:44 +00:00
|
|
|
paddingHorizontal: PADDING_HORIZONTAL
|
|
|
|
},
|
|
|
|
text: {
|
|
|
|
fontSize: 14,
|
|
|
|
...sharedStyles.textRegular
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2022-03-29 18:53:27 +00:00
|
|
|
interface IListInfo {
|
2021-10-01 18:12:19 +00:00
|
|
|
info: string;
|
2022-01-24 20:12:25 +00:00
|
|
|
translateInfo?: boolean;
|
2021-10-01 18:12:19 +00:00
|
|
|
}
|
|
|
|
|
2022-03-29 18:53:27 +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-29 18:53:27 +00:00
|
|
|
export default ListInfo;
|