mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-10 15:23:40 -07:00
* New: Release Profiles - UI Updates * New: Release Profiles - API Changes * New: Release Profiles - Test Updates * New: Release Profiles - Backend Updates * New: Interactive Artist Search * New: Change Montiored on Album Details Page * New: Show Duration on Album Details Page * Fixed: Manual Import not working if no albums are Missing * Fixed: Sort search input by sortTitle * Fixed: Queue columnLabel throwing JS error
101 lines
2.5 KiB
JavaScript
101 lines
2.5 KiB
JavaScript
import PropTypes from 'prop-types';
|
|
import React, { Component } from 'react';
|
|
import { icons } from 'Helpers/Props';
|
|
import keyboardShortcuts, { shortcuts } from 'Components/keyboardShortcuts';
|
|
import IconButton from 'Components/Link/IconButton';
|
|
import Link from 'Components/Link/Link';
|
|
import ArtistSearchInputConnector from './ArtistSearchInputConnector';
|
|
import PageHeaderActionsMenuConnector from './PageHeaderActionsMenuConnector';
|
|
import KeyboardShortcutsModal from './KeyboardShortcutsModal';
|
|
import styles from './PageHeader.css';
|
|
|
|
class PageHeader extends Component {
|
|
|
|
//
|
|
// Lifecycle
|
|
|
|
constructor(props, context) {
|
|
super(props);
|
|
|
|
this.state = {
|
|
isKeyboardShortcutsModalOpen: false
|
|
};
|
|
}
|
|
|
|
componentDidMount() {
|
|
this.props.bindShortcut(shortcuts.OPEN_KEYBOARD_SHORTCUTS_MODAL.key, this.onOpenKeyboardShortcutsModal);
|
|
}
|
|
|
|
//
|
|
// Control
|
|
|
|
onOpenKeyboardShortcutsModal = () => {
|
|
this.setState({ isKeyboardShortcutsModalOpen: true });
|
|
}
|
|
|
|
//
|
|
// Listeners
|
|
|
|
onKeyboardShortcutsModalClose = () => {
|
|
this.setState({ isKeyboardShortcutsModalOpen: false });
|
|
}
|
|
|
|
//
|
|
// Render
|
|
|
|
render() {
|
|
const {
|
|
onSidebarToggle
|
|
} = this.props;
|
|
|
|
return (
|
|
<div className={styles.header}>
|
|
<div className={styles.logoContainer}>
|
|
<Link
|
|
className={styles.logoLink}
|
|
to={`${window.Lidarr.urlBase}/`}
|
|
>
|
|
<img
|
|
className={styles.logo}
|
|
src={`${window.Lidarr.urlBase}/Content/Images/logo.svg`}
|
|
/>
|
|
</Link>
|
|
</div>
|
|
|
|
<div className={styles.sidebarToggleContainer}>
|
|
<IconButton
|
|
id="sidebar-toggle-button"
|
|
name={icons.NAVBAR_COLLAPSE}
|
|
onPress={onSidebarToggle}
|
|
/>
|
|
</div>
|
|
|
|
<ArtistSearchInputConnector />
|
|
|
|
<div className={styles.right}>
|
|
<IconButton
|
|
className={styles.donate}
|
|
name={icons.HEART}
|
|
to="https://opencollective.com/lidarr"
|
|
size={14}
|
|
/>
|
|
<PageHeaderActionsMenuConnector
|
|
onKeyboardShortcutsPress={this.onOpenKeyboardShortcutsModal}
|
|
/>
|
|
</div>
|
|
|
|
<KeyboardShortcutsModal
|
|
isOpen={this.state.isKeyboardShortcutsModalOpen}
|
|
onModalClose={this.onKeyboardShortcutsModalClose}
|
|
/>
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
|
|
PageHeader.propTypes = {
|
|
onSidebarToggle: PropTypes.func.isRequired,
|
|
bindShortcut: PropTypes.func.isRequired
|
|
};
|
|
|
|
export default keyboardShortcuts(PageHeader);
|