mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-08 22:33:24 +00:00
Hide searchbar for core internal modules
This commit is contained in:
@@ -23,6 +23,7 @@ export default class AvailableModulesMenu extends TranslatedComponent {
|
||||
static propTypes = {
|
||||
onSelect: PropTypes.func.isRequired,
|
||||
diffDetails: PropTypes.func,
|
||||
hideSearch: PropTypes.bool,
|
||||
m: PropTypes.object,
|
||||
warning: PropTypes.func,
|
||||
slotDiv: PropTypes.object
|
||||
@@ -196,7 +197,7 @@ export default class AvailableModulesMenu extends TranslatedComponent {
|
||||
* @returns {React.Component} Search component if available
|
||||
*/
|
||||
_showSearch() {
|
||||
if (this.props.modules instanceof Array) {
|
||||
if (this.props.hideSearch) {
|
||||
return;
|
||||
}
|
||||
return (
|
||||
|
||||
@@ -25,11 +25,12 @@ const HARDPOINT_SLOT_LABELS = {
|
||||
export default class Slot extends TranslatedComponent {
|
||||
static propTypes = {
|
||||
currentMenu: PropTypes.any,
|
||||
hideSearch: PropTypes.bool,
|
||||
m: PropTypes.instanceOf(Module),
|
||||
warning: PropTypes.func,
|
||||
drag: PropTypes.func,
|
||||
drop: PropTypes.func,
|
||||
dropClass: PropTypes.string
|
||||
dropClass: PropTypes.string,
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -188,7 +189,7 @@ export default class Slot extends TranslatedComponent {
|
||||
render() {
|
||||
let language = this.context.language;
|
||||
let translate = language.translate;
|
||||
let { currentMenu, m, dropClass, dragOver, warning } = this.props;
|
||||
let { currentMenu, m, dropClass, dragOver, warning, hideSearch } = this.props;
|
||||
const { menuIndex } = this.state;
|
||||
|
||||
// TODO: implement touch dragging
|
||||
@@ -209,7 +210,7 @@ export default class Slot extends TranslatedComponent {
|
||||
</div>
|
||||
{selected && menuIndex === 0 &&
|
||||
<AvailableModulesMenu
|
||||
m={m}
|
||||
m={m} hideSearch={hideSearch}
|
||||
onSelect={(item) => {
|
||||
m.setItem(item);
|
||||
this.context.closeMenu();
|
||||
|
||||
@@ -91,7 +91,7 @@ export default class StandardSlotSection extends SlotSection {
|
||||
*/
|
||||
_mkSlot(m, warning) {
|
||||
const { currentMenu } = this.props;
|
||||
return <Slot key={m.getSlot()} m={m} warning={warning}
|
||||
return <Slot key={m.getSlot()} m={m} warning={warning} hideSearch={true}
|
||||
currentMenu={currentMenu}
|
||||
/>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user