@react-pakistan/util-functions 1.23.32 → 1.23.33
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.
- package/hooks/index.d.ts +0 -1
- package/hooks/index.js +0 -1
- package/package.json +1 -1
- package/hooks/with-seo.d.ts +0 -9
- package/hooks/with-seo.js +0 -43
package/hooks/index.d.ts
CHANGED
package/hooks/index.js
CHANGED
|
@@ -23,4 +23,3 @@ __exportStar(require("./use-is-mobile"), exports);
|
|
|
23
23
|
__exportStar(require("./use-sticky"), exports);
|
|
24
24
|
__exportStar(require("./use-toggle-state"), exports);
|
|
25
25
|
__exportStar(require("./use-window-event-listener"), exports);
|
|
26
|
-
__exportStar(require("./with-seo"), exports);
|
package/package.json
CHANGED
package/hooks/with-seo.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ComponentType } from 'react';
|
|
2
|
-
interface WrapperProps {
|
|
3
|
-
organizationJsonLd?: unknown;
|
|
4
|
-
breadcrumbJsonLd?: unknown;
|
|
5
|
-
faqJsonLd?: unknown;
|
|
6
|
-
[key: string]: unknown;
|
|
7
|
-
}
|
|
8
|
-
export declare const withSEO: (Component: ComponentType<WrapperProps>, rest: WrapperProps) => any;
|
|
9
|
-
export {};
|
package/hooks/with-seo.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.withSEO = void 0;
|
|
27
|
-
const react_1 = __importStar(require("react"));
|
|
28
|
-
const DynamicScript = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('next/script'))));
|
|
29
|
-
const withSEO = (Component, rest) => {
|
|
30
|
-
const EnhancedComponent = () => (react_1.default.createElement(react_1.default.Fragment, null,
|
|
31
|
-
react_1.default.createElement(Component, Object.assign({}, rest)),
|
|
32
|
-
rest.organizationJsonLd && (react_1.default.createElement(DynamicScript, { id: 'organization-schema', type: 'application/ld+json', dangerouslySetInnerHTML: {
|
|
33
|
-
__html: JSON.stringify(rest.organizationJsonLd),
|
|
34
|
-
} })),
|
|
35
|
-
rest.breadcrumbJsonLd && (react_1.default.createElement(DynamicScript, { id: 'breadcrumb-schema', type: 'application/ld+json', dangerouslySetInnerHTML: {
|
|
36
|
-
__html: JSON.stringify(rest.breadcrumbJsonLd),
|
|
37
|
-
} })),
|
|
38
|
-
rest.faqJsonLd && (react_1.default.createElement(DynamicScript, { id: 'faq-schema', type: 'application/ld+json', dangerouslySetInnerHTML: {
|
|
39
|
-
__html: JSON.stringify(rest.faqJsonLd),
|
|
40
|
-
} }))));
|
|
41
|
-
return EnhancedComponent;
|
|
42
|
-
};
|
|
43
|
-
exports.withSEO = withSEO;
|