diff options
author | Justin Shillingford <jgs272@cornell.edu> | 2020-08-14 16:39:26 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-14 16:39:26 -0400 |
commit | 59ea758ba64dd4e00f12b5ceb941d0ea5e273210 (patch) | |
tree | 6a698457be38c484bb9f93e3caf2f8e32bb7be8d /src/components/profile/Feed.tsx | |
parent | 1979a2b55ebe560b9d20862bd835343516b40379 (diff) |
[TMA-19] Social Media Post Container (#31)
* Basic mostly functional implementation
Need to figure out why API is being called so much
* Hey it works now! Without a million API calls!
* Fixed bug where app would crash upon login
Also updated property names to be more appropriate
* Added post datetime and social icon
* Updated error message
* Fixed typecheck errors
I don't know that these fixes are the best since I don't think they're generalizable
* Formatted datetime in PostHeader
Diffstat (limited to 'src/components/profile/Feed.tsx')
-rw-r--r-- | src/components/profile/Feed.tsx | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/components/profile/Feed.tsx b/src/components/profile/Feed.tsx index 6780f8c5..a10d8d6d 100644 --- a/src/components/profile/Feed.tsx +++ b/src/components/profile/Feed.tsx @@ -1,17 +1,21 @@ 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> = []; - const dummyPost: PostType = { - owner: user, - }; - for (let i = 0; i < 20; i++) { - posts.push(dummyPost); + for (let i = 0; i < 10; i++) { + const testPost: PostType = { + owner: user, + instagram: instaPosts[i], + social: 'Instagram', + }; + posts.push(testPost); } return ( <> |