aboutsummaryrefslogtreecommitdiff
path: root/src/components/common/post
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/common/post')
-rw-r--r--src/components/common/post/Post.tsx28
-rw-r--r--src/components/common/post/PostHeader.tsx78
-rw-r--r--src/components/common/post/index.ts1
3 files changed, 0 insertions, 107 deletions
diff --git a/src/components/common/post/Post.tsx b/src/components/common/post/Post.tsx
deleted file mode 100644
index 9fa167f2..00000000
--- a/src/components/common/post/Post.tsx
+++ /dev/null
@@ -1,28 +0,0 @@
-import React from 'react';
-import {StyleSheet, View, Image} from 'react-native';
-import {PostType} from '../../../types';
-import PostHeader from './PostHeader';
-import {SCREEN_WIDTH} from '../../../utils';
-
-interface PostProps {
- post: PostType;
-}
-const Post: React.FC<PostProps> = ({post: {owner, social, data}}) => {
- return (
- <>
- <PostHeader post={data} owner={owner} social={social} />
- <View style={styles.image}>
- {data && <Image style={styles.image} source={{uri: data.media_url}} />}
- </View>
- </>
- );
-};
-
-const styles = StyleSheet.create({
- image: {
- width: SCREEN_WIDTH,
- height: SCREEN_WIDTH,
- backgroundColor: '#eee',
- },
-});
-export default Post;
diff --git a/src/components/common/post/PostHeader.tsx b/src/components/common/post/PostHeader.tsx
deleted file mode 100644
index 0e9c708b..00000000
--- a/src/components/common/post/PostHeader.tsx
+++ /dev/null
@@ -1,78 +0,0 @@
-import React from 'react';
-import {UserType, InstagramPostType} from '../../../types';
-import {View, StyleSheet, Image, Text} from 'react-native';
-import {AuthContext} from '../../../routes/authentication';
-import SocialIcon from '../SocialIcon';
-import moment from 'moment';
-
-const AVATAR_DIM = 35;
-interface PostHeaderProps {
- owner: UserType;
- post: InstagramPostType | undefined;
- social: string;
-}
-const PostHeader: React.FC<PostHeaderProps> = ({
- owner: {username},
- post,
- social,
-}) => {
- const {avatar} = React.useContext(AuthContext);
-
- return (
- <View style={styles.container}>
- <View style={styles.topRow}>
- <Image
- style={styles.avatar}
- source={
- avatar
- ? {uri: avatar}
- : require('../../../assets/images/avatar-placeholder.png')
- }
- />
- <Text style={styles.username}>{username}</Text>
- {post && <SocialIcon style={styles.icon} social={social} />}
- </View>
- {post && (
- <Text style={styles.timestamp}>
- {moment(post.timestamp).format('LL')} at{' '}
- {moment(post.timestamp).format('LT')}
- </Text>
- )}
- </View>
- );
-};
-
-const styles = StyleSheet.create({
- container: {
- flexDirection: 'column',
- justifyContent: 'space-between',
- padding: 10,
- backgroundColor: 'white',
- },
- topRow: {
- flexDirection: 'row',
- alignItems: 'center',
- },
- avatar: {
- width: AVATAR_DIM,
- height: AVATAR_DIM,
- borderRadius: AVATAR_DIM / 2,
- marginRight: 10,
- },
- icon: {
- width: AVATAR_DIM,
- height: AVATAR_DIM,
- borderRadius: AVATAR_DIM / 2,
- marginLeft: '55%',
- },
- username: {
- fontSize: 18,
- },
- timestamp: {
- color: '#6A757D',
- fontSize: 11,
- marginLeft: AVATAR_DIM + 10,
- },
-});
-
-export default PostHeader;
diff --git a/src/components/common/post/index.ts b/src/components/common/post/index.ts
deleted file mode 100644
index 358a59d5..00000000
--- a/src/components/common/post/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export {default as Post} from './Post';