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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
75bdba7
Added layouts to sidebar menu
iamcaleberic Dec 14, 2016
ffd926e
Added Layouts Example Component
iamcaleberic Dec 14, 2016
0c4d5d3
Added starter cards
iamcaleberic Dec 14, 2016
5738181
Added pages cards
iamcaleberic Dec 14, 2016
684b945
Cleaned up classnames
iamcaleberic Dec 14, 2016
b16ee29
Make cards stackable
iamcaleberic Dec 14, 2016
4c94904
Removed unused folder
iamcaleberic Dec 14, 2016
e5ea614
Added new layouts component
iamcaleberic Dec 14, 2016
5256a1f
Added layouts examples and Login Form component
iamcaleberic Dec 14, 2016
6b8125e
Removed examples index file
iamcaleberic Dec 16, 2016
99efd7c
Modified login form component
iamcaleberic Dec 16, 2016
3af6094
Added link to Login component
iamcaleberic Dec 16, 2016
d2e3968
Modified layouts folder
iamcaleberic Dec 16, 2016
3dab9f7
Modify login form component
iamcaleberic Dec 16, 2016
429371f
Resolved lint errors
iamcaleberic Dec 16, 2016
04c1b65
Resolved lint errors
iamcaleberic Dec 16, 2016
857ce1e
Modified layout structure
iamcaleberic Dec 19, 2016
c73bb0c
Removed unused layouts in examples
iamcaleberic Dec 19, 2016
4fcce6e
docs(layouts): add route support
levithomason Jan 24, 2017
aaf0936
docs(layouts): stub all layouts
levithomason Jan 24, 2017
be2c486
Added menu to layout
iamcaleberic Jan 27, 2017
637c55e
Added wireframe images
iamcaleberic Jan 30, 2017
bb0823f
Modified menu items
iamcaleberic Jan 30, 2017
840a7ba
Added footer inverted segmentnt
iamcaleberic Jan 30, 2017
1cfeb68
Modified inverted menu items
iamcaleberic Jan 30, 2017
f0c71cc
Modified image src to semantic ui react
iamcaleberic Jan 30, 2017
828fc96
Modified footer segment
iamcaleberic Jan 31, 2017
d678e50
Fix lint errors
iamcaleberic Jan 31, 2017
2fe4273
Switch to camel case
iamcaleberic Jan 31, 2017
48122a3
Added grid layout frameworks
iamcaleberic Feb 13, 2017
ea73945
Modified style file
iamcaleberic Feb 13, 2017
53afd17
Update grid layout
iamcaleberic Feb 15, 2017
8a76ef2
Update grid layout
iamcaleberic Feb 16, 2017
368eac4
Added internally celled and vertically celled grids
iamcaleberic Feb 16, 2017
b71b39d
Updated grid layout
iamcaleberic Feb 16, 2017
d5bd134
Move styling to layout style
iamcaleberic Feb 16, 2017
bd56d92
Added layout style
iamcaleberic Feb 16, 2017
2d6ccea
Modified styling layout
iamcaleberic Feb 16, 2017
3533516
docs(layouts): update grid layout
iamcaleberic Feb 17, 2017
4e6e8df
docs(layouts): fixed lint
iamcaleberic Feb 17, 2017
c9ac4fb
docs(layout) remove unused attribute
iamcaleberic Feb 28, 2017
3eb1f2b
docs(layouts): remove duplicate props
iamcaleberic Feb 28, 2017
e593eb1
update reponsive layout
iamcaleberic Mar 16, 2017
b81be2f
docs(layouts): update responsive layout
iamcaleberic Mar 17, 2017
ffc2421
docs(layouts): remove html class and update responsive layout
iamcaleberic Mar 17, 2017
edd5b27
docs(layouts): add styling for responsive layout
iamcaleberic Mar 17, 2017
882a74e
docs(layouts): finish up layout and add styling
iamcaleberic Mar 17, 2017
717be3c
layouts(examples): re-add layouts menu item
iamcaleberic Apr 20, 2017
c33a336
layouts(examples): add missing component
iamcaleberic Apr 20, 2017
37c6ce1
docs(Layouts): style fixes, add images
Jun 1, 2017
1d1362f
docs(Layouts): fix after rebase
Jun 1, 2017
8ce1a87
docs(Layouts): add routes, fix lint issues
Jun 1, 2017
6668277
docs(Layouts): finish LoginLayout
Jun 6, 2017
33865b0
chore(package): add css and style loader for examples
Jun 6, 2017
293642d
docs(Layout): fix route components
Jun 6, 2017
29ae7b4
docs(Layout): fix css
Jun 6, 2017
b317ae0
docs(Layout): wip on ThemingLayout
Jun 8, 2017
c1579a1
Merge branch 'layout_examples' of github.com:iamcaleberic/Semantic-UI…
iamcaleberic Jun 13, 2017
618ea31
docs(layout): remove css and style loaders
Jun 13, 2017
8d5fa8d
docs(layout): finish ResponsiveLayout
Jun 13, 2017
38857f6
docs(layout): fix URLs
Jun 13, 2017
ff66f2b
docs(Layout): attached content start
iamcaleberic Jun 13, 2017
187b007
docs(Layout): attached content update
iamcaleberic Jun 13, 2017
d565765
docs(Layout): complete attached content layout
iamcaleberic Jun 13, 2017
d8c109a
Merge branch 'layout_examples' of github.com:iamcaleberic/Semantic-UI…
iamcaleberic Jun 13, 2017
e2f0c19
docs(layout): finish GridLayout example
Jun 13, 2017
7870451
Merge branch 'layout_examples' of https://github.com/iamcaleberic/Sem…
Jun 13, 2017
30f748d
docs(Layout): bootstrap migration layout start
iamcaleberic Jun 13, 2017
1339a01
Merge branch 'layout_examples' of github.com:iamcaleberic/Semantic-UI…
iamcaleberic Jun 13, 2017
e9704bd
docs(Layout): bootstrap migration layout update
iamcaleberic Jun 13, 2017
7475c3c
docs(Layout): bootstrap migration layout complete
iamcaleberic Jun 13, 2017
d6e7ad5
docs(Layout): homepage layout complete without styling
iamcaleberic Jun 13, 2017
067a540
docs(Layout): sticky layout complete without styling
iamcaleberic Jun 13, 2017
33c41ac
docs(Layout): make menu fixed to top in fixed menu layout
iamcaleberic Jun 13, 2017
27728a9
docs(layout): finish AttachedContent example
Jun 14, 2017
a5b3edd
docs(layout): finish BootstrapMigration example
Jun 14, 2017
bd35f41
docs(Layouts): Fix lint errors in homepage
iamcaleberic Jun 15, 2017
31aab1c
docs(Layout): fix lint errors in sticky layout
iamcaleberic Jun 15, 2017
dd00555
Merge branch 'layout_examples' of github.com:iamcaleberic/Semantic-UI…
iamcaleberic Jun 15, 2017
c155feb
docs(layout): finish FixedMenu example
Jun 15, 2017
a356851
Merge branch 'layout_examples' of https://github.com/iamcaleberic/Sem…
Jun 15, 2017
c97e144
docs(layout): finish Homepage example
Jun 15, 2017
8af3271
Merge branch 'master' of https://github.com/Semantic-Org/Semantic-UI-…
Jul 5, 2017
f86131f
style(Layouts): finish StickLayout
Jul 5, 2017
4944aa9
feat(Layouts): add link to source
levithomason Jul 18, 2017
43ae94a
feat(Layouts): scroll to top on view change
levithomason Jul 18, 2017
299bebd
refactor(GridLayout): cleanup inline styles
levithomason Jul 18, 2017
5842734
code
levithomason Jul 18, 2017
6443de6
refactor(Layouts): use consistent import style
levithomason Jul 18, 2017
8ab0814
refactor(ThemingLayout): remove comments, fix formatting
levithomason Jul 18, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
import AnchorJS from 'anchor-js'
import PropTypes from 'prop-types'
import React, { Component } from 'react'
import { Route } from 'react-router-dom'

import Sidebar from 'docs/app/Components/Sidebar/Sidebar'
import style from 'docs/app/Style'
import { scrollToAnchor } from 'docs/app/utils'
import { getUnhandledProps } from 'src/lib'

const anchors = new AnchorJS({
icon: '#',
})

export default class Layout extends Component {
export default class DocsLayout extends Component {
static propTypes = {
children: PropTypes.node,
component: PropTypes.func,
render: PropTypes.func,
}

componentDidMount() {
Expand Down Expand Up @@ -43,14 +46,23 @@ export default class Layout extends Component {
this.pathname = location.pathname
}

render() {
renderChildren = props => {
const { component: Children, render } = this.props

if (render) return render()
return (
<div style={style.container}>
<Sidebar style={style.menu} />
<div style={style.main}>
{this.props.children}
<Children {...props} />
</div>
</div>
)
}

render() {
const rest = getUnhandledProps(DocsLayout, this.props)

return <Route {...rest} render={this.renderChildren} />
}
}
File renamed without changes.
80 changes: 80 additions & 0 deletions docs/app/Components/LayoutsLayout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import _ from 'lodash'
import React, { Component, PropTypes } from 'react'
import { NavLink, Route } from 'react-router-dom'

import { Button } from 'src'
import { getUnhandledProps } from 'src/lib'
import { repoURL } from 'docs/app/utils'

const docsButtonStyle = {
position: 'fixed',
margin: '2em',
bottom: 0,
left: 0,
animation: 'back-to-docs 1.5s ease-in-out infinite',
zIndex: 6,
}

const style = (
<style>{`
@keyframes back-to-docs {
0% { transform: translateY(0); }
50% { transform: translateY(0.35em); }
100% { transform: translateY(0); }
}
`}</style>
)

export default class LayoutsLayout extends Component {
static propTypes = {
component: PropTypes.func,
render: PropTypes.func,
computedMatch: PropTypes.object,
}

componentDidMount() {
scrollTo(0, 0)
}

componentDidUpdate(prevProps, prevState) {
scrollTo(0, 0)
}

renderChildren = props => {
const { component: Children, computedMatch, render } = this.props

if (render) return render()

const filename = `${_.startCase(computedMatch.params.name).replace(' ', '')}Layout.js`

return (
<div>
{style}
<Children {...props} />
<div style={docsButtonStyle}>
<Button
as={NavLink}
to='/layouts'
color='teal'
icon='left arrow'
content='Layouts'
/>
<Button
as={NavLink}
to={`${repoURL}/blob/master/docs/app/Layouts/${filename}`}
color='secondary'
icon='github'
content='Source'
target='_blank'
/>
</div>
</div>
)
}

render() {
const rest = getUnhandledProps(LayoutsLayout, this.props)

return <Route {...rest} render={this.renderChildren} />
}
}
23 changes: 23 additions & 0 deletions docs/app/Components/LayoutsRoot.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import _ from 'lodash'
import PropTypes from 'prop-types'
import React, { Component } from 'react'

import * as Layouts from '../Layouts'

export default class LayoutsRoot extends Component {
static propTypes = {
match: PropTypes.shape({
params: PropTypes.shape({
name: PropTypes.string.isRequired,
}),
}),
}

render() {
const name = _.get(this, 'props.match.params.name')
const layoutName = `${_.startCase(name).replace(/ /g, '')}Layout`
const Layout = Layouts[layoutName]

return Layout ? <Layout /> : null
}
}
3 changes: 3 additions & 0 deletions docs/app/Components/Sidebar/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ class Sidebar extends Component {
<Menu.Item as={NavLink} to='/usage' activeClassName='active'>
Usage
</Menu.Item>
<Menu.Item as={NavLink} to='/layouts' activeClassName='active'>
Layouts
</Menu.Item>
<Menu.Item as='a' href={repoURL}>
<Icon name='github' /> GitHub
</Menu.Item>
Expand Down
Loading