Skip to content

Commit

Permalink
chore: add showBtn
Browse files Browse the repository at this point in the history
  • Loading branch information
zhpd committed Nov 25, 2021
1 parent 80585b4 commit dfcc497
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ interface PropsType {
title: string;
component: React.ReactNode;
};
showBtn?: boolean;
}

interface StateType {
Expand All @@ -44,6 +45,7 @@ class RNVConsole extends PureComponent<PropsType, StateType> {
static defaultProps = {
appInfo: {},
console: true,
showBtn: true,
};

private panResponder: PanResponderInstance;
Expand Down Expand Up @@ -234,7 +236,11 @@ class RNVConsole extends PureComponent<PropsType, StateType> {
}

render() {
return this.state.showPanel ? this.renderPanel() : this.renderHomeBtn();
return this.state.showPanel
? this.renderPanel()
: this.props.showBtn
? this.renderHomeBtn()
: null;
}
}

Expand Down

0 comments on commit dfcc497

Please sign in to comment.