Skip to content

Commit

Permalink
Merge pull request #16108 from Nexus-Mods/rename-nav-title
Browse files Browse the repository at this point in the history
changed 'mods' nav title to game name
  • Loading branch information
insomnious committed Jul 31, 2024
2 parents 6dcf8c6 + fbe2e7a commit 7c114fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion __tests__/MainWindow.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function renderMainWindow() {
return input;
}

const api = { events: { on: () => undefined } };
const api = { events: { on: () => undefined }, getState: () => ({}) };

return shallow(<MainWindow objects={[]} t={ dummyT } api={api}/>);
}
Expand Down
10 changes: 8 additions & 2 deletions src/views/MainWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ import Settings from './Settings';
import WindowControls from './WindowControls';
import * as semver from 'semver';

import { profileById } from '../util/selectors';
import { getGame } from '../util/api';

import update from 'immutability-helper';
import * as _ from 'lodash';
import * as PropTypes from 'prop-types';
Expand Down Expand Up @@ -430,11 +433,14 @@ export class MainWindow extends React.Component<IProps, IMainWindowState> {

const pages = objects.map(obj => this.renderPage(obj));
pages.push(this.renderPage(this.settingsPage));

const state = this.props.api.getState();
const profile = profileById(state, this.props.activeProfileId);
const game = profile !== undefined ? getGame(profile.gameId) : undefined;
const gameName = game?.name || 'Mods';
const pageGroups = [
{ title: undefined, key: 'dashboard' },
{ title: 'General', key: 'global' },
{ title: 'Mods', key: 'per-game' },
{ title: gameName, key: 'per-game' },
{ title: 'About', key: 'support' },
];

Expand Down

0 comments on commit 7c114fd

Please sign in to comment.