oddsgate-ds 1.0.209 → 1.0.211
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/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/molecules/CategoriesWrapper/CategoriesWrapper.interface.d.ts +4 -2
- package/dist/cjs/types/components/organisms/Glossary/Glossary.component.d.ts +4 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/molecules/CategoriesWrapper/CategoriesWrapper.interface.d.ts +4 -2
- package/dist/esm/types/components/organisms/Glossary/Glossary.component.d.ts +4 -1
- package/dist/types.d.ts +4 -1
- package/package.json +1 -1
- package/src/components/molecules/CategoriesWrapper/CategoriesWrapper.component.tsx +4 -2
- package/src/components/molecules/CategoriesWrapper/CategoriesWrapper.interface.ts +1 -1
- package/src/components/organisms/Glossary/Glossary.component.tsx +1 -1
- package/src/components/organisms/Glossary/Glossary.stories.tsx +10 -2
|
@@ -4,7 +4,10 @@ type GlossaryProps = {
|
|
|
4
4
|
setSearchTerm: (term: string) => void;
|
|
5
5
|
selectedCategory: string | null;
|
|
6
6
|
setSelectedCategory: (cat: string | null) => void;
|
|
7
|
-
categoryData: Record<string,
|
|
7
|
+
categoryData: Record<string, {
|
|
8
|
+
title: string;
|
|
9
|
+
slug: string;
|
|
10
|
+
}[]>;
|
|
8
11
|
displayedCategories: string[];
|
|
9
12
|
placeholder?: string;
|
|
10
13
|
noResults?: boolean;
|
package/dist/types.d.ts
CHANGED
|
@@ -725,7 +725,10 @@ type GlossaryProps = {
|
|
|
725
725
|
setSearchTerm: (term: string) => void;
|
|
726
726
|
selectedCategory: string | null;
|
|
727
727
|
setSelectedCategory: (cat: string | null) => void;
|
|
728
|
-
categoryData: Record<string,
|
|
728
|
+
categoryData: Record<string, {
|
|
729
|
+
title: string;
|
|
730
|
+
slug: string;
|
|
731
|
+
}[]>;
|
|
729
732
|
displayedCategories: string[];
|
|
730
733
|
placeholder?: string;
|
|
731
734
|
noResults?: boolean;
|
package/package.json
CHANGED
|
@@ -24,7 +24,9 @@ const CategoriesWrapper: React.FC<CategoriesWrapperProps> = ({
|
|
|
24
24
|
<StyledCategoryContent>
|
|
25
25
|
{categoryItems.map((item, index) => (
|
|
26
26
|
<StyledCategoryItem key={index}>
|
|
27
|
-
<Button variant="text">
|
|
27
|
+
<Button href={item.slug} variant="text">
|
|
28
|
+
{item.title}
|
|
29
|
+
</Button>
|
|
28
30
|
</StyledCategoryItem>
|
|
29
31
|
))}
|
|
30
32
|
</StyledCategoryContent>
|
|
@@ -34,4 +36,4 @@ const CategoriesWrapper: React.FC<CategoriesWrapperProps> = ({
|
|
|
34
36
|
)
|
|
35
37
|
}
|
|
36
38
|
|
|
37
|
-
export default CategoriesWrapper
|
|
39
|
+
export default CategoriesWrapper
|
|
@@ -19,7 +19,7 @@ type GlossaryProps = {
|
|
|
19
19
|
setSearchTerm: (term: string) => void
|
|
20
20
|
selectedCategory: string | null
|
|
21
21
|
setSelectedCategory: (cat: string | null) => void
|
|
22
|
-
categoryData: Record<string, string[]>
|
|
22
|
+
categoryData: Record<string, { title: string; slug: string }[]>
|
|
23
23
|
displayedCategories: string[]
|
|
24
24
|
placeholder?: string
|
|
25
25
|
noResults?: boolean
|
|
@@ -144,8 +144,13 @@ interface BuildCategoryDataCategory {
|
|
|
144
144
|
items: BuildCategoryDataItem[]
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
+
interface CategoryDataItem {
|
|
148
|
+
title: string
|
|
149
|
+
slug: string
|
|
150
|
+
}
|
|
151
|
+
|
|
147
152
|
interface CategoryData {
|
|
148
|
-
[categoryName: string]:
|
|
153
|
+
[categoryName: string]: CategoryDataItem[]
|
|
149
154
|
}
|
|
150
155
|
|
|
151
156
|
function buildCategoryData(
|
|
@@ -154,7 +159,10 @@ function buildCategoryData(
|
|
|
154
159
|
): CategoryData {
|
|
155
160
|
const data: CategoryData = {}
|
|
156
161
|
categories.forEach((cat: BuildCategoryDataCategory) => {
|
|
157
|
-
data[cat.name] = cat.items.map((item: BuildCategoryDataItem) =>
|
|
162
|
+
data[cat.name] = cat.items.map((item: BuildCategoryDataItem) => ({
|
|
163
|
+
title: item.name,
|
|
164
|
+
slug: item.slug
|
|
165
|
+
}))
|
|
158
166
|
})
|
|
159
167
|
return data
|
|
160
168
|
}
|