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.
@@ -1,5 +1,7 @@
1
- /// <reference types="react" />
2
1
  export interface CategoriesWrapperProps {
3
2
  category: string;
4
- categoryItems: React.ReactNode[];
3
+ categoryItems: {
4
+ title: string;
5
+ slug: string;
6
+ }[];
5
7
  }
@@ -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, 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, 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oddsgate-ds",
3
- "version": "1.0.209",
3
+ "version": "1.0.211",
4
4
  "description": "Miew theme component library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -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">{item}</Button>
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
@@ -1,4 +1,4 @@
1
1
  export interface CategoriesWrapperProps {
2
2
  category: string
3
- categoryItems: React.ReactNode[]
3
+ categoryItems: { title: string; slug: string }[]
4
4
  }
@@ -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]: 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) => item.name)
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
  }