aboutsummaryrefslogtreecommitdiff
path: root/src/components/profile/Feed.tsx
blob: 3353d25b6d628b198417abd62d083f0a33d6893b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import React from 'react';
import {PostType, UserType} from '../../types';
import {Post} from '../common';
import {AuthContext} from '../../routes/authentication';

interface FeedProps {
  user: UserType;
}
const Feed: React.FC<FeedProps> = ({user}) => {
  const {instaPosts} = React.useContext(AuthContext);
  const posts: Array<PostType> = [];
  for (let i = 0; i < 10; i++) {
    const testPost: PostType = {
      owner: user,
      social: 'Instagram',
      socialHandle: 'igHandle',
      data: instaPosts[i],
    };
    posts.push(testPost);
  }
  return (
    <>
      {posts.map((post, index) => (
        <Post key={index} post={post} />
      ))}
    </>
  );
};

export default Feed;