-
Notifications
You must be signed in to change notification settings - Fork 31
Conversation
This is great. Here's a list of common UI suggestions.
|
@@ -0,0 +1,165 @@ | |||
/* eslint-disable */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we get this via NPM?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just a bundle with svg images which I use in my menu. I have two reasons to put them into one file:
-
to don't bloat src with a bunch of image files
-
to don't add new dependency to project (I need here
file-loader
orbase64-image-loader
)
So I just prebuild it manually with base64-image-loader
. Maybe it could be usefull later if you'll want to extend it with more images? But if you don't like such approach could you suggest the better way how to get this images?
const root = ( | ||
<div> | ||
<Layout | ||
leftPanel={() => (<LeftPanel />)} | ||
leftPanel={(menu) => (<LeftPanel floatingMenu={menu} />)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like getting the menu from a function. Since we define the floatingMenu inside here. Let's use it directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I removed it from here
@mnmtanish could you review this too? |
Sure, I'll check it out today evening. |
I fixed it according your suggestion and updated demo page.
|
@@ -24,6 +24,21 @@ export function jumpToStory(storyKinds, selectedKind, selectedStory, direction) | |||
}; | |||
} | |||
|
|||
function jumpToKind(storyKinds, selectedKind, selectedStory, direction) { | |||
const currentIndex = storyKinds.findIndex(({ kind }) => (kind === selectedKind)); | |||
if (currentIndex === -1) return selectedKind; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we return both selectedKind
and selectedStory
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure! fixed :)
|
||
const linkStyle = { | ||
textDecoration: 'none', | ||
}; | ||
|
||
const Header = ({ openShortcutsHelp, name, url }) => ( | ||
const Header = ({/* openShortcutsHelp,*/ name, url }) => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just delete unused code, we can always git checkout
if we need them again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found some more below, check them too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
@@ -1,3 +1,4 @@ | |||
node_modules | |||
dist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this to a new PR, this one needs to be discussed more. Having dist
on the repo sucks but we did it anyway so that storybook could be installed from the Github repo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, no problem!
I just revert it and make npm run prepublish
before pushing
PREV_STORY: 7, | ||
SEARCH: 8, | ||
DOWN_PANEL_IN_RIGHT: 9 | ||
FULLSCREEN: 'FULLSCREEN', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it to strings because it was hard to setup tests for that. Now all test passed so if it matters I can revert it if you want!?
@@ -0,0 +1 @@ | |||
export FloatingMenu from './floating_menu'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ESLint complains here. Should I disable it here?
BTW don't you want to move 'text filter' also into this menu? (or add an item to hide it) |
@arunoda, @mnmtanish! |
Typescript declaration updates
Provide storybook context to render
…ils-15.3.1 [email protected] untested⚠️
Let's create a PR here: https://github.com/storybooks/storybook |
It implements #56
I moved all items from 'keyboard shortcuts' to menu wich avalibale in the left panel. And when the left panel is hidden it floats in the preview area. It also has buttons to browse through stories. It gives access to Storybook core functionalities both by a mouse and a touchscreen from normal and fullscreen view.
here is a demo page to check it on mobile device.