@rpg-engine/long-bow 0.7.93 → 0.7.94
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 +19 -11
- 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 +19 -11
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/CraftBook/CraftBook.tsx +43 -37
package/package.json
CHANGED
|
@@ -123,23 +123,27 @@ export const CraftBook: React.FC<IItemCraftSelectorProps> = ({
|
|
|
123
123
|
};
|
|
124
124
|
|
|
125
125
|
const categoryOptions: IOptionsProps[] = [
|
|
126
|
-
'Suggested',
|
|
127
|
-
...(pinnedItems.length > 0
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
.
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
126
|
+
{ id: 0, value: 'Suggested', option: 'Suggested' },
|
|
127
|
+
...(pinnedItems.length > 0
|
|
128
|
+
? [{ id: 1, value: 'Pinned', option: 'Pinned' }]
|
|
129
|
+
: []),
|
|
130
|
+
...Object.keys(ItemSubType)
|
|
131
|
+
.filter(type => type !== 'DeadBody')
|
|
132
|
+
.map((type, index) => ({
|
|
133
|
+
id: index + (pinnedItems.length > 0 ? 2 : 1),
|
|
134
|
+
value: type,
|
|
135
|
+
option:
|
|
136
|
+
type === 'CraftingResources' || type === 'CraftingResource'
|
|
137
|
+
? 'Resources'
|
|
138
|
+
: type,
|
|
139
|
+
})),
|
|
140
|
+
].sort((a, b) => {
|
|
141
|
+
if (a.value === 'Suggested') return -1;
|
|
142
|
+
if (b.value === 'Suggested') return 1;
|
|
143
|
+
if (a.value === 'Pinned') return -1;
|
|
144
|
+
if (b.value === 'Pinned') return 1;
|
|
145
|
+
return a.value.localeCompare(b.value);
|
|
146
|
+
});
|
|
143
147
|
|
|
144
148
|
const filteredCraftableItems = items?.filter(item => {
|
|
145
149
|
const matchesSearch = item.name
|
|
@@ -246,25 +250,27 @@ export const CraftBook: React.FC<IItemCraftSelectorProps> = ({
|
|
|
246
250
|
</RadioInputScroller>
|
|
247
251
|
</ContentContainer>
|
|
248
252
|
|
|
249
|
-
|
|
250
|
-
<
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
253
|
+
{totalPages > 1 && (
|
|
254
|
+
<PaginationContainer>
|
|
255
|
+
<PaginationButton
|
|
256
|
+
onClick={() => setCurrentPage(prev => Math.max(1, prev - 1))}
|
|
257
|
+
disabled={currentPage === 1}
|
|
258
|
+
>
|
|
259
|
+
<FaChevronLeft size={12} />
|
|
260
|
+
</PaginationButton>
|
|
261
|
+
<PageInfo>
|
|
262
|
+
Page {currentPage} of {totalPages}
|
|
263
|
+
</PageInfo>
|
|
264
|
+
<PaginationButton
|
|
265
|
+
onClick={() =>
|
|
266
|
+
setCurrentPage(prev => Math.min(totalPages, prev + 1))
|
|
267
|
+
}
|
|
268
|
+
disabled={currentPage === totalPages}
|
|
269
|
+
>
|
|
270
|
+
<FaChevronRight size={12} />
|
|
271
|
+
</PaginationButton>
|
|
272
|
+
</PaginationContainer>
|
|
273
|
+
)}
|
|
268
274
|
|
|
269
275
|
<Footer>
|
|
270
276
|
<Button buttonType={ButtonTypes.RPGUIButton} onPointerDown={onClose}>
|
|
@@ -403,7 +409,7 @@ const RadioInputScroller = styled.div`
|
|
|
403
409
|
display: grid;
|
|
404
410
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
405
411
|
gap: 16px;
|
|
406
|
-
align-
|
|
412
|
+
align-content: start;
|
|
407
413
|
|
|
408
414
|
@media (max-width: ${mobilePortrait.width}) {
|
|
409
415
|
grid-template-columns: 1fr;
|