updated AlertBanner to use errorCodes file
This commit is contained in:
parent
55047a4313
commit
2c705cd665
|
@ -1,22 +1,19 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Alert } from 'react-bootstrap';
|
import { Alert } from 'react-bootstrap';
|
||||||
import {
|
|
||||||
ERR_STORAGE_LIMIT_EXCEEDED,
|
|
||||||
ERR_NO_ACTIVE_SUBSRICTION,
|
|
||||||
} from 'services/uploadService';
|
|
||||||
import constants from 'utils/strings/constants';
|
import constants from 'utils/strings/constants';
|
||||||
import { ERR_NO_INTERNET_CONNECTION } from './CreateCollection';
|
import errorCodes from 'utils/common/errorCodes';
|
||||||
|
|
||||||
export default function AlertBanner({ bannerErrorCode }) {
|
export default function AlertBanner({ bannerErrorCode }) {
|
||||||
let errorMessage;
|
let errorMessage;
|
||||||
switch (bannerErrorCode) {
|
switch (bannerErrorCode) {
|
||||||
case ERR_NO_ACTIVE_SUBSRICTION:
|
case errorCodes.ERR_NO_ACTIVE_SUBSRICTION:
|
||||||
errorMessage = constants.SUBSCRIPTION_EXPIRED;
|
errorMessage = constants.SUBSCRIPTION_EXPIRED;
|
||||||
break;
|
break;
|
||||||
case ERR_STORAGE_LIMIT_EXCEEDED:
|
case errorCodes.ERR_STORAGE_LIMIT_EXCEEDED:
|
||||||
errorMessage = constants.STORAGE_QUOTA_EXCEEDED;
|
errorMessage = constants.STORAGE_QUOTA_EXCEEDED;
|
||||||
break;
|
break;
|
||||||
case ERR_NO_INTERNET_CONNECTION:
|
case errorCodes.ERR_NO_INTERNET_CONNECTION:
|
||||||
errorMessage = constants.NO_INTERNET_CONNECTION;
|
errorMessage = constants.NO_INTERNET_CONNECTION;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue