From 1b7fef188ec2aee0706fc1204432315db3d4fec6 Mon Sep 17 00:00:00 2001 From: Shravya Ramesh <37447613+shravyaramesh@users.noreply.github.com> Date: Mon, 19 Oct 2020 12:42:15 -0700 Subject: 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 Co-authored-by: Ashm Walia <40498934+ashmgarv@users.noreply.github.com> --- src/routes/authentication/AuthProvider.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/routes/authentication') 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; recentSearches: Array; + newMomentsAvailable: boolean; + updateMoments: (value: boolean) => void; } const NO_USER: UserType = { userId: '', @@ -43,6 +45,8 @@ export const AuthContext = createContext({ cover: null, instaPosts: [], recentSearches: [], + newMomentsAvailable: true, + updateMoments: () => {}, }); /** @@ -57,6 +61,7 @@ const AuthProvider: React.FC = ({children}) => { const [recentSearches, setRecentSearches] = useState< Array >([]); + const [newMomentsAvailable, setNewMomentsAvailable] = useState(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} -- cgit v1.2.3-70-g09d2