hds-web 1.36.6 → 1.36.7
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/dist/index.es.js +5 -5
- package/dist/index.js +3 -3
- package/package.json +1 -1
- package/src/HDS/helpers/AlgoliaSearch/constants.js +19 -101
- package/src/HDS/helpers/AlgoliaSearch/search.js +0 -1
- package/src/HDS/helpers/AlgoliaSearch/searchfooter.js +2 -8
- package/src/HDS/helpers/AlgoliaSearch/searchoverlay.js +8 -13
- package/src/HDS/helpers/AlgoliaSearch/searchresults.js +77 -67
- package/src/HDS/helpers/AlgoliaSearch/searchwrapper.js +67 -101
- package/src/HDS/helpers/AlgoliaSearch/SearchHit.js +0 -117
@@ -1,117 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { Highlight, Snippet } from "react-instantsearch-dom";
|
3
|
-
import { INDEX_TYPES } from "./constants";
|
4
|
-
import { Typography } from "../../foundation/Typography";
|
5
|
-
|
6
|
-
const baseDomain = "hasura.io";
|
7
|
-
|
8
|
-
export const SearchHit = ({ hit, indexType }) => {
|
9
|
-
if (indexType === "events") {
|
10
|
-
return (
|
11
|
-
<a href={hit.metaTags?.canonical_url} className="grid h-full">
|
12
|
-
<div className="self-start">
|
13
|
-
<div className="flex items-start">
|
14
|
-
<div className="w-6 h-6 mr-2 min-w-[24px] flex items-center justify-center">
|
15
|
-
<div className="w-3 h-3 rounded-full bg-blue-500"></div>
|
16
|
-
</div>
|
17
|
-
<div>
|
18
|
-
<Typography
|
19
|
-
textStyle="body1c-bold"
|
20
|
-
className="font-bold text-neutral-800 pb-3"
|
21
|
-
>
|
22
|
-
<Highlight
|
23
|
-
attribute="metaTags.meta_title"
|
24
|
-
hit={hit}
|
25
|
-
tagName="mark"
|
26
|
-
/>
|
27
|
-
</Typography>
|
28
|
-
<Typography
|
29
|
-
textStyle="body2"
|
30
|
-
className="text-neutral-800 word-break"
|
31
|
-
>
|
32
|
-
<Snippet
|
33
|
-
attribute="metaTags.meta_description"
|
34
|
-
hit={hit}
|
35
|
-
tagName="mark"
|
36
|
-
/>
|
37
|
-
</Typography>
|
38
|
-
</div>
|
39
|
-
</div>
|
40
|
-
</div>
|
41
|
-
<Typography
|
42
|
-
textStyle="body3"
|
43
|
-
className="self-end pl-8 pt-3 text-neutral-500"
|
44
|
-
>
|
45
|
-
<span className="hit-slug word-break">
|
46
|
-
{hit.metaTags?.canonical_url.replace(`https://${baseDomain}/`, "/")}
|
47
|
-
</span>
|
48
|
-
</Typography>
|
49
|
-
</a>
|
50
|
-
);
|
51
|
-
}
|
52
|
-
|
53
|
-
return (
|
54
|
-
<a href={hit.url} className="grid h-full">
|
55
|
-
<div className="self-start">
|
56
|
-
{/* <Typography textStyle="body3c-medium" className="uppercase text-neutral-500">{indexType}</Typography> */}
|
57
|
-
{indexType === INDEX_TYPES.docs ? (
|
58
|
-
<div className="flex items-start">
|
59
|
-
<div className="w-6 h-6 mr-2 min-w-[24px] flex items-center justify-center">
|
60
|
-
<div className="w-3 h-3 rounded-full bg-blue-500"></div>
|
61
|
-
</div>
|
62
|
-
<div>
|
63
|
-
{!!hit.hierarchy && (
|
64
|
-
<Typography
|
65
|
-
textStyle="body1c-bold"
|
66
|
-
className="font-bold flex items-start pb-3"
|
67
|
-
>
|
68
|
-
{`${
|
69
|
-
Object.values(hit.hierarchy)
|
70
|
-
.filter((h) => !!h)
|
71
|
-
.reverse()[0]
|
72
|
-
}`}
|
73
|
-
</Typography>
|
74
|
-
)}
|
75
|
-
<Typography
|
76
|
-
textStyle="body2"
|
77
|
-
className="text-neutral-800 word-break"
|
78
|
-
>
|
79
|
-
<Snippet attribute="content" hit={hit} tagName="mark" />
|
80
|
-
</Typography>
|
81
|
-
</div>
|
82
|
-
</div>
|
83
|
-
) : (
|
84
|
-
<div className="flex items-start">
|
85
|
-
<div className="w-6 h-6 mr-2 min-w-[24px] flex items-center justify-center">
|
86
|
-
<div className="w-3 h-3 rounded-full bg-blue-500"></div>
|
87
|
-
</div>
|
88
|
-
<div>
|
89
|
-
<Typography
|
90
|
-
textStyle="body1c-bold"
|
91
|
-
className="font-bold text-neutral-800 pb-3"
|
92
|
-
>
|
93
|
-
<Highlight attribute="title" hit={hit} tagName="mark" />
|
94
|
-
</Typography>
|
95
|
-
<Typography
|
96
|
-
textStyle="body2"
|
97
|
-
className="text-neutral-800 word-break"
|
98
|
-
>
|
99
|
-
<Snippet attribute="excerpt" hit={hit} tagName="mark" />
|
100
|
-
</Typography>
|
101
|
-
</div>
|
102
|
-
</div>
|
103
|
-
)}
|
104
|
-
</div>
|
105
|
-
{hit.url ? (
|
106
|
-
<Typography
|
107
|
-
textStyle="body3"
|
108
|
-
className="self-end pl-8 pt-3 text-neutral-500"
|
109
|
-
>
|
110
|
-
<span className="hit-slug word-break">
|
111
|
-
{hit.url.replace(`https://${baseDomain}/`, "/")}
|
112
|
-
</span>
|
113
|
-
</Typography>
|
114
|
-
) : null}
|
115
|
-
</a>
|
116
|
-
);
|
117
|
-
};
|