mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-26 03:26:41 +07:00
backend: route list icon
This commit is contained in:
parent
6ffdca22d7
commit
5aae945517
5 changed files with 37 additions and 6 deletions
|
@ -1,7 +1,7 @@
|
|||
import React from 'react';
|
||||
|
||||
import { GuestButton } from '$components/user/GuestButton';
|
||||
import { SERVER, TEST } from '$constants/api';
|
||||
import { TEST } from '$constants/api';
|
||||
import { DEFAULT_USER, ROLES } from '$constants/auth';
|
||||
import { UserButton } from '$components/user/UserButton';
|
||||
import { UserMenu } from '$components/user/UserMenu';
|
||||
|
@ -11,6 +11,8 @@ import { connect } from 'react-redux';
|
|||
import type { UserType } from '$constants/types';
|
||||
import { Icon } from '$components/panels/Icon';
|
||||
|
||||
import classnames from 'classnames';
|
||||
|
||||
type Props = {
|
||||
user: UserType,
|
||||
userLogout: Function,
|
||||
|
@ -73,6 +75,8 @@ export class Component extends React.PureComponent<Props, void> {
|
|||
state: { menuOpened },
|
||||
} = this;
|
||||
|
||||
const route_count = Object.keys(user.routes).length;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="panel active">
|
||||
|
@ -92,9 +96,14 @@ export class Component extends React.PureComponent<Props, void> {
|
|||
|
||||
<div className="control-bar">
|
||||
<button
|
||||
onClick={this.props.takeAShot}
|
||||
className={classnames({ disabled: route_count <= 0 })}
|
||||
// onClick={this.props.takeAShot}
|
||||
>
|
||||
<Icon icon="icon-shot-2" />
|
||||
<Icon icon="icon-folder-1" />
|
||||
{
|
||||
route_count > 0 &&
|
||||
<div className="control-bar-counter">{route_count < 100 ? route_count : '...'}</div>
|
||||
}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue