@rpg-engine/long-bow 0.7.92 → 0.7.93
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/long-bow.cjs.development.js +8 -2
- package/dist/long-bow.cjs.development.js.map +1 -1
- package/dist/long-bow.cjs.production.min.js +1 -1
- package/dist/long-bow.cjs.production.min.js.map +1 -1
- package/dist/long-bow.esm.js +8 -2
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/CraftBook/CraftBook.tsx +7 -2
package/package.json
CHANGED
|
@@ -84,6 +84,11 @@ export const CraftBook: React.FC<IItemCraftSelectorProps> = ({
|
|
|
84
84
|
[]
|
|
85
85
|
);
|
|
86
86
|
const [currentPage, setCurrentPage] = useState(1);
|
|
87
|
+
const [items, setItems] = useState<ICraftableItem[]>(craftablesItems);
|
|
88
|
+
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
setItems(craftablesItems);
|
|
91
|
+
}, [craftablesItems]);
|
|
87
92
|
|
|
88
93
|
useEffect(() => {
|
|
89
94
|
const handleResize = (): void => {
|
|
@@ -136,14 +141,14 @@ export const CraftBook: React.FC<IItemCraftSelectorProps> = ({
|
|
|
136
141
|
option: type,
|
|
137
142
|
}));
|
|
138
143
|
|
|
139
|
-
const filteredCraftableItems =
|
|
144
|
+
const filteredCraftableItems = items?.filter(item => {
|
|
140
145
|
const matchesSearch = item.name
|
|
141
146
|
.toLowerCase()
|
|
142
147
|
.includes(searchTerm.toLowerCase());
|
|
143
148
|
const matchesCategory =
|
|
144
149
|
selectedType === 'Suggested' ||
|
|
145
150
|
(selectedType === 'Pinned' && pinnedItems.includes(item.key)) ||
|
|
146
|
-
item.
|
|
151
|
+
item.subType === selectedType;
|
|
147
152
|
return matchesSearch && matchesCategory;
|
|
148
153
|
});
|
|
149
154
|
|