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