mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 19:16:41 +07:00
panels: fixed map list and user menu
This commit is contained in:
parent
43f4b5cda0
commit
45fd758c1d
3 changed files with 37 additions and 5 deletions
|
@ -16,8 +16,10 @@ import { DIALOGS } from '$constants/dialogs';
|
|||
|
||||
type Props = {
|
||||
user: UserType,
|
||||
dialog_active: Boolean,
|
||||
dialog: String,
|
||||
|
||||
userLogout: Function,
|
||||
setUser: Function,
|
||||
setDialog: Function,
|
||||
gotVkUser: Function,
|
||||
};
|
||||
|
@ -75,7 +77,7 @@ export class Component extends React.PureComponent<Props, void> {
|
|||
|
||||
render() {
|
||||
const {
|
||||
props: { user },
|
||||
props: { user, dialog, dialog_active },
|
||||
state: { menuOpened },
|
||||
} = this;
|
||||
|
||||
|
@ -100,7 +102,10 @@ export class Component extends React.PureComponent<Props, void> {
|
|||
|
||||
<div className="control-bar">
|
||||
<button
|
||||
className={classnames({ disabled: route_count <= 0 })}
|
||||
className={classnames({
|
||||
disabled: route_count <= 0,
|
||||
active: dialog_active && (dialog === DIALOGS.MAP_LIST)
|
||||
})}
|
||||
onClick={this.openMapsDialog}
|
||||
>
|
||||
<Icon icon="icon-folder-1" />
|
||||
|
@ -113,7 +118,7 @@ export class Component extends React.PureComponent<Props, void> {
|
|||
}
|
||||
|
||||
|
||||
const mapStateToProps = ({ user: { dialog, user } }) => ({ dialog, user });
|
||||
const mapStateToProps = ({ user: { dialog, dialog_active, user } }) => ({ dialog, dialog_active, user });
|
||||
const mapDispatchToProps = dispatch => bindActionCreators({
|
||||
setUser,
|
||||
userLogout,
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import React from 'react';
|
||||
import { CLIENT } from '$config/frontend';
|
||||
|
||||
type Props = {
|
||||
userLogout: Function,
|
||||
|
@ -6,7 +7,15 @@ type Props = {
|
|||
|
||||
export const UserMenu = ({ userLogout }: Props) => (
|
||||
<div className="user-panel-menu">
|
||||
<a className="user-panel-item gray" href="https://github.com/muerwre/orchidMap" target="_blank" rel="noopener noreferrer">
|
||||
<div className="user-panel-title">
|
||||
ORCHID
|
||||
<br />
|
||||
MAP
|
||||
<span className="user-panel-ver">
|
||||
- { CLIENT.VER }
|
||||
</span>
|
||||
</div>
|
||||
<a className="user-panel-item" href="https://github.com/muerwre/orchidMap" target="_blank" rel="noopener noreferrer">
|
||||
Проект на github
|
||||
</a>
|
||||
<div className="user-panel-item" onClick={userLogout}>
|
||||
|
|
|
@ -76,6 +76,24 @@
|
|||
box-sizing: border-box;
|
||||
z-index: -1
|
||||
}
|
||||
.user-panel-title {
|
||||
font-size: 20px;
|
||||
padding: 10px;
|
||||
|
||||
background: rgba(0,0,0, 0.5);
|
||||
box-shadow: inset rgba(255,255,255,0.1) 0 -1px;
|
||||
border-radius: @panel_radius @panel_radius 0 0;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.user-panel-ver {
|
||||
font-size: 12px;
|
||||
vertical-align: text-top;
|
||||
opacity: 0.5;
|
||||
padding-left: 3px;
|
||||
position: relative;
|
||||
top: 3px;
|
||||
}
|
||||
|
||||
.user-panel-item {
|
||||
padding: 10px 10px;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue