Created
March 30, 2020 16:22
-
-
Save ibonkonesa/598dc8cba6676cf6bbbbd7c049815b98 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { AuthCheck, useUser, useFirestore, useFirestoreCollection} from 'reactfire'; | |
import { Heading } from '@chakra-ui/core'; | |
import { Container, MainLayout, NeedSignInAlert } from '../../components'; | |
const MyRequests = () => { | |
const user = useUser(); | |
const requestsRef = useFirestore().collection('material-requests').where('userId', '==',user.uid); | |
const requests = useFirestoreCollection(requestsRef); | |
const collection = []; | |
requests.forEach(data => { | |
collection.push(data.data()); | |
}); | |
return ( | |
<MainLayout> | |
<Container> | |
<Heading as="h1" size="lg" fontSize={['24px', '32px']} mb={2}> | |
TEXT | |
</Heading> | |
<Heading | |
as="h2" | |
size="lg" | |
mb={[4, 6]} | |
fontSize={['18px', '24px']} | |
color="gray.500" | |
> | |
</Heading> | |
<AuthCheck | |
fallback={ | |
<NeedSignInAlert title="Identifícate para solicitar material" /> | |
} | |
> | |
</AuthCheck> | |
</Container> | |
</MainLayout> | |
); | |
}; | |
export default MyRequests; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment