Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(layouts): add layout examples #1039

Merged
merged 90 commits into from
Jul 18, 2017

Conversation

iamcaleberic
Copy link
Contributor

@iamcaleberic iamcaleberic commented Dec 16, 2016

TODO

  • Theming
  • Responsive
  • Grid
  • Attached Content
  • Bootstrap Migration
  • Homepage
  • Sticky
  • Fixed Menu
  • Login Form

Fixes #836

@iamcaleberic
Copy link
Contributor Author

iamcaleberic commented Dec 16, 2016

@levithomason Would like your thoughts on current implementation before i continue with the porting

issues currently having

  • Routing i.e in currently main routes file ? Do I need to change this for the layout examples
  • Showing source for layout examples

@codecov-io
Copy link

codecov-io commented Dec 16, 2016

Codecov Report

Merging #1039 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1039   +/-   ##
=======================================
  Coverage   99.75%   99.75%           
=======================================
  Files         144      144           
  Lines        2463     2463           
=======================================
  Hits         2457     2457           
  Misses          6        6

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c194992...8ab0814. Read the comment docs.

@levithomason
Copy link
Member

Here's what I'm thinking.

Structure

We put layout examples in /docs/app/layouts to keep them separate from the component examples. Then, we make the routes dynamic by creating a Webpack context of this directory.

I'm thinking the layouts need to render as a full page view without the sidebar in order to be effective. I'll need to rework some components to make this happen.

Showing source

Again, I think this needs to be done differently that in the current examples. What if we showed a circular floating button in one of the corners of the every layout, when clicked, we could show the source. Perhaps we would show source in a modal over the layout itself, or, we could toggle the entire page from the rendered view to the source editor and back.

I think the primary concern here is that the source will be very large so we'll likely need to take up the entire page, or at least most of it.


If you can move the layout to be in the directory structure proposed above, I'll come back to this PR and update it to handle the routes and showing source for layouts as soon as I can.

@iamcaleberic
Copy link
Contributor Author

  • I agree on the layouts being full page view
  • I think we can toggle between the view and the source editor for showing source

@levithomason
Copy link
Member

Great! If you want to take a stab at any of that, please do. Otherwise, I'll get to this as soon as I am able.

import { Header, Segment, Container, Divider, Card } from 'semantic-ui-react'

const LayoutsExample = () => (
<Container as='div'>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heads up, the default component class is div so we can remove all as='div' props since it is redundant.


const LayoutsExample = () => (
<Container as='div'>
<Segment masthead vertical>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no masthead prop, let's remove that.

<Divider hidden />
</Container>
</Segment>
<Container as='div' className='main intro'>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also remove className='main intro', we shouldn't have any extra classNames on the layouts as we have no additional styles to apply. If the layouts require additional custom styling on top of the default theme, then we'll have to reconsider how we go about that.

<Segment masthead vertical>
<Container as='div'>
<Header as='h1'> Layouts
<div className='sub header'>Examples of using Semantic UI React</div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we can use <Header.Subheader /> instead of className.

@levithomason
Copy link
Member

I'm adding route support for the view ATM, I'll address some of the other issues as well.

@levithomason
Copy link
Member

OK, I've stubbed out the routes and layout files themselves. I also included a back button automatically for the layout views. You should be good to simply update the layout files. Let me know if you run into any issues 👍

@iamcaleberic
Copy link
Contributor Author

@levithomason thanks alot

@levithomason
Copy link
Member

No problem, ping me when the other layouts are in and I'll make sure to get the full page source and editor going.

@levithomason levithomason changed the title Layout examples docs(layouts): add layout examples Jan 25, 2017
@iamcaleberic
Copy link
Contributor Author

iamcaleberic commented Apr 20, 2017

@levithomason I was updating the stream from master but alot has changed quite significantly and I have alot of conflicts.
Tried fixing some but am a bit stuck now. Please assist.

@levithomason
Copy link
Member

Yep, I'll label this issue for assistance and @layershifter or myself will get to it soon.

@iamcaleberic
Copy link
Contributor Author

@layershifter managed to get all the layouts up but without styling

Copy link
Member

@layershifter layershifter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated all examples, fixed styling and merge conflicts. @levithomason we're ready for initial review there

BTW, @iamcaleberic thanks for your work there!

@iamcaleberic
Copy link
Contributor Author

@layershifter thanks for the assist in completing this....

@levithomason levithomason merged commit 292c595 into Semantic-Org:master Jul 18, 2017
@levithomason
Copy link
Member

Thank you @iamcaleberic and @layershifter for pushing this one over the finish line!

@levithomason
Copy link
Member

Released in [email protected]

@jjwilliams42
Copy link

This is awesome! Thank you so much for this contribution, I've been looking for full blown layout examples. I was wondering, I noticed the "Home Page" example on regular SUI has a responsive hamburger menu, does SUI React not support this?

@snekse
Copy link

snekse commented Jan 11, 2018

Yeah, I think @jackjwilliams found a bug.

https://semantic-ui.com/examples/homepage.html
vs.
https://react.semantic-ui.com/layouts/homepage

@Semantic-Org Semantic-Org locked as resolved and limited conversation to collaborators Jan 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants