Skip to content

Commit

Permalink
Merge pull request #868 from the-hideout/player-profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
Razzmatazzz authored Mar 11, 2024
2 parents ec52aa3 + 1ee5888 commit d7a376c
Show file tree
Hide file tree
Showing 9 changed files with 765 additions and 2 deletions.
30 changes: 30 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@mdi/react": "^1.6.1",
"@mui/lab": "^5.0.0-alpha.166",
"@mui/material": "^5.15.11",
"@mui/x-tree-view": "^6.17.0",
"@reduxjs/toolkit": "^2.2.1",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.2.1",
Expand Down
22 changes: 22 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ const ItemTracker = React.lazy(() => import('./pages/item-tracker/index.js'));
const Hideout = React.lazy(() => import('./pages/hideout/index.js'));
const WipeLength = React.lazy(() => import('./pages/wipe-length/index.js'));
const Achievements = React.lazy(() => import('./pages/achievements/index.js'));
const Players = React.lazy(() => import('./pages/players/index.js'));
const Player = React.lazy(() => import('./pages/player/index.js'));
const About = React.lazy(() => import('./pages/about/index.js'));

const APIDocs = React.lazy(() => import('./pages/api-docs/index.js'));
Expand Down Expand Up @@ -871,6 +873,26 @@ function App() {
remoteControlSessionElement,
]}
/>
<Route
path={'/players'}
key="players-route"
element={[
<Suspense fallback={<Loading />} key="suspense-players-wrapper">
<Players key="players-wrapper" />
</Suspense>,
remoteControlSessionElement,
]}
/>
<Route
path="/player/:accountId"
key="player-route"
element={[
<Suspense fallback={<Loading />} key="suspense-player-wrapper">
<Player />
</Suspense>,
remoteControlSessionElement,
]}
/>
<Route
path="*"
element={[
Expand Down
8 changes: 8 additions & 0 deletions src/components/menu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,14 @@ const Menu = () => {
{t('Achievements')}
</Link>
</li>
<li className="submenu-wrapper submenu-items overflow-member" key="menu-players" data-targetid="players">
<Link
to="/players"
//onClick={setIsOpen.bind(this, false)}
>
{t('Players')}
</Link>
</li>
<li className="submenu-wrapper submenu-items overflow-member" key="menu-api" data-targetid="api">
<Link
to="/api/"
Expand Down
9 changes: 7 additions & 2 deletions src/features/meta/do-fetch-meta.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ class MetaQuery extends APIQuery {
id
}
}
playerLevels {
level
exp
}
}`;

const metaData = await this.graphqlRequest(query);
Expand Down Expand Up @@ -61,13 +65,14 @@ class MetaQuery extends APIQuery {
prebuild || !metaData.data ||
!metaData.data.fleaMarket ||
!metaData.data.armorMaterials || !metaData.data.armorMaterials.length ||
!metaData.data.itemCategories || !metaData.data.itemCategories.length
!metaData.data.itemCategories || !metaData.data.itemCategories.length ||
!metaData.data.playerLevels
) {
return Promise.reject(new Error(metaData.errors[0].message));
}
}

return {flea: metaData.data.fleaMarket, armor: metaData.data.armorMaterials, categories: metaData.data.itemCategories};
return {flea: metaData.data.fleaMarket, armor: metaData.data.armorMaterials, categories: metaData.data.itemCategories, playerLevels: metaData.data.playerLevels};
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/pages/player/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.MuiTreeItem-iconContainer {
width: auto !important;
justify-content: normal !important;
}
Loading

0 comments on commit d7a376c

Please sign in to comment.