Skip to content

Commit

Permalink
create link from login to control panel
Browse files Browse the repository at this point in the history
  • Loading branch information
joelmendez1 authored and mredigonda committed May 26, 2022
1 parent d3b47ea commit 444a203
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 4 deletions.
19 changes: 16 additions & 3 deletions client/src/app/main/main-layout-footer.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
import React from 'react';
import {connect} from 'react-redux';
import classNames from 'classnames';
import i18n from 'lib-app/i18n';

class MainLayoutFooter extends React.Component {

render() {
const {adminPanelOpened, userLogged} = this.props

return (
<div className={this.getClass()}>
{this.props.adminPanelOpened ? this.renderExtraLinks() : null}
{adminPanelOpened ? this.renderExtraLinks() : null}
{!userLogged ? this.renderAdminAccess() : null}
<div className="main-layout-footer__powered">
Powered by <a className="main-layout-footer__os-link" href="http://www.opensupports.com/" target="_blank">OpenSupports</a>
<span> {this.props.adminPanelOpened ? `v${opensupports_version}` : null}</span>
<span> {adminPanelOpened ? `v${opensupports_version}` : null}</span>
</div>
</div>
);
Expand All @@ -24,6 +28,14 @@ class MainLayoutFooter extends React.Component {
);
}

renderAdminAccess() {
return (
<div className="main-layout-footer__admin-access">
<a className="main-layout-footer__admin-access-link" href="/admin">{i18n('ADMIN_ACCESS')}</a>
</div>
);
}

getClass() {
let classes = {
'main-layout-footer': true,
Expand All @@ -36,6 +48,7 @@ class MainLayoutFooter extends React.Component {

export default connect((store) => {
return {
adminPanelOpened: store.session.staff
adminPanelOpened: store.session.staff,
userLogged: store.session.logged
};
})(MainLayoutFooter);
16 changes: 16 additions & 0 deletions client/src/app/main/main-layout-footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,22 @@
}
}

&__admin-access {
padding: 8px 30px 0 0;
font-size: 16px;
font-weight: 500;

&-link {
text-decoration: none;
color: $secondary-red;
&:hover,
&:focus {
text-decoration: none;
color: black;
}
}
}

&__os-link {
color: $secondary-red;
}
Expand Down
7 changes: 6 additions & 1 deletion client/src/app/main/main-layout.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@import "../../scss/vars";


.main-layout {
margin: 0 auto;
background-color: $grey;
Expand Down Expand Up @@ -28,4 +27,10 @@
padding: 20px 0;
}
}

&-footer {
display: flex;
justify-content: flex-end;
align-items: center;
}
}
1 change: 1 addition & 0 deletions client/src/data/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ export default {
'ADMIN_EMAIL': 'Admin account email',
'ADMIN_PASSWORD': 'Admin account password',
'ADMIN_PASSWORD_DESCRIPTION': 'Please remember this password. It is needed for accessing the admin panel. You can change it later.',
'ADMIN_ACCESS': 'Admin Access',
'INSTALLATION_COMPLETED_TITLE': 'Installation completed',
'INSTALLATION_COMPLETED_DESCRIPTION': 'The installation of OpenSupports is completed. Redirecting to admin panel...',

Expand Down

0 comments on commit 444a203

Please sign in to comment.