added new state errorCode and added errorAlert component to gallery

This commit is contained in:
Abhinav-grd 2021-02-02 18:09:36 +05:30
parent 50dc915401
commit ee663bc72c

View file

@ -21,6 +21,7 @@ import SadFace from 'components/SadFace';
import Upload from './components/Upload';
import { collection, fetchCollections, collectionLatestFile, getCollectionLatestFile, getFavItemIds } from 'services/collectionService';
import constants from 'utils/strings/constants';
import { ErrorAlert } from './components/ErrorAlert';
enum ITEM_TYPE {
TIME = 'TIME',
@ -105,7 +106,7 @@ export default function Gallery(props) {
maxSpreadZoom: 5,
});
const fetching: { [k: number]: boolean } = {};
const [errorCode, setErrorCode] = useState<number>(null);
useEffect(() => {
@ -285,6 +286,7 @@ export default function Gallery(props) {
return (
<>
<ErrorAlert errorCode={errorCode} />
<Collections
collections={collections}
selected={router.query.collection?.toString()}
@ -296,7 +298,8 @@ export default function Gallery(props) {
showUploadModal={props.showUploadModal}
collectionLatestFile={collectionLatestFile}
refetchData={() => setReload(Math.random())}
setErrorCode={setErrorCode}
/>
{filteredData.length ? (
<Container>