mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
FIX mobile view
Just some small props fixes
This commit is contained in:
parent
9370ebda94
commit
30941afe84
@ -44,7 +44,7 @@ const App = React.memo(({ viewMode, layout }) => {
|
||||
return <div />;
|
||||
}
|
||||
if (width < 600) {
|
||||
return <Mobile {...props} viewMode={viewMode} />;
|
||||
return <Mobile {...props} viewMode={viewMode} options={layout} />;
|
||||
}
|
||||
return <Desktop {...props} viewMode={viewMode} options={layout} />;
|
||||
}}
|
||||
|
@ -113,12 +113,12 @@ class Mobile extends Component {
|
||||
|
||||
const { options } = props;
|
||||
this.state = {
|
||||
active: options.initialActive,
|
||||
active: !!options.initialActive,
|
||||
};
|
||||
}
|
||||
|
||||
render() {
|
||||
const { Nav, Preview, Panel, pages, viewMode, storyId, options, path } = this.props;
|
||||
const { Nav, Preview, Panel, pages, viewMode, options } = this.props;
|
||||
const { active } = this.state;
|
||||
|
||||
return (
|
||||
@ -130,8 +130,6 @@ class Mobile extends Component {
|
||||
<Preview
|
||||
isToolshown={options.isToolshown}
|
||||
id="main"
|
||||
path={path}
|
||||
storyId={storyId}
|
||||
viewMode={viewMode}
|
||||
debug={options}
|
||||
/>
|
||||
@ -174,8 +172,6 @@ Mobile.propTypes = {
|
||||
})
|
||||
).isRequired,
|
||||
viewMode: PropTypes.oneOf(['story', 'info']),
|
||||
storyId: PropTypes.string.isRequired,
|
||||
path: PropTypes.string.isRequired,
|
||||
options: PropTypes.shape({
|
||||
initialActive: PropTypes.number,
|
||||
}).isRequired,
|
||||
|
Loading…
x
Reference in New Issue
Block a user