Skip to content

Commit 5f1498c

Browse files
committed
web: move settings section to main menu
1 parent 906acbd commit 5f1498c

File tree

2 files changed

+25
-10
lines changed

2 files changed

+25
-10
lines changed

web/src/Header.tsx

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { CommandBar, ICommandBarItemProps } from 'office-ui-fabric-react/lib/Com
44
import { getTheme } from '@uifabric/styling';
55
import SettingsModal, {SettingsChanges} from './settings/SettingsModal';
66
import AboutModal from './AboutModal';
7+
import config from './services/config';
78
import {
89
Connect,
910
newImportFileDispatcher,
@@ -89,6 +90,16 @@ export class Header extends React.Component<any, HeaderState> {
8990
onClick: () => {
9091
this.props.dispatch(saveFileDispatcher);
9192
},
93+
},
94+
{
95+
key: 'settings',
96+
text: 'Settings',
97+
ariaLabel: 'Settings',
98+
iconProps: {iconName: 'Settings'},
99+
disabled: this.props.loading,
100+
onClick: () => {
101+
this.setState({showSettings: true});
102+
}
92103
}
93104
];
94105
}
@@ -122,21 +133,23 @@ export class Header extends React.Component<any, HeaderState> {
122133
get overflowItems(): ICommandBarItemProps[] {
123134
return [
124135
{
125-
key: 'settings',
126-
text: 'Settings',
127-
ariaLabel: 'Settings',
128-
iconOnly: true,
129-
iconProps: {iconName: 'Settings'},
130-
disabled: this.props.loading,
131-
onClick: () => {
132-
this.setState({showSettings: true});
133-
}
136+
key: 'new-issue',
137+
text: 'Submit Issue',
138+
ariaLabel: 'Submit Issue',
139+
iconProps: {iconName: 'Bug'},
140+
onClick: () => window.open(config.issueUrl, '_blank')
141+
},
142+
{
143+
key: 'donate',
144+
text: 'Donate',
145+
ariaLabel: 'Donate',
146+
iconProps: {iconName: 'Heart'},
147+
onClick: () => window.open(config.donateUrl, '_blank')
134148
},
135149
{
136150
key: 'about',
137151
text: 'About',
138152
ariaLabel: 'About',
139-
iconOnly: true,
140153
iconProps: {iconName: 'Info'},
141154
onClick: () => {
142155
this.setState({showAbout: true});

web/src/services/config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ export default {
4949
appVersion: getVariableValue('VERSION', '1.0.0'),
5050
serverUrl: getVariableValue('LANG_SERVER', window.location.origin),
5151
githubUrl: getVariableValue('GITHUB_URL', 'https://github.com/x1unix/go-playground'),
52+
issueUrl: getVariableValue('ISSUE_URL', 'https://github.com/x1unix/go-playground/issues/new'),
53+
donateUrl: getVariableValue('DONATE_URL', 'https://opencollective.com/bttr-go-playground'),
5254

5355
get darkThemeEnabled(): boolean {
5456
if (this._cache[DARK_THEME_KEY]) {

0 commit comments

Comments
 (0)