2022-01-14 17:38:08 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { StyleSheet, Text, View, ViewStyle } from 'react-native';
|
|
|
|
|
2022-01-17 14:18:32 +00:00
|
|
|
import { TThreadModel } from '../../definitions/IThread';
|
2022-01-14 17:38:08 +00:00
|
|
|
import { CustomIcon } from '../../lib/Icons';
|
|
|
|
import { themes } from '../../constants/colors';
|
|
|
|
import sharedStyles from '../Styles';
|
|
|
|
import { useTheme } from '../../theme';
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
container: {
|
|
|
|
flex: 1,
|
|
|
|
flexDirection: 'row',
|
|
|
|
alignItems: 'center'
|
|
|
|
},
|
|
|
|
detailsContainer: {
|
|
|
|
flex: 1,
|
|
|
|
flexDirection: 'row'
|
|
|
|
},
|
|
|
|
detailContainer: {
|
|
|
|
flexDirection: 'row',
|
|
|
|
alignItems: 'center',
|
|
|
|
marginRight: 8
|
|
|
|
},
|
|
|
|
detailText: {
|
|
|
|
fontSize: 10,
|
|
|
|
marginLeft: 2,
|
|
|
|
...sharedStyles.textSemibold
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
interface IDiscussionDetails {
|
2022-01-17 14:18:32 +00:00
|
|
|
item: TThreadModel;
|
2022-01-14 17:38:08 +00:00
|
|
|
user: {
|
|
|
|
id: string;
|
|
|
|
};
|
2022-01-24 15:51:31 +00:00
|
|
|
date: string;
|
2022-01-14 17:38:08 +00:00
|
|
|
style: ViewStyle;
|
|
|
|
}
|
|
|
|
|
2022-01-24 15:51:31 +00:00
|
|
|
const DiscussionDetails = ({ item, date, style }: IDiscussionDetails) => {
|
2022-01-14 17:38:08 +00:00
|
|
|
const { theme } = useTheme();
|
|
|
|
let { dcount } = item;
|
|
|
|
|
2022-01-17 14:18:32 +00:00
|
|
|
if (dcount! >= 1000) {
|
2022-01-14 17:38:08 +00:00
|
|
|
dcount = '+999';
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<View style={[styles.container, style]}>
|
|
|
|
<View style={styles.detailsContainer}>
|
|
|
|
<View style={styles.detailContainer}>
|
|
|
|
<CustomIcon name={'discussions'} size={24} color={themes[theme!].auxiliaryText} />
|
|
|
|
<Text style={[styles.detailText, { color: themes[theme!].auxiliaryText }]} numberOfLines={1}>
|
|
|
|
{dcount}
|
|
|
|
</Text>
|
|
|
|
</View>
|
|
|
|
|
|
|
|
<View style={styles.detailContainer}>
|
|
|
|
<CustomIcon name={'clock'} size={24} color={themes[theme!].auxiliaryText} />
|
|
|
|
<Text style={[styles.detailText, { color: themes[theme!].auxiliaryText }]} numberOfLines={1}>
|
2022-01-24 15:51:31 +00:00
|
|
|
{date}
|
2022-01-14 17:38:08 +00:00
|
|
|
</Text>
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default DiscussionDetails;
|