diff options
author | Ivan Chen <ivan@thetaggid.com> | 2020-10-07 20:17:13 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-07 20:17:13 -0400 |
commit | 0f332655d2b64700623f25912d2610517fb954b6 (patch) | |
tree | bf0f4b6fb1f5f226dea4a6ee9d312d28a258bda4 /src/components/taggs/TaggPost.tsx | |
parent | e86478f52e191c52fea20980278174af46f50953 (diff) |
[TMA-186] Instagram Taggs - Frontend (#45)
* Renamed Moments(Bar) to Taggs(Bar)
* created initial navigation and empty social media taggs screen
* made more progress for the header styling
* Finished social media taggs screen, organized code structure
* linted stuff D:
* moved bar height utility function to utils
* moved color constants to constants
* moved avatar title
* updated comments for social media taggs
* NOW the file is there
Diffstat (limited to 'src/components/taggs/TaggPost.tsx')
-rw-r--r-- | src/components/taggs/TaggPost.tsx | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/components/taggs/TaggPost.tsx b/src/components/taggs/TaggPost.tsx new file mode 100644 index 00000000..73f15268 --- /dev/null +++ b/src/components/taggs/TaggPost.tsx @@ -0,0 +1,39 @@ +import moment from 'moment'; +import React from 'react'; +import {Image, StyleSheet, View} from 'react-native'; +import {PostType} from '../../types'; +import {SCREEN_WIDTH} from '../../utils'; +import TaggPostFooter from './TaggPostFooter'; + +interface TaggPostProps { + post: PostType; +} +const TaggPost: React.FC<TaggPostProps> = ({post: {socialHandle, data}}) => { + const parsedDate = moment(data?.timestamp || ''); + const date = parsedDate.isValid() ? parsedDate.format('MMM d') : ''; + + return ( + <> + <View style={styles.image}> + {data && <Image style={styles.image} source={{uri: data.media_url}} />} + </View> + <TaggPostFooter + // we currently don't have a way to retreive num of likes information + likes={109} + handle={socialHandle} + caption={data?.caption || ''} + date={date} + /> + </> + ); +}; + +const styles = StyleSheet.create({ + image: { + width: SCREEN_WIDTH, + height: SCREEN_WIDTH, + backgroundColor: '#eee', + }, +}); + +export default TaggPost; |