@devtron-labs/devtron-fe-common-lib 0.0.7-beta-2 → 0.0.7-beta-3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
@@ -0,0 +1,18 @@
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ import './emptyState.scss';
3
+ interface GenericEmptyStateType {
4
+ title: ReactNode;
5
+ image?: any;
6
+ classname?: string;
7
+ subTitle?: ReactNode;
8
+ isButtonAvailable?: boolean;
9
+ styles?: CSSProperties;
10
+ heightToDeduct?: number;
11
+ imageType?: string;
12
+ renderButton?: () => JSX.Element;
13
+ imageClassName?: string;
14
+ children?: ReactNode;
15
+ noImage?: boolean;
16
+ }
17
+ declare function GenericEmptyState({ title, image, subTitle, isButtonAvailable, classname, styles, heightToDeduct, imageType, renderButton, imageClassName, children, noImage }: GenericEmptyStateType): JSX.Element;
18
+ export default GenericEmptyState;
@@ -12,7 +12,6 @@ export declare class ErrorScreenManager extends Component<{
12
12
  export declare class ErrorScreenNotAuthorized extends Component<{
13
13
  subtitle?: React.ReactChild;
14
14
  title?: string;
15
- subtitleClass?: string;
16
15
  }> {
17
16
  render(): JSX.Element;
18
17
  }
@@ -25,3 +25,4 @@ export { default as InfoColourBar } from './InfoColorBar/InfoColourbar';
25
25
  export * from './Common.service';
26
26
  export * from './Checkbox';
27
27
  export { default as EmptyState } from './EmptyState/EmptyState';
28
+ export { default as GenericEmptyState } from './EmptyState/GenericEmptyState';
package/dist/index.js CHANGED
@@ -467,7 +467,7 @@ function styleInject(css, ref) {
467
467
  }
468
468
  }
469
469
 
470
- var css_248z$3 = ".empty-state {\n height: 100%;\n}\n.empty-state img {\n height: 40%;\n max-height: 200px;\n width: auto;\n max-width: 250px;\n}\n.empty-state svg {\n height: 40%;\n max-height: 200px;\n width: auto;\n}\n.empty-state h1,\n.empty-state h2,\n.empty-state h3,\n.empty-state h4,\n.empty-state h5,\n.empty-state h6 {\n color: var(--N900);\n}\n.empty-state .title {\n font-weight: 600;\n}\n.empty-state .subtitle {\n font-size: 13px;\n width: 250px;\n font-weight: 400;\n text-align: center;\n line-height: 1.5;\n margin-bottom: 20px;\n}\n.empty-state .cta {\n height: 36px;\n}\n.empty-state p {\n width: 250px;\n text-align: center;\n font-size: 13px;\n color: var(--N700);\n}\n.empty-state strong {\n font-size: 16px;\n margin-bottom: 4px;\n color: var(--N900);\n font-weight: normal;\n}\n.empty-state .select-popup {\n height: min-content;\n max-height: 250px;\n overflow: auto;\n padding: 8px 0;\n}\n.empty-state .empty-state__loader {\n width: 34px;\n height: 34px;\n margin-bottom: 16px;\n}\n.empty-state .empty-state__loading-text {\n font-size: 12px;\n width: 200px;\n font-weight: normal;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.5;\n letter-spacing: normal;\n text-align: center;\n color: var(--N900);\n}\n.empty-state .button__icon {\n width: 16px;\n height: 16px;\n margin-left: 8px;\n}";
470
+ var css_248z$3 = ".empty-state {\n height: 100%;\n}\n.empty-state img {\n height: 40%;\n max-height: 200px;\n width: auto;\n max-width: 250px;\n}\n.empty-state svg {\n height: 40%;\n max-height: 200px;\n width: auto;\n}\n.empty-state h1,\n.empty-state h2,\n.empty-state h3,\n.empty-state h4,\n.empty-state h5,\n.empty-state h6 {\n color: var(--N900);\n}\n.empty-state .subtitle {\n font-size: 13px;\n width: 250px;\n font-weight: 400;\n text-align: center;\n line-height: 1.5;\n margin-bottom: 20px;\n}\n.empty-state .cta {\n height: 36px;\n}\n.empty-state p {\n width: 250px;\n text-align: center;\n font-size: 13px;\n color: var(--N700);\n}\n.empty-state strong {\n font-size: 16px;\n margin-bottom: 4px;\n color: var(--N900);\n font-weight: normal;\n}\n.empty-state .select-popup {\n height: min-content;\n max-height: 250px;\n overflow: auto;\n padding: 8px 0;\n}\n.empty-state .empty-state__loader {\n width: 34px;\n height: 34px;\n margin-bottom: 16px;\n}\n.empty-state .empty-state__loading-text {\n font-size: 12px;\n width: 200px;\n font-weight: normal;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.5;\n letter-spacing: normal;\n text-align: center;\n color: var(--N900);\n}\n.empty-state .button__icon {\n width: 16px;\n height: 16px;\n margin-left: 8px;\n}";
471
471
  styleInject(css_248z$3);
472
472
 
473
473
  var _g$2;
@@ -1948,12 +1948,27 @@ var notAuthorized = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.
1948
1948
 
1949
1949
  var notFound = "27bfa7a87d0b7039.png";
1950
1950
 
1951
+ var AppNotDeployed = "64232fbb58cec80f.png";
1952
+
1953
+ var ImageType;
1954
+ (function (ImageType) {
1955
+ ImageType["Large"] = "large";
1956
+ ImageType["Medium"] = "medium";
1957
+ })(ImageType || (ImageType = {}));
1958
+ function GenericEmptyState(_a) {
1959
+ var title = _a.title, image = _a.image, subTitle = _a.subTitle, isButtonAvailable = _a.isButtonAvailable, classname = _a.classname, styles = _a.styles, heightToDeduct = _a.heightToDeduct, imageType = _a.imageType, renderButton = _a.renderButton, imageClassName = _a.imageClassName, children = _a.children, noImage = _a.noImage;
1960
+ return (jsxRuntime.jsxs("div", __assign({ className: "flex column empty-state ".concat(classname ? classname : ''), style: styles }, (heightToDeduct >= 0 && { style: __assign(__assign({}, styles), { height: "calc(100vh - ".concat(heightToDeduct, "px)") }) }), { children: [!noImage && jsxRuntime.jsx("img", { className: imageClassName ? imageClassName : '', src: image || AppNotDeployed, width: imageType === ImageType.Medium ? '200' : '250', height: imageType === ImageType.Medium ? '160' : '200', alt: "empty-state" }), jsxRuntime.jsx("h4", __assign({ className: "title fw-6 cn-9 mb-8" }, { children: title })), subTitle && jsxRuntime.jsx("p", __assign({ className: "subtitle" }, { children: subTitle })), isButtonAvailable && renderButton(), children] })));
1961
+ }
1962
+
1951
1963
  function ErrorScreenNotFound() {
1952
1964
  var history = reactRouter.useHistory();
1953
1965
  var redirectToHome = function () {
1954
1966
  history.push('/app/list');
1955
1967
  };
1956
- return (jsxRuntime.jsx("div", { children: jsxRuntime.jsxs(EmptyState, { children: [jsxRuntime.jsx(EmptyState.Image, { children: jsxRuntime.jsx("img", { src: notFound, alt: "Not Found" }) }), jsxRuntime.jsx(EmptyState.Title, { children: jsxRuntime.jsx("h3", __assign({ className: "title" }, { children: ERROR_EMPTY_SCREEN.PAGE_NOT_FOUND })) }), jsxRuntime.jsx(EmptyState.Subtitle, { children: jsxRuntime.jsx("p", { children: ERROR_EMPTY_SCREEN.PAGE_NOT_EXIST }) }), jsxRuntime.jsx(EmptyState.Button, { children: jsxRuntime.jsx("button", __assign({ className: "flex cta h-32", onClick: redirectToHome }, { children: ERROR_EMPTY_SCREEN.TAKE_BACK_HOME })) })] }) }));
1968
+ var renderGenerateButton = function () {
1969
+ return (jsxRuntime.jsx("button", __assign({ className: "flex cta h-32", onClick: redirectToHome }, { children: ERROR_EMPTY_SCREEN.TAKE_BACK_HOME })));
1970
+ };
1971
+ return (jsxRuntime.jsx(GenericEmptyState, { image: notFound, title: ERROR_EMPTY_SCREEN.PAGE_NOT_FOUND, subTitle: ERROR_EMPTY_SCREEN.PAGE_NOT_EXIST, isButtonAvailable: true, renderButton: renderGenerateButton }));
1957
1972
  }
1958
1973
 
1959
1974
  var ErrorScreenManager = /** @class */ (function (_super) {
@@ -1968,7 +1983,7 @@ var ErrorScreenManager = /** @class */ (function (_super) {
1968
1983
  case 401:
1969
1984
  return 'Unauthorized';
1970
1985
  case 403:
1971
- return jsxRuntime.jsx(ErrorScreenNotAuthorized, { subtitle: this.props.subtitle, subtitleClass: this.props.subtitleClass });
1986
+ return (jsxRuntime.jsx(ErrorScreenNotAuthorized, { subtitle: this.props.subtitle }));
1972
1987
  case 404:
1973
1988
  return jsxRuntime.jsx(ErrorScreenNotFound, {});
1974
1989
  case 500:
@@ -1994,7 +2009,7 @@ var ErrorScreenNotAuthorized = /** @class */ (function (_super) {
1994
2009
  }
1995
2010
  ErrorScreenNotAuthorized.prototype.render = function () {
1996
2011
  var _a, _b;
1997
- return (jsxRuntime.jsxs(EmptyState, __assign({ className: "dc__align-reload-center" }, { children: [jsxRuntime.jsx(EmptyState.Image, { children: jsxRuntime.jsx("img", { src: notAuthorized, alt: "Not Authorized" }) }), jsxRuntime.jsx(EmptyState.Title, { children: jsxRuntime.jsx("h3", __assign({ className: "title" }, { children: (_a = this.props.title) !== null && _a !== void 0 ? _a : ERROR_EMPTY_SCREEN.NOT_AUTHORIZED })) }), jsxRuntime.jsx(EmptyState.Subtitle, __assign({ className: this.props.subtitleClass }, { children: (_b = this.props.subtitle) !== null && _b !== void 0 ? _b : ERROR_EMPTY_SCREEN.ONLY_FOR_SUPERADMIN }))] })));
2012
+ return (jsxRuntime.jsx(GenericEmptyState, { image: notAuthorized, title: (_a = this.props.title) !== null && _a !== void 0 ? _a : ERROR_EMPTY_SCREEN.NOT_AUTHORIZED, subTitle: (_b = this.props.subtitle) !== null && _b !== void 0 ? _b : ERROR_EMPTY_SCREEN.ONLY_FOR_SUPERADMIN }));
1998
2013
  };
1999
2014
  return ErrorScreenNotAuthorized;
2000
2015
  }(React.Component));
@@ -4075,7 +4090,21 @@ var Modal = function (_a) {
4075
4090
  }, id: "popup", className: "".concat(rootClassName, " popup ").concat(modal ? 'modal' : ''), style: __assign({}, style) }, { children: children })), document.getElementById('visible-modal'));
4076
4091
  };
4077
4092
 
4078
- var close = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%20%20%20%20%3Cdefs%3E%20%20%20%20%20%20%20%20%3Cpath%20id%3D%22a%22%20class%3D%22stroke-color%22%20d%3D%22M18.295%205.705a.997.997%200%200%200-1.41%200L12%2010.59%207.115%205.705a.997.997%200%201%200-1.41%201.41L10.59%2012l-4.885%204.885a.997.997%200%201%200%201.41%201.41L12%2013.41l4.885%204.885a.997.997%200%200%200%201.41-1.41L13.41%2012l4.885-4.885a.997.997%200%200%200%200-1.41z%22%2F%3E%20%20%20%20%3C%2Fdefs%3E%20%20%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22%22%2F%3E%20%20%20%20%20%20%20%20%3Cuse%20fill%3D%22%23999%22%20xlink%3Ahref%3D%22%23a%22%2F%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";
4093
+ var _path$5;
4094
+ function _extends$8() { _extends$8 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$8.apply(this, arguments); }
4095
+ var SvgIcCross = function SvgIcCross(props) {
4096
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$8({
4097
+ width: "1em",
4098
+ height: "1em",
4099
+ viewBox: "0 0 24 24",
4100
+ fill: "none",
4101
+ xmlns: "http://www.w3.org/2000/svg"
4102
+ }, props), _path$5 || (_path$5 = /*#__PURE__*/React__namespace.createElement("path", {
4103
+ d: "M19.28 5.78a.75.75 0 0 0-1.06-1.06l1.06 1.06ZM4.72 18.22a.75.75 0 1 0 1.06 1.06l-1.06-1.06Zm13.5 1.06a.75.75 0 1 0 1.06-1.06l-1.06 1.06ZM5.78 4.72a.75.75 0 0 0-1.06 1.06l1.06-1.06Zm12.44 0-6.75 6.75 1.06 1.06 6.75-6.75-1.06-1.06Zm-6.75 6.75-6.75 6.75 1.06 1.06 6.75-6.75-1.06-1.06Zm7.81 6.75-6.75-6.75-1.06 1.06 6.75 6.75 1.06-1.06Zm-6.75-6.75L5.78 4.72 4.72 5.78l6.75 6.75 1.06-1.06Z",
4104
+ fill: "#596168"
4105
+ })));
4106
+ };
4107
+ var close = "data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M19.2803%205.78033C19.5732%205.48744%2019.5732%205.01256%2019.2803%204.71967C18.9874%204.42678%2018.5126%204.42678%2018.2197%204.71967L19.2803%205.78033ZM4.71967%2018.2197C4.42678%2018.5126%204.42678%2018.9874%204.71967%2019.2803C5.01256%2019.5732%205.48744%2019.5732%205.78033%2019.2803L4.71967%2018.2197ZM18.2197%2019.2803C18.5126%2019.5732%2018.9874%2019.5732%2019.2803%2019.2803C19.5732%2018.9874%2019.5732%2018.5126%2019.2803%2018.2197L18.2197%2019.2803ZM5.78033%204.71967C5.48744%204.42678%205.01256%204.42678%204.71967%204.71967C4.42678%205.01256%204.42678%205.48744%204.71967%205.78033L5.78033%204.71967ZM18.2197%204.71967L11.4697%2011.4697L12.5303%2012.5303L19.2803%205.78033L18.2197%204.71967ZM11.4697%2011.4697L4.71967%2018.2197L5.78033%2019.2803L12.5303%2012.5303L11.4697%2011.4697ZM19.2803%2018.2197L12.5303%2011.4697L11.4697%2012.5303L18.2197%2019.2803L19.2803%2018.2197ZM12.5303%2011.4697L5.78033%204.71967L4.71967%205.78033L11.4697%2012.5303L12.5303%2011.4697Z%22%20fill%3D%22%23596168%22%2F%3E%3C%2Fsvg%3E";
4079
4108
 
4080
4109
  var OpaqueModal = /** @class */ (function (_super) {
4081
4110
  __extends(OpaqueModal, _super);
@@ -8369,21 +8398,6 @@ var index$1 = /*#__PURE__*/forwardRef( /*#__PURE__*/TippyGenerator(tippy));
8369
8398
 
8370
8399
  var Tippy = index$1;
8371
8400
 
8372
- var _path$5;
8373
- function _extends$8() { _extends$8 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$8.apply(this, arguments); }
8374
- var SvgIcCross = function SvgIcCross(props) {
8375
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$8({
8376
- width: "1em",
8377
- height: "1em",
8378
- viewBox: "0 0 24 24",
8379
- fill: "none",
8380
- xmlns: "http://www.w3.org/2000/svg"
8381
- }, props), _path$5 || (_path$5 = /*#__PURE__*/React__namespace.createElement("path", {
8382
- d: "M19.28 5.78a.75.75 0 0 0-1.06-1.06l1.06 1.06ZM4.72 18.22a.75.75 0 1 0 1.06 1.06l-1.06-1.06Zm13.5 1.06a.75.75 0 1 0 1.06-1.06l-1.06 1.06ZM5.78 4.72a.75.75 0 0 0-1.06 1.06l1.06-1.06Zm12.44 0-6.75 6.75 1.06 1.06 6.75-6.75-1.06-1.06Zm-6.75 6.75-6.75 6.75 1.06 1.06 6.75-6.75-1.06-1.06Zm7.81 6.75-6.75-6.75-1.06 1.06 6.75 6.75 1.06-1.06Zm-6.75-6.75L5.78 4.72 4.72 5.78l6.75 6.75 1.06-1.06Z",
8383
- fill: "#596168"
8384
- })));
8385
- };
8386
-
8387
8401
  var css_248z$1 = ".tippy-box[data-animation=shift-toward-subtle][data-state=hidden]{opacity:0}.tippy-box[data-animation=shift-toward-subtle][data-state=hidden][data-placement^=top][data-state=hidden]{transform:translateY(-5px)}.tippy-box[data-animation=shift-toward-subtle][data-state=hidden][data-placement^=bottom][data-state=hidden]{transform:translateY(5px)}.tippy-box[data-animation=shift-toward-subtle][data-state=hidden][data-placement^=left][data-state=hidden]{transform:translateX(-5px)}.tippy-box[data-animation=shift-toward-subtle][data-state=hidden][data-placement^=right][data-state=hidden]{transform:translateX(5px)}";
8388
8402
  styleInject(css_248z$1);
8389
8403
 
@@ -16373,6 +16387,7 @@ exports.EmptyState = EmptyState;
16373
16387
  exports.ErrorScreenManager = ErrorScreenManager;
16374
16388
  exports.ErrorScreenNotAuthorized = ErrorScreenNotAuthorized;
16375
16389
  exports.ForceDeleteDialog = ForceDeleteDialog;
16390
+ exports.GenericEmptyState = GenericEmptyState;
16376
16391
  exports.Host = Host;
16377
16392
  exports.InfoColourBar = InfoColourBar;
16378
16393
  exports.Modal = Modal;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtron-labs/devtron-fe-common-lib",
3
- "version": "0.0.7-beta-2",
3
+ "version": "0.0.7-beta-3",
4
4
  "description": "Supporting common component library",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -1,6 +1,6 @@
1
1
  import React, { Component, createContext } from 'react';
2
2
  import { VisibleModal } from '../Modals/VisibleModal';
3
- import close from '../../Assets/Icon/ic-close.svg';
3
+ import close from '../../Assets/Icon/ic-cross.svg';
4
4
  import { Progressing } from '../Progressing'
5
5
  //TODO: may not need context
6
6
  const DialogFormContext = createContext({ title: '', isLoading: false, close: (event) => {}, onSave: (event) => {} });
@@ -0,0 +1,59 @@
1
+ import React, { CSSProperties, ReactNode } from 'react'
2
+ import './emptyState.scss'
3
+ import AppNotDeployed from '../../Assets/Img/app-not-deployed.png'
4
+
5
+ interface GenericEmptyStateType {
6
+ title: ReactNode
7
+ image?
8
+ classname?: string
9
+ subTitle?: ReactNode
10
+ isButtonAvailable?: boolean
11
+ styles?: CSSProperties
12
+ heightToDeduct?: number
13
+ imageType?: string
14
+ renderButton?: () => JSX.Element
15
+ imageClassName?: string
16
+ children?: ReactNode
17
+ noImage?: boolean
18
+ }
19
+
20
+ enum ImageType {
21
+ Large = 'large',
22
+ Medium = 'medium',
23
+ }
24
+
25
+ function GenericEmptyState({
26
+ title,
27
+ image,
28
+ subTitle,
29
+ isButtonAvailable,
30
+ classname,
31
+ styles,
32
+ heightToDeduct,
33
+ imageType,
34
+ renderButton,
35
+ imageClassName,
36
+ children,
37
+ noImage
38
+ }: GenericEmptyStateType): JSX.Element {
39
+ return (
40
+ <div
41
+ className={`flex column empty-state ${classname ? classname : ''}`}
42
+ style={styles}
43
+ {...(heightToDeduct >= 0 && { style: { ...styles, height: `calc(100vh - ${heightToDeduct}px)` } })}
44
+ >
45
+ {!noImage && <img className={imageClassName ? imageClassName : ''}
46
+ src={image || AppNotDeployed}
47
+ width={imageType === ImageType.Medium ? '200' : '250'}
48
+ height={imageType === ImageType.Medium ? '160' : '200'}
49
+ alt="empty-state"
50
+ />}
51
+ <h4 className="title fw-6 cn-9 mb-8">{title}</h4>
52
+ {subTitle && <p className="subtitle">{subTitle}</p>}
53
+ {isButtonAvailable && renderButton()}
54
+ {children}
55
+ </div>
56
+ )
57
+ }
58
+
59
+ export default GenericEmptyState
@@ -19,9 +19,6 @@
19
19
  h6 {
20
20
  color: var(--N900);
21
21
  }
22
- .title {
23
- font-weight: 600;
24
- }
25
22
  .subtitle {
26
23
  font-size: 13px;
27
24
  width: 250px;
@@ -68,16 +65,8 @@
68
65
  color: var(--N900);
69
66
  }
70
67
  .button__icon {
71
- width:16px;
72
- height:16px;
68
+ width: 16px;
69
+ height: 16px;
73
70
  margin-left: 8px;
74
71
  }
75
- //TODO: use name
76
- // .subtitle a {
77
- // color: inherit;
78
- // }
79
- // .subtitle a:focus,
80
- // .subtitle a:hover {
81
- // color: inherit;
82
- // }
83
72
  }
@@ -4,6 +4,7 @@ import notAuthorized from '../Assets/Img/ic-not-authorized.svg'
4
4
  import Reload from './Reload'
5
5
  import ErrorScreenNotFound from './ErrorScreenNotFound'
6
6
  import { ERROR_EMPTY_SCREEN } from './Constants'
7
+ import GenericEmptyState from './EmptyState/GenericEmptyState'
7
8
 
8
9
  export class ErrorScreenManager extends Component<{
9
10
  code?: number
@@ -19,7 +20,9 @@ export class ErrorScreenManager extends Component<{
19
20
  case 401:
20
21
  return 'Unauthorized'
21
22
  case 403:
22
- return <ErrorScreenNotAuthorized subtitle={this.props.subtitle} subtitleClass={this.props.subtitleClass}/>
23
+ return (
24
+ <ErrorScreenNotAuthorized subtitle={this.props.subtitle} />
25
+ )
23
26
  case 404:
24
27
  return <ErrorScreenNotFound />
25
28
  case 500:
@@ -45,21 +48,14 @@ export class ErrorScreenManager extends Component<{
45
48
  export class ErrorScreenNotAuthorized extends Component<{
46
49
  subtitle?: React.ReactChild
47
50
  title?: string
48
- subtitleClass?: string
49
51
  }> {
50
52
  render() {
51
53
  return (
52
- <EmptyState className="dc__align-reload-center">
53
- <EmptyState.Image>
54
- <img src={notAuthorized} alt="Not Authorized" />
55
- </EmptyState.Image>
56
- <EmptyState.Title>
57
- <h3 className="title">{this.props.title ?? ERROR_EMPTY_SCREEN.NOT_AUTHORIZED}</h3>
58
- </EmptyState.Title>
59
- <EmptyState.Subtitle className={this.props.subtitleClass}>
60
- {this.props.subtitle ?? ERROR_EMPTY_SCREEN.ONLY_FOR_SUPERADMIN}
61
- </EmptyState.Subtitle>
62
- </EmptyState>
54
+ <GenericEmptyState
55
+ image={notAuthorized}
56
+ title={this.props.title ?? ERROR_EMPTY_SCREEN.NOT_AUTHORIZED}
57
+ subTitle={this.props.subtitle ?? ERROR_EMPTY_SCREEN.ONLY_FOR_SUPERADMIN}
58
+ />
63
59
  )
64
60
  }
65
- }
61
+ }
@@ -1,38 +1,31 @@
1
1
  import React from 'react'
2
2
  import notFound from '../Assets/Img/ic-empty-error@2x.png'
3
3
  import { useHistory } from 'react-router'
4
- import EmptyState from './EmptyState/EmptyState'
5
4
  import { ERROR_EMPTY_SCREEN } from './Constants'
5
+ import GenericEmptyState from './EmptyState/GenericEmptyState'
6
6
 
7
7
  function ErrorScreenNotFound() {
8
- const history = useHistory()
8
+ const history = useHistory()
9
+ const redirectToHome = () => {
10
+ history.push('/app/list')
11
+ }
12
+ const renderGenerateButton = () => {
13
+ return (
14
+ <button className="flex cta h-32" onClick={redirectToHome}>
15
+ {ERROR_EMPTY_SCREEN.TAKE_BACK_HOME}
16
+ </button>
17
+ )
18
+ }
9
19
 
10
- const redirectToHome = () => {
11
- history.push('/app/list')
12
- }
13
-
14
- return (
15
- <div>
16
- <EmptyState>
17
- <EmptyState.Image>
18
- <img src={notFound} alt="Not Found" />
19
- </EmptyState.Image>
20
- <EmptyState.Title>
21
- <h3 className="title">{ERROR_EMPTY_SCREEN.PAGE_NOT_FOUND}</h3>
22
- </EmptyState.Title>
23
- <EmptyState.Subtitle >
24
- <p>{ERROR_EMPTY_SCREEN.PAGE_NOT_EXIST}</p>
25
- </EmptyState.Subtitle>
26
- <EmptyState.Button>
27
- <button className="flex cta h-32"
28
- onClick={redirectToHome}
29
- >
30
- {ERROR_EMPTY_SCREEN.TAKE_BACK_HOME}
31
- </button>
32
- </EmptyState.Button>
33
- </EmptyState>
34
- </div>
35
- )
20
+ return (
21
+ <GenericEmptyState
22
+ image={notFound}
23
+ title={ERROR_EMPTY_SCREEN.PAGE_NOT_FOUND}
24
+ subTitle={ERROR_EMPTY_SCREEN.PAGE_NOT_EXIST}
25
+ isButtonAvailable={true}
26
+ renderButton={renderGenerateButton}
27
+ />
28
+ )
36
29
  }
37
30
 
38
- export default ErrorScreenNotFound
31
+ export default ErrorScreenNotFound
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import ReactDOM from 'react-dom';
3
- import closeIcon from '../../Assets/Icon/ic-close.svg'
3
+ import closeIcon from '../../Assets/Icon/ic-cross.svg'
4
4
 
5
5
  export interface OpaqueModalProps {
6
6
  className?: string;
@@ -25,3 +25,5 @@ export { default as InfoColourBar } from './InfoColorBar/InfoColourbar'
25
25
  export * from './Common.service'
26
26
  export * from './Checkbox'
27
27
  export { default as EmptyState } from './EmptyState/EmptyState'
28
+ export { default as GenericEmptyState } from './EmptyState/GenericEmptyState'
29
+
@@ -1,9 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24" viewBox="0 0 24 24">
2
- <defs>
3
- <path id="a" class="stroke-color" d="M18.295 5.705a.997.997 0 0 0-1.41 0L12 10.59 7.115 5.705a.997.997 0 1 0-1.41 1.41L10.59 12l-4.885 4.885a.997.997 0 1 0 1.41 1.41L12 13.41l4.885 4.885a.997.997 0 0 0 1.41-1.41L13.41 12l4.885-4.885a.997.997 0 0 0 0-1.41z"/>
4
- </defs>
5
- <g fill="none" fill-rule="evenodd">
6
- <path d=""/>
7
- <use fill="#999" xlink:href="#a"/>
8
- </g>
9
- </svg>