namirasoft-account-react 1.5.23 → 1.5.24
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.
|
@@ -13,8 +13,6 @@ export interface NSAHomePageProps extends IBaseComponentProps, NSARouterMakerRes
|
|
|
13
13
|
getChildren?: {
|
|
14
14
|
getChildrenBeforeTitle?: () => ReactNode;
|
|
15
15
|
getChildrenAfterTitle?: () => ReactNode;
|
|
16
|
-
getChildrenBeforeMenuList?: () => ReactNode;
|
|
17
|
-
getChildrenAfterMenuList?: () => ReactNode;
|
|
18
16
|
};
|
|
19
17
|
product?: {
|
|
20
18
|
search?: boolean;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { SetTimeouService } from 'namirasoft-core';
|
|
3
|
-
import { NSBox, NSBoxSearch, NSLine,
|
|
3
|
+
import { NSBox, NSBoxSearch, NSLine, NSListProduct, NSLoading, NSSpace, NSSpaceSizeType, NSTitle, ProductCacheService } from 'namirasoft-site-react';
|
|
4
4
|
import { useEffect, useState } from 'react';
|
|
5
5
|
import Styles from './NSAHomePage.module.css';
|
|
6
6
|
export function NSAHomePage(props) {
|
|
7
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u
|
|
7
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
8
8
|
let cache = ProductCacheService.get(props.product_id, props.notifier.onError);
|
|
9
9
|
let [state, setState] = useState({ product: null });
|
|
10
10
|
useEffect(() => {
|
|
@@ -19,11 +19,11 @@ export function NSAHomePage(props) {
|
|
|
19
19
|
let logo = (_h = (_g = (_f = props.custom) === null || _f === void 0 ? void 0 : _f.logo) !== null && _g !== void 0 ? _g : state.product.logo) !== null && _h !== void 0 ? _h : "";
|
|
20
20
|
let description = (_l = (_k = (_j = props.custom) === null || _j === void 0 ? void 0 : _j.description) !== null && _k !== void 0 ? _k : state.product.description) !== null && _l !== void 0 ? _l : "";
|
|
21
21
|
return (_jsxs("div", { className: Styles.nsa_home_container, children: [props.show_image &&
|
|
22
|
-
_jsx("img", { src: logo, alt: state.product.name, width: 256, height: 256 }), (_o = (_m = props.getChildren) === null || _m === void 0 ? void 0 : _m.getChildrenBeforeTitle) === null || _o === void 0 ? void 0 : _o.call(_m), _jsx(NSSpace, { size: NSSpaceSizeType.MICRO }), _jsx("h2", { children: headline }), _jsx(NSSpace, { size: NSSpaceSizeType.MICRO }), _jsx("p", { children: description }), _jsx(NSSpace, { size: NSSpaceSizeType.SMALL }), (_q = (_p = props.getChildren) === null || _p === void 0 ? void 0 : _p.getChildrenAfterTitle) === null || _q === void 0 ? void 0 : _q.call(_p),
|
|
22
|
+
_jsx("img", { src: logo, alt: state.product.name, width: 256, height: 256 }), (_o = (_m = props.getChildren) === null || _m === void 0 ? void 0 : _m.getChildrenBeforeTitle) === null || _o === void 0 ? void 0 : _o.call(_m), _jsx(NSSpace, { size: NSSpaceSizeType.MICRO }), _jsx("h2", { children: headline }), _jsx(NSSpace, { size: NSSpaceSizeType.MICRO }), _jsx("p", { children: description }), _jsx(NSSpace, { size: NSSpaceSizeType.SMALL }), (_q = (_p = props.getChildren) === null || _p === void 0 ? void 0 : _p.getChildrenAfterTitle) === null || _q === void 0 ? void 0 : _q.call(_p), _jsx(NSSpace, { size: NSSpaceSizeType.NORMAL }), _jsx(NSLine, {}), _jsx(NSSpace, { size: NSSpaceSizeType.SMALL }), _jsx(NSTitle, { title: "Related Products", style: { fontSize: 32, marginBottom: ((_r = props.product) === null || _r === void 0 ? void 0 : _r.search) ? 16 : 32 } }), ((_s = props.product) === null || _s === void 0 ? void 0 : _s.search) &&
|
|
23
23
|
_jsxs(_Fragment, { children: [_jsx(NSBoxSearch, { title: "", required: false, hideHeader: true, placeholder: "Search products . . .", classList: [Styles.nsa_home_search_wrapper], style: { width: NSBox.width.double }, input: { classList: [Styles.nsa_home_search_box] }, onChanged: (box) => {
|
|
24
24
|
new SetTimeouService().setTimeoutIfNotCalledAgain(() => {
|
|
25
25
|
setState((prev) => { var _a; return (Object.assign(Object.assign({}, prev), { search_text: (_a = box.getValue()) !== null && _a !== void 0 ? _a : "" })); });
|
|
26
26
|
}, 1500);
|
|
27
|
-
} }), _jsx(NSSpace, { size: NSSpaceSizeType.SMALL })] }), _jsx(NSListProduct, { scope: scope, name: "Home", search: state.search_text, getChildrenBefore: (
|
|
27
|
+
} }), _jsx(NSSpace, { size: NSSpaceSizeType.SMALL })] }), _jsx(NSListProduct, { scope: scope, name: "Home", search: state.search_text, getChildrenBefore: (_t = props.product) === null || _t === void 0 ? void 0 : _t.getChildrenBefore, getChildrenAfter: (_u = props.product) === null || _u === void 0 ? void 0 : _u.getChildrenAfter })] }));
|
|
28
28
|
}
|
|
29
29
|
//# sourceMappingURL=NSAHomePage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSAHomePage.js","sourceRoot":"","sources":["../../src/pages/NSAHomePage.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAuB,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"NSAHomePage.js","sourceRoot":"","sources":["../../src/pages/NSAHomePage.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAuB,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAA0B,SAAS,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAClM,OAAO,EAAa,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,MAAM,MAAM,0BAA0B,CAAC;AA4B9C,MAAM,UA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EAAE,WAAC,OAAA,iCAAM,IAAI,KAAE,WAAW,EAAE,MAAA,GAAG,CAAC,QAAQ,EAAE,mCAAI,EAAE,IAAG,CAAA,EAAA,CAAC,CAAC;gCACzE,CAAC,EAAE,IAAI,CAAC,CAAC;4BACb,CAAC,GACH,EACF,KAAC,OAAO,IAAC,IAAI,EAAE,eAAe,CAAC,KAAK,GAAI,IACzC,EAEP,KAAC,aAAa,IACV,KAAK,EAAE,KAAK,EACZ,IAAI,EAAC,MAAM,EACX,MAAM,EAAE,KAAK,CAAC,WAAW,EACzB,iBAAiB,EAAE,MAAA,KAAK,CAAC,OAAO,0CAAE,iBAAiB,EACnD,gBAAgB,EAAE,MAAA,KAAK,CAAC,OAAO,0CAAE,gBAAgB,GACnD,IACA,CACT,CAAC;AACN,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ProductFullRow } from 'namirasoft-api-product';
|
|
2
2
|
import { SetTimeouService } from 'namirasoft-core';
|
|
3
|
-
import { IBaseComponentProps, NSBox, NSBoxSearch, NSLine,
|
|
3
|
+
import { IBaseComponentProps, NSBox, NSBoxSearch, NSLine, NSListProduct, NSListProductCardProps, NSLoading, NSSpace, NSSpaceSizeType, NSTitle, ProductCacheService } from 'namirasoft-site-react';
|
|
4
4
|
import { ReactNode, useEffect, useState } from 'react';
|
|
5
5
|
import { NSARouterMakerResult } from '../NSARouterMakerResult';
|
|
6
6
|
import Styles from './NSAHomePage.module.css';
|
|
@@ -17,8 +17,6 @@ export interface NSAHomePageProps extends IBaseComponentProps, NSARouterMakerRes
|
|
|
17
17
|
getChildren?: {
|
|
18
18
|
getChildrenBeforeTitle?: () => ReactNode;
|
|
19
19
|
getChildrenAfterTitle?: () => ReactNode;
|
|
20
|
-
getChildrenBeforeMenuList?: () => ReactNode;
|
|
21
|
-
getChildrenAfterMenuList?: () => ReactNode;
|
|
22
20
|
};
|
|
23
21
|
product?: {
|
|
24
22
|
search?: boolean;
|
|
@@ -77,15 +75,6 @@ export function NSAHomePage(props: NSAHomePageProps)
|
|
|
77
75
|
|
|
78
76
|
{props.getChildren?.getChildrenAfterTitle?.()}
|
|
79
77
|
|
|
80
|
-
{props.getChildren?.getChildrenBeforeMenuList?.()}
|
|
81
|
-
<NSListMenu
|
|
82
|
-
scope={scope}
|
|
83
|
-
name="Header"
|
|
84
|
-
isLoggedIn={() => props.account.token_manager.exists()}
|
|
85
|
-
onError={props.notifier.onError}
|
|
86
|
-
/>
|
|
87
|
-
{props.getChildren?.getChildrenAfterMenuList?.()}
|
|
88
|
-
|
|
89
78
|
<NSSpace size={NSSpaceSizeType.NORMAL} />
|
|
90
79
|
<NSLine />
|
|
91
80
|
<NSSpace size={NSSpaceSizeType.SMALL} />
|