mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 11:06:40 +07:00
is_empty flag
This commit is contained in:
parent
a180e00ffb
commit
9b6ed74300
8 changed files with 43 additions and 19 deletions
|
@ -15,6 +15,10 @@ import { DIALOGS } from '$constants/dialogs';
|
|||
import { IRootState } from "$redux/user/reducer";
|
||||
|
||||
interface Props extends IRootState {
|
||||
is_empty: boolean,
|
||||
dialog: string,
|
||||
dialog_active: boolean,
|
||||
|
||||
userLogout: typeof userLogout,
|
||||
setDialog: typeof setDialog,
|
||||
setDialogActive: typeof setDialogActive,
|
||||
|
@ -89,7 +93,7 @@ export class Component extends React.PureComponent<Props, State> {
|
|||
|
||||
render() {
|
||||
const {
|
||||
props: { user, dialog, dialog_active },
|
||||
props: { user, dialog, dialog_active, is_empty },
|
||||
state: { menuOpened },
|
||||
} = this;
|
||||
|
||||
|
@ -131,17 +135,21 @@ export class Component extends React.PureComponent<Props, State> {
|
|||
<Icon icon="icon-shot-4" />
|
||||
</button>
|
||||
</div>
|
||||
{
|
||||
!is_empty &&
|
||||
<React.Fragment>
|
||||
<div className="control-sep" />
|
||||
|
||||
<div className="control-sep" />
|
||||
|
||||
<div className="control-bar">
|
||||
<button
|
||||
className={classnames({ active: false })}
|
||||
onClick={this.props.getGPXTrack}
|
||||
>
|
||||
<Icon icon="icon-gpx-1" />
|
||||
</button>
|
||||
</div>
|
||||
<div className="control-bar">
|
||||
<button
|
||||
className={classnames({ active: false })}
|
||||
onClick={this.props.getGPXTrack}
|
||||
>
|
||||
<Icon icon="icon-gpx-1" />
|
||||
</button>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
@ -149,7 +157,7 @@ export class Component extends React.PureComponent<Props, State> {
|
|||
}
|
||||
|
||||
|
||||
const mapStateToProps = ({ user: { dialog, dialog_active, user } }) => ({ dialog, dialog_active, user });
|
||||
const mapStateToProps = ({ user: { dialog, dialog_active, user, is_empty } }) => ({ dialog, dialog_active, user, is_empty });
|
||||
const mapDispatchToProps = dispatch => bindActionCreators({
|
||||
setUser,
|
||||
userLogout,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue