UNPKG

1.81 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 });
19var react_1 = __importDefault(require("react"));
20var polaris_1 = require("@shopify/polaris");
21var react_compose_1 = __importDefault(require("@shopify/react-compose"));
22var withFeature_1 = __importDefault(require("../withFeature"));
23var loading_1 = require("../store/reducers/embeddedApp/loading");
24/**
25 * The UI component for the Loading feature
26 * @public
27 * */
28var Loading = /** @class */ (function (_super) {
29 __extends(Loading, _super);
30 function Loading() {
31 return _super !== null && _super.apply(this, arguments) || this;
32 }
33 Loading.prototype.render = function () {
34 var isLoading = this.props.store.isLoading;
35 return isLoading ? react_1.default.createElement(polaris_1.Loading, null) : null;
36 };
37 return Loading;
38}(react_1.default.PureComponent));
39exports.Loading = Loading;
40/**
41 * The Loading feature with its reducer, actions and UI component
42 * @public
43 * */
44exports.default = react_compose_1.default(withFeature_1.default(loading_1.feature))(Loading);