oddsgate-ds 1.0.222 → 1.0.223

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oddsgate-ds",
3
- "version": "1.0.222",
3
+ "version": "1.0.223",
4
4
  "description": "Miew theme component library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -11,12 +11,18 @@ const CategoryIndex: React.FC<CategoryIndexProps> = ({
11
11
  onChange,
12
12
  selectedCategory
13
13
  }) => {
14
+
15
+ const isNumber = selectedCategory && !isNaN(Number(selectedCategory))
16
+ const selected = isNumber
17
+ ? categories.find(cat => cat.name === '#')?.slug
18
+ : selectedCategory
19
+
14
20
  return (
15
21
  <StyledGlossaryCategoryIndex>
16
22
  {categories.map(category => (
17
23
  <StyledGlossaryCategoryIndexItem
18
24
  onClick={() => onChange(category.slug)}
19
- isSelected={selectedCategory === category.slug}
25
+ isSelected={selected === category.slug}
20
26
  key={`category-${category.slug}`}
21
27
  >
22
28
  {category.name}