@ludo.ninja/components 2.1.77 → 2.1.79
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.
|
@@ -22,7 +22,7 @@ class AssetVideo extends Video_1.default {
|
|
|
22
22
|
displayOpenGraphMeta({ alt }) {
|
|
23
23
|
const url = this.getMediaUrl();
|
|
24
24
|
const getAudioENVDomain = (0, env_1.useEnvStore)((state) => state.getAudioDomain);
|
|
25
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("meta", { property: "og:video", content: url(getAudioENVDomain) }), (0, jsx_runtime_1.jsx)("meta", { property: "og:video:secure_url", content: url(getAudioENVDomain) }), (0, jsx_runtime_1.jsx)("meta", { property: "og:video:type", content: "application/x-shockwave-flash" }), (0, jsx_runtime_1.jsx)("meta", { property: "og:image", content:
|
|
25
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("meta", { property: "og:video", content: url(getAudioENVDomain) }), (0, jsx_runtime_1.jsx)("meta", { property: "og:video:secure_url", content: url(getAudioENVDomain) }), (0, jsx_runtime_1.jsx)("meta", { property: "og:video:type", content: "application/x-shockwave-flash" }), (0, jsx_runtime_1.jsx)("meta", { property: "og:image", content: url(getAudioENVDomain) }), (0, jsx_runtime_1.jsx)("meta", { property: "\u201Dog:image:width\u201D", content: "1280" }), (0, jsx_runtime_1.jsx)("meta", { property: "\u201Dog:image:height\u201D", content: "720" })] }));
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
const DisplaySingleMedia = ({ getMediaUrl, }) => {
|
package/package.json
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ApolloClient, NormalizedCacheObject } from '@apollo/client';
|
|
2
|
-
import { searchSchema as schema } from '@ludo.ninja/api';
|
|
3
|
-
import CollectionEntity from '../../../../dto/Collection/CollectionEntity';
|
|
4
|
-
declare const prefetchCollection: ({ collectionId }: {
|
|
5
|
-
collectionId: string;
|
|
6
|
-
}, apolloClient: ApolloClient<NormalizedCacheObject>) => Promise<import("@apollo/client").ApolloQueryResult<any> | {
|
|
7
|
-
data: {
|
|
8
|
-
fetchCollection: null;
|
|
9
|
-
};
|
|
10
|
-
}>;
|
|
11
|
-
declare const useFetchCollection: ({ collectionId, prefetchedCollection, }: {
|
|
12
|
-
collectionId: string;
|
|
13
|
-
prefetchedCollection: schema.ICollection | null;
|
|
14
|
-
}) => {
|
|
15
|
-
isLoadingCollection: boolean;
|
|
16
|
-
error: import("@apollo/client").ApolloError | undefined;
|
|
17
|
-
collection: CollectionEntity | null;
|
|
18
|
-
};
|
|
19
|
-
export { prefetchCollection, useFetchCollection };
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.useFetchCollection = exports.prefetchCollection = void 0;
|
|
7
|
-
const react_1 = require("react");
|
|
8
|
-
const client_1 = require("@apollo/client");
|
|
9
|
-
const api_1 = require("@ludo.ninja/api");
|
|
10
|
-
const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
|
|
11
|
-
const ui_1 = require("../../../../store/ui");
|
|
12
|
-
const CollectionEntity_1 = __importDefault(require("../../../../dto/Collection/CollectionEntity"));
|
|
13
|
-
const prefetchCollection = ({ collectionId }, apolloClient) => {
|
|
14
|
-
return apolloClient
|
|
15
|
-
.query({
|
|
16
|
-
query: api_1.searchSchema.FetchCollectionDocument,
|
|
17
|
-
variables: { collectionId },
|
|
18
|
-
context: { uri: api_1.hosts.searchHost },
|
|
19
|
-
fetchPolicy: 'network-only',
|
|
20
|
-
})
|
|
21
|
-
.catch(() => {
|
|
22
|
-
return {
|
|
23
|
-
data: { fetchCollection: null },
|
|
24
|
-
};
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
exports.prefetchCollection = prefetchCollection;
|
|
28
|
-
const useFetchCollection = ({ collectionId, prefetchedCollection, }) => {
|
|
29
|
-
const [collection, setCollection] = (0, react_1.useState)(prefetchedCollection ? new CollectionEntity_1.default(prefetchedCollection) : null);
|
|
30
|
-
const [isLoadingCollection, setIsLoadingCollection] = (0, react_1.useState)(!prefetchedCollection);
|
|
31
|
-
const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
|
|
32
|
-
const { error } = (0, client_1.useQuery)(api_1.searchSchema.FetchCollectionDocument, {
|
|
33
|
-
variables: { collectionId },
|
|
34
|
-
context: {
|
|
35
|
-
uri: api_1.hosts.searchHost,
|
|
36
|
-
},
|
|
37
|
-
fetchPolicy: 'cache-first',
|
|
38
|
-
onCompleted: ({ fetchCollection }) => {
|
|
39
|
-
if (fetchCollection) {
|
|
40
|
-
setCollection(new CollectionEntity_1.default(fetchCollection));
|
|
41
|
-
}
|
|
42
|
-
setIsLoadingCollection(false);
|
|
43
|
-
},
|
|
44
|
-
onError: () => {
|
|
45
|
-
openAlert({
|
|
46
|
-
type: type_1.alertVariants.error,
|
|
47
|
-
caption: 'Oops, something went wrong.',
|
|
48
|
-
});
|
|
49
|
-
setCollection(null);
|
|
50
|
-
setIsLoadingCollection(false);
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
return {
|
|
54
|
-
isLoadingCollection,
|
|
55
|
-
error,
|
|
56
|
-
collection,
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
exports.useFetchCollection = useFetchCollection;
|