Files
notesnook/apps/mobile/src/components/NoteItem/index.js

107 lines
2.4 KiB
JavaScript
Raw Normal View History

2019-11-17 16:02:19 +05:00
import React, {useState} from 'react';
import {
View,
Text,
TouchableOpacity,
ScrollView,
Dimensions,
FlatList,
} from 'react-native';
import {
COLOR_SCHEME,
SIZE,
br,
ph,
pv,
opacity,
FONT,
WEIGHT,
} from '../../common/common';
import Icon from 'react-native-vector-icons/Ionicons';
import {Reminder} from '../Reminder';
import {getElevation} from '../../utils/utils';
const w = Dimensions.get('window').width;
const h = Dimensions.get('window').height;
const NoteItem = props => {
const [colors, setColors] = useState(COLOR_SCHEME);
const item = props.item;
return (
<View
activeOpacity={opacity}
style={{
marginHorizontal: w * 0.05,
backgroundColor: '#f0f0f0',
marginVertical: h * 0.015,
borderRadius: br,
2019-11-17 17:48:56 +05:00
2019-11-17 16:02:19 +05:00
justifyContent: 'center',
alignItems: 'center',
padding: pv,
}}>
<View
style={{
2019-11-17 17:48:56 +05:00
width: '100%',
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
2019-11-17 16:02:19 +05:00
}}>
<Text
2019-11-17 17:48:56 +05:00
numberOfLines={1}
2019-11-17 16:02:19 +05:00
style={{
2019-11-17 17:48:56 +05:00
color: colors.pri,
2019-11-17 16:02:19 +05:00
fontSize: SIZE.md,
fontFamily: WEIGHT.bold,
2019-11-17 17:48:56 +05:00
maxWidth: '100%',
2019-11-17 16:02:19 +05:00
}}>
{item.title}
</Text>
2019-11-17 17:48:56 +05:00
<View
style={{
width: '20%',
justifyContent: 'space-between',
flexDirection: 'row',
alignItems: 'center',
}}>
<Icon name="md-share-alt" size={SIZE.lg} color={colors.icon} />
<Icon name="md-star" size={SIZE.lg} color={colors.icon} />
<Icon name="md-more" size={SIZE.lg} color={colors.icon} />
</View>
</View>
<View
style={{
2019-11-23 06:25:22 +05:00
justifyContent: 'flex-start',
2019-11-17 17:48:56 +05:00
alignItems: 'flex-start',
2019-11-23 06:25:22 +05:00
width: '100%',
2019-11-17 17:48:56 +05:00
}}>
2019-11-17 16:02:19 +05:00
<Text
style={{
fontSize: SIZE.xs + 1,
color: colors.icon,
fontFamily: WEIGHT.regular,
2019-11-23 06:25:22 +05:00
width: '100%',
maxWidth: '100%',
2019-11-17 16:02:19 +05:00
}}>
{item.headline}
</Text>
<Text
style={{
color: colors.accent,
fontSize: SIZE.xxs,
textAlignVertical: 'center',
fontFamily: WEIGHT.regular,
}}>
{item.timestamp + ' '}
</Text>
</View>
</View>
);
};
export default NoteItem;