diff --git a/src/handbook/package-lock.json b/src/handbook/package-lock.json index e826ef168..12186b8f7 100644 --- a/src/handbook/package-lock.json +++ b/src/handbook/package-lock.json @@ -7,6 +7,7 @@ "": { "name": "handbook", "version": "0.1.0", + "hasInstallScript": true, "dependencies": { "events": "^3.3.0", "react": "^18.2.0", @@ -16,7 +17,6 @@ "devDependencies": { "@rollup/plugin-dsv": "^3.0.2", "@types/events": "^3.0.0", - "@types/node": "^18.15.11", "@types/react": "^18.0.28", "@types/react-dom": "^18.0.11", "@types/react-virtualized": "^9.21.21", @@ -750,7 +750,9 @@ "version": "18.15.11", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz", "integrity": "sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "node_modules/@types/parse-json": { "version": "4.0.0", @@ -4083,7 +4085,9 @@ "version": "18.15.11", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz", "integrity": "sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "@types/parse-json": { "version": "4.0.0", diff --git a/src/handbook/src/backend/data.ts b/src/handbook/src/backend/data.ts index f1c396ad4..76c74d4dd 100644 --- a/src/handbook/src/backend/data.ts +++ b/src/handbook/src/backend/data.ts @@ -31,7 +31,7 @@ export const sortedItems: TaggedItems = { * Sorts all items into their respective categories. */ export function setup(): void { - getItems().forEach(item => { + getItems().forEach((item) => { switch (item.type) { case ItemType.Weapon: sortedItems[ItemCategory.Weapon].push(item); diff --git a/src/handbook/src/ui/components/VirtualizedGrid.tsx b/src/handbook/src/ui/components/VirtualizedGrid.tsx index 4a99bef8b..631c53fc9 100644 --- a/src/handbook/src/ui/components/VirtualizedGrid.tsx +++ b/src/handbook/src/ui/components/VirtualizedGrid.tsx @@ -48,12 +48,17 @@ class VirtualizedGrid extends React.Component, IState> { } return ( -
- {items.map((item, index) => -
{item}
)} +
+ {items.map((item, index) => ( +
{item}
+ ))}
); @@ -65,12 +70,14 @@ class VirtualizedGrid extends React.Component, IState> { return ( {({ height, width }) => ( - this.setState({ scrollTop: e.scrollTop })} + this.setState({ scrollTop: e.scrollTop })} /> )} diff --git a/src/handbook/src/ui/pages/ItemsPage.tsx b/src/handbook/src/ui/pages/ItemsPage.tsx index d28269588..1c9381819 100644 --- a/src/handbook/src/ui/pages/ItemsPage.tsx +++ b/src/handbook/src/ui/pages/ItemsPage.tsx @@ -91,23 +91,25 @@ class ItemsPage extends React.Component<{}, IState> {

Items

-
- { - items.length > 0 ? ( - this.showItem(item))} itemHeight={64} - itemsPerRow={20} gap={5} itemGap={5} - render={(item) => } - /> - ) : undefined - } + {items.length > 0 ? ( + this.showItem(item))} + itemHeight={64} + itemsPerRow={20} + gap={5} + itemGap={5} + render={(item) => } + /> + ) : undefined}
); } diff --git a/src/handbook/src/ui/widgets/Item.tsx b/src/handbook/src/ui/widgets/Item.tsx index e7d1dab87..b0e1f2532 100644 --- a/src/handbook/src/ui/widgets/Item.tsx +++ b/src/handbook/src/ui/widgets/Item.tsx @@ -37,8 +37,7 @@ class Item extends React.Component { } private forceReplace(): void { - if (!this.state.loaded) - this.replaceIcon(); + if (!this.state.loaded) this.replaceIcon(); } componentDidMount() { @@ -54,21 +53,20 @@ class Item extends React.Component { return (
- { this.state.icon && {this.props.data.name} this.setState({ loaded: true })} - /> } + {this.state.icon && ( + {this.props.data.name} this.setState({ loaded: true })} + /> + )} - { (!this.state.loaded || !this.state.icon) && -

{this.props.data.name}

} + {(!this.state.loaded || !this.state.icon) &&

{this.props.data.name}

}
-
- -
+
); } diff --git a/src/handbook/src/utils.ts b/src/handbook/src/utils.ts index 2c9ccc331..49fe950f3 100644 --- a/src/handbook/src/utils.ts +++ b/src/handbook/src/utils.ts @@ -47,9 +47,12 @@ export function itemIcon(item: Item): string { } switch (item.type) { - default: return `https://api.ambr.top/assets/UI/UI_${item.icon}.png`; - case ItemType.Furniture: return `https://api.ambr.top/assets/UI/furniture/UI_${item.icon}.png`; - case ItemType.Reliquary: return `https://api.ambr.top/assets/UI/reliquary/UI_${item.icon}.png`; + default: + return `https://api.ambr.top/assets/UI/UI_${item.icon}.png`; + case ItemType.Furniture: + return `https://api.ambr.top/assets/UI/furniture/UI_${item.icon}.png`; + case ItemType.Reliquary: + return `https://api.ambr.top/assets/UI/reliquary/UI_${item.icon}.png`; } }