Skip to content

armgit / fider

Public Imported from GitHub
0

Open platform to collect and prioritize feedback

remove javascript from menu (#127)

Guilherme Oenning86bc472f25d7
diff --git a/public/assets/styles/main.scss b/public/assets/styles/main.scss
index 9c3938a98..01e7f1cb4 100644
--- a/public/assets/styles/main.scss
+++ b/public/assets/styles/main.scss
@@ -10,18 +10,22 @@ body {
background-color: $bg-color;
}
+#environment-info {
+ border-radius: 0px;
+}
+
#menu {
margin-top: 0px;
background-color: $menu-color;
margin-bottom: 30px;
height: 40px;
-
+ border-radius: 0px;
+
.fdr-avatar {
margin-right: 5px;
}
div, a {
- border: none;
color: textColorFor($menu-color);
}
@@ -39,7 +43,7 @@ body {
float: right;
}
-#menu a.subtitle,
+#menu div.subtitle,
.subtitle {
font-size: 11px;
font-weight: 600;
@@ -98,10 +102,6 @@ code {
vertical-align: middle;
}
-.no-border {
- border-radius: 0px !important;
-}
-
.no-margin {
margin: 0px !important;
}
diff --git a/public/components/common/EnvironmentInfo.tsx b/public/components/common/EnvironmentInfo.tsx
index 66af31ede..f4a9823bd 100644
--- a/public/components/common/EnvironmentInfo.tsx
+++ b/public/components/common/EnvironmentInfo.tsx
@@ -10,7 +10,7 @@ export class EnvironmentInfo extends React.Component<{}, {}> {
public render() {
if (!this.session.isProduction()) {
const settings = this.session.getAppSettings();
- return <div className="ui mini negative message no-border no-margin">
+ return <div id="environment-info" className=" ui mini negative message no-border no-margin">
Env: { settings.environment } |
Compiler: { settings.compiler } |
Version: { settings.version } |
diff --git a/public/components/common/Header.tsx b/public/components/common/Header.tsx
index cc95c58e8..d95ae1685 100644
--- a/public/components/common/Header.tsx
+++ b/public/components/common/Header.tsx
@@ -7,31 +7,18 @@ import { Session } from '@fider/services/Session';
import { showSignIn } from '@fider/utils/page';
export class Header extends React.Component<{}, {}> {
- private dropdown: HTMLElement;
- private list: HTMLElement;
- private user: User;
- private tenant: Tenant;
+ private user: User;
+ private tenant: Tenant;
- @inject(injectables.Session)
- public session: Session;
+ @inject(injectables.Session)
+ public session: Session;
- constructor(props: {}) {
- super(props);
+ constructor(props: {}) {
+ super(props);
- this.user = this.session.getCurrentUser();
- this.tenant = this.session.get<Tenant>('tenant');
- }
-
- public componentDidMount() {
- if (this.user) {
- $(this.dropdown).popup({
- inline: true,
- hoverable: true,
- popup: this.list,
- position : 'bottom right'
- });
- }
- }
+ this.user = this.session.getCurrentUser();
+ this.tenant = this.session.get<Tenant>('tenant');
+ }
private showModal() {
if (!this.user) {
@@ -40,39 +27,39 @@ export class Header extends React.Component<{}, {}> {
}
public render() {
- const items = <div className="ui divided list">
- {
- this.session.isStaff() &&
- <div className="item">
- <a href="/admin">
- Administration
- </a>
- </div>
- }
- <div className="item">
- <a className="signout" href="/signout?redirect=/">
- Sign out
- </a>
+ const items = <div className="menu">
+ {
+ this.session.isStaff() &&
+ <div className="header">
+ <i className="setting icon"></i>
+ Administration
</div>
- </div>;
+ }
+ {
+ this.session.isStaff() &&
+ <a href="/admin" className="item">General Settings</a>
+ }
+ {
+ this.session.isStaff() &&
+ <div className="divider"></div>
+ }
+ <a href="/signout?redirect=/" className="item signout">Sign out</a>
+ </div>;
return <div>
<EnvironmentInfo />
- <div id="menu" className="ui small menu no-border">
+ <div id="menu" className="ui small borderless menu">
<div className="ui container">
<a href="/" className="header item">
{ this.tenant.name }
</a>
- <a ref={(e) => { this.dropdown = e!; } } onClick={ () => this.showModal() } className={`item signin right ${!this.user.name && 'subtitle' }`}>
+ <div onClick={ () => this.showModal() } className={`ui right simple dropdown item signin ${!this.user.name && 'subtitle'}`}>
<Gravatar name={this.user.name} hash={this.user.gravatar} />
- { this.user.name || 'Sign in' }
- { this.user.name && <i className="dropdown icon"></i> }
- </a>
+ { this.user.name || 'Sign in' } { this.user.name && <i className="dropdown icon"></i> }
+ { this.user.name && items }
+ </div>
</div>
</div>
- <div ref={(e) => { this.list = e!; } } className="fdr-profile-popup ui popup transition hidden">
- { items }
- </div>
</div>;
}
}