blob: a10d8d6d80d9ff90725675c8dd54d5cd2bcddbcd (
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
|
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,
instagram: instaPosts[i],
social: 'Instagram',
};
posts.push(testPost);
}
return (
<>
{posts.map((post, index) => (
<Post key={index} post={post} />
))}
</>
);
};
export default Feed;
|