diff options
author | Shravya Ramesh <37447613+shravyaramesh@users.noreply.github.com> | 2020-10-19 12:42:15 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-19 15:42:15 -0400 |
commit | 1b7fef188ec2aee0706fc1204432315db3d4fec6 (patch) | |
tree | 0f07d060f9f0f7343442f968d1a4be9b1ceff03f /src/routes/authentication/AuthProvider.tsx | |
parent | f5853b77ef9506df056029282c475e5628fb6ab0 (diff) |
Tma235/231 Individual view and horizontal view (#59)
* Implemented modal stack navigation for moment view, created a rough UI for individual moment view [incl: title, image(not displayed)]
* bare bones beginnning
* Created individual moment screen, moment tile for horizontal view
* Alert
* Fix initial route
Co-authored-by: Ashm Walia <ashmwalia@outlook.com>
Co-authored-by: Ashm Walia <40498934+ashmgarv@users.noreply.github.com>
Diffstat (limited to 'src/routes/authentication/AuthProvider.tsx')
-rw-r--r-- | src/routes/authentication/AuthProvider.tsx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/routes/authentication/AuthProvider.tsx b/src/routes/authentication/AuthProvider.tsx index 6f577a73..8dd9fd73 100644 --- a/src/routes/authentication/AuthProvider.tsx +++ b/src/routes/authentication/AuthProvider.tsx @@ -24,6 +24,8 @@ interface AuthContextProps { cover: string | null; instaPosts: Array<InstagramPostType>; recentSearches: Array<ProfilePreviewType>; + newMomentsAvailable: boolean; + updateMoments: (value: boolean) => void; } const NO_USER: UserType = { userId: '', @@ -43,6 +45,8 @@ export const AuthContext = createContext<AuthContextProps>({ cover: null, instaPosts: [], recentSearches: [], + newMomentsAvailable: true, + updateMoments: () => {}, }); /** @@ -57,6 +61,7 @@ const AuthProvider: React.FC = ({children}) => { const [recentSearches, setRecentSearches] = useState< Array<ProfilePreviewType> >([]); + const [newMomentsAvailable, setNewMomentsAvailable] = useState<boolean>(true); const {userId} = user; useEffect(() => { if (!userId) { @@ -90,6 +95,7 @@ const AuthProvider: React.FC = ({children}) => { avatar, cover, instaPosts, + newMomentsAvailable, login: (id, username) => { setUser({...user, userId: id, username}); }, @@ -105,6 +111,9 @@ const AuthProvider: React.FC = ({children}) => { } }, recentSearches, + updateMoments: (value) => { + setNewMomentsAvailable(value); + }, }}> {children} </AuthContext.Provider> |