From 59ea758ba64dd4e00f12b5ceb941d0ea5e273210 Mon Sep 17 00:00:00 2001 From: Justin Shillingford Date: Fri, 14 Aug 2020 16:39:26 -0400 Subject: [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 --- src/components/profile/Feed.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/components/profile') 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 = ({user}) => { + const {instaPosts} = React.useContext(AuthContext); const posts: Array = []; - 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 ( <> -- cgit v1.2.3-70-g09d2