UNPKG

1.83 kBJavaScriptView Raw
1"use strict";
2var __extends = (this && this.__extends) || (function () {
3 var extendStatics = function (d, b) {
4 extendStatics = Object.setPrototypeOf ||
5 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7 return extendStatics(d, b);
8 };
9 return function (d, b) {
10 extendStatics(d, b);
11 function __() { this.constructor = d; }
12 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13 };
14})();
15var __importDefault = (this && this.__importDefault) || function (mod) {
16 return (mod && mod.__esModule) ? mod : { "default": mod };
17};
18Object.defineProperty(exports, "__esModule", { value: true });
19exports.Loading = void 0;
20var react_1 = __importDefault(require("react"));
21var polaris_1 = require("@shopify/polaris");
22var react_compose_1 = __importDefault(require("@shopify/react-compose"));
23var withFeature_1 = __importDefault(require("../withFeature"));
24var loading_1 = require("../store/reducers/embeddedApp/loading");
25/**
26 * The UI component for the Loading feature
27 * @public
28 * */
29var Loading = /** @class */ (function (_super) {
30 __extends(Loading, _super);
31 function Loading() {
32 return _super !== null && _super.apply(this, arguments) || this;
33 }
34 Loading.prototype.render = function () {
35 var isLoading = this.props.store.isLoading;
36 return isLoading ? react_1.default.createElement(polaris_1.Loading, null) : null;
37 };
38 return Loading;
39}(react_1.default.PureComponent));
40exports.Loading = Loading;
41/**
42 * The Loading feature with its reducer, actions and UI component
43 * @public
44 * */
45exports.default = react_compose_1.default(withFeature_1.default(loading_1.feature))(Loading);