Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Add welcome to top left menu for all
Browse files Browse the repository at this point in the history
  • Loading branch information
jryans committed Feb 13, 2019
1 parent 22789ad commit 116367f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions res/css/views/context_menus/_TopLeftMenu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ limitations under the License.
mask-image: url('$(res)/img/feather-icons/home.svg');
}

li.mx_TopLeftMenu_icon_welcome::after {
mask-image: url('$(res)/img/feather-icons/gift.svg');
}

li.mx_TopLeftMenu_icon_settings::after {
mask-image: url('$(res)/img/feather-icons/settings.svg');
}
Expand Down
1 change: 1 addition & 0 deletions res/img/feather-icons/gift.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/components/views/context_menus/TopLeftMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import MatrixClientPeg from '../../../MatrixClientPeg';
export class TopLeftMenu extends React.Component {
constructor() {
super();
this.viewHomePage = this.viewHomePage.bind(this);
this.viewWelcomePage = this.viewWelcomePage.bind(this);
this.openSettings = this.openSettings.bind(this);
this.signIn = this.signIn.bind(this);
this.signOut = this.signOut.bind(this);
Expand Down Expand Up @@ -65,6 +67,9 @@ export class TopLeftMenu extends React.Component {

return <div className="mx_TopLeftMenu">
{homePageSection}
<ul className="mx_TopLeftMenu_section">
<li className="mx_TopLeftMenu_icon_welcome" onClick={this.viewWelcomePage}>{_t("Welcome")}</li>
</ul>
<ul className="mx_TopLeftMenu_section">
<li className="mx_TopLeftMenu_icon_settings" onClick={this.openSettings}>{_t("Settings")}</li>
</ul>
Expand All @@ -77,6 +82,11 @@ export class TopLeftMenu extends React.Component {
this.closeMenu();
}

viewWelcomePage() {
dis.dispatch({action: 'view_welcome_page'});
this.closeMenu();
}

openSettings() {
dis.dispatch({action: 'view_user_settings'});
this.closeMenu();
Expand Down
1 change: 1 addition & 0 deletions src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -1221,6 +1221,7 @@
"View Community": "View Community",
"Hide": "Hide",
"Sign in": "Sign in",
"Welcome": "Welcome",
"Login": "Login",
"powered by Matrix": "powered by Matrix",
"Robot check is currently unavailable on desktop - please use a <a>web browser</a>": "Robot check is currently unavailable on desktop - please use a <a>web browser</a>",
Expand Down

0 comments on commit 116367f

Please sign in to comment.