Closed trevordmiller closed 7 years ago
Example of List breakdown: https://zpl.io/ZddDih
Feel free to use it as example, I think it can easily carry a variety of different data.
There's a bridge between this list and list of lessons in IC -> in IC, there's a "responsive" / less wide version present, but overally it should be the same. I'm really just copying those lists in sketch and making them different width etc. If shaka team handles the responsivity right, it should be enough to re-use this component anywhere. ;)
Variations
I think that basic structure is the same for all of them, the rows differ though, I propose to use classes like this:
<list><task>
<list><task><actions>
<list><text><button>
but this is obviously your cup of tea. :)
edit: You could also say that list can be part of other card, like this:
This looks ready to go to me.
Sounds great. I'm moving this to the "Ready to implement" column. @tayiorbeii, would mind taking on this story? To be clear, it is just the promotion of the Instructor Center List
component to egghead-ui
. The examples Vojta posted are ways it will be composed in other components like LessonList
in egghead-rails
and are not included in this story.
I'm grabbing this since Taylor is busy with the tachyons-egghead simplifying forks.
The
List
component is currently implemented in the Instructor Center: https://github.com/eggheadio/egghead-instructor-center/blob/master/src/components/List/index.jsAll it does is accept a list of items, and renders them stacked vertically with A) a light border on the bottom of every item but the last and 2) equal padding around each item. It is often used inside of a
Card
component directly.egghead-rails is now using
List
: https://github.com/eggheadio/egghead-rails/pull/1211/files so it would be good to promote and consumed it in both projects from egghead-ui.Examples from mocks
List
was first designed in the Instructor Center mocks from @vojtaholik:Examples currently in Instructor Center
Example composition
In the instructor center, the
Card
component owns the border radius and drop shadow styling, list has none of that itself. So aList
is often put inside aCard
. You'll notice thisList
component is very simple. I much prefer these types of simple components that do just one thing, rather than have a bunch of config and formatting options. That way they can be composed together usingchildren
. Here is an example of how theegghead-rails
LessonList
could be created with composition of components likeList
:Card
would need to be promoted to egghead-ui as well; it only concerns itself with the rounded corners and drop shadow).List
- from this PR would be promoted to egghead-ui; it only concerns itself with borders and padding of items.LessonList
only exists inegghead-rails
and composes togetherCard
andList
with egghead-rails specific sub-components and logic like this:In summary: promote generic, single responsibility components in egghead-ui; then compose these things together with project specific logic and sub-components to create screens.
Here are a couple examples of this in the Instructor Center of how this type of minimal
children
composition works:Would be good to update the project README with a link to this PR as a complete example.