diff options
author | Ashm Walia <40498934+ashmgarv@users.noreply.github.com> | 2020-10-19 17:14:37 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-19 20:14:37 -0400 |
commit | 88fb33d1fe1cd0785e4a92cb3c20d0fafb2da54d (patch) | |
tree | b2e8d474b2c0b02f4e91cd33fa0d5f9842d3a018 /src/routes/viewProfile/ProfileProvider.tsx | |
parent | 1b7fef188ec2aee0706fc1204432315db3d4fec6 (diff) |
Merged changes to make sure moments view and search work (#62)
Diffstat (limited to 'src/routes/viewProfile/ProfileProvider.tsx')
-rw-r--r-- | src/routes/viewProfile/ProfileProvider.tsx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/routes/viewProfile/ProfileProvider.tsx b/src/routes/viewProfile/ProfileProvider.tsx index 1af7917d..8fb9a011 100644 --- a/src/routes/viewProfile/ProfileProvider.tsx +++ b/src/routes/viewProfile/ProfileProvider.tsx @@ -8,7 +8,6 @@ import { loadAvatar, loadCover, loadInstaPosts, - loadRecentlySearchedUsers, } from '../../services'; interface ProfileContextProps { @@ -18,6 +17,8 @@ interface ProfileContextProps { avatar: string | null; cover: string | null; instaPosts: Array<InstagramPostType>; + newMomentsAvailable: boolean; + updateMoments: (value: boolean) => void; } const NO_USER: UserType = { userId: '', @@ -35,6 +36,8 @@ export const ProfileContext = createContext<ProfileContextProps>({ avatar: null, cover: null, instaPosts: [], + newMomentsAvailable: true, + updateMoments: () => {}, }); /** @@ -46,6 +49,7 @@ const ProfileProvider: React.FC = ({children}) => { const [avatar, setAvatar] = useState<string | null>(null); const [cover, setCover] = useState<string | null>(null); const [instaPosts, setInstaPosts] = useState<Array<InstagramPostType>>([]); + const [newMomentsAvailable, setNewMomentsAvailable] = useState<boolean>(true); const {userId} = user; useEffect(() => { @@ -79,9 +83,13 @@ const ProfileProvider: React.FC = ({children}) => { avatar, cover, instaPosts, + newMomentsAvailable, loadProfile: (id, username) => { setUser({...user, userId: id, username}); }, + updateMoments: (value) => { + setNewMomentsAvailable(value); + }, }}> {children} </ProfileContext.Provider> |