Skip to content

Commit

Permalink
Refolder components for a better require flow.
Browse files Browse the repository at this point in the history
  • Loading branch information
soyjavi committed Jun 22, 2015
1 parent e45b47b commit 5bcf990
Show file tree
Hide file tree
Showing 28 changed files with 37 additions and 77 deletions.
2 changes: 1 addition & 1 deletion components/aside/index.cjsx
Expand Up @@ -2,7 +2,7 @@
@todo
###

Style = require './style'
require './style'

module.exports = React.createClass

Expand Down
2 changes: 1 addition & 1 deletion components/aside/style.styl
@@ -1,4 +1,4 @@
@import "../constants"
@import "../constants.styl"

[data-component-aside]
position : absolute
Expand Down
Expand Up @@ -2,8 +2,8 @@
@todo
###

Style = require './style/autocomplete'
Input = require './input'
require './style'
Input = require '../input'

module.exports = React.createClass

Expand Down
@@ -1,4 +1,4 @@
@import "__constants.styl"
@import "../constants.styl"

[data-component-autocomplete]
position : relative
Expand Down
6 changes: 3 additions & 3 deletions components/button.cjsx → components/button/index.cjsx
Expand Up @@ -2,9 +2,9 @@
@todo
###

Style = require './style/button'
FontIcon = require "./font_icon"
Ripple = require "./ripple"
require './style'
FontIcon = require "../font_icon"
Ripple = require "../ripple"

module.exports = React.createClass

Expand Down
@@ -1,4 +1,4 @@
@import "__constants.styl"
@import "../constants.styl"

[data-component-button]
z-index : 1
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions components/dialog.cjsx → components/dialog/index.cjsx
Expand Up @@ -2,9 +2,9 @@
@todo
###

Style = require './style/dialog'
Button = require './button'
Navigation = require './navigation'
require './style'
Button = require '../button'
Navigation = require '../navigation'

module.exports = React.createClass

Expand Down
@@ -1,4 +1,4 @@
@import "__constants.styl"
@import "../constants.styl"

[data-component-dialog]
z-index : 3
Expand Down
2 changes: 2 additions & 0 deletions components/font_icon.cjsx → components/font_icon/index.cjsx
Expand Up @@ -3,6 +3,8 @@
###


# require './style'

module.exports = React.createClass

# -- States & Properties
Expand Down
@@ -1,4 +1,4 @@
@import "__constants.styl"
@import "../constants.styl"

@font-face
font-family : 'MaterialIcons'
Expand Down
8 changes: 4 additions & 4 deletions components/form.cjsx → components/form/index.cjsx
Expand Up @@ -2,10 +2,10 @@
@todo
###

Style = require './style/form'
Autocomplete = require "./autocomplete"
Button = require "./button"
Input = require "./input"
require './style'
Autocomplete = require "../autocomplete"
Button = require "../button"
Input = require "../input"

module.exports = React.createClass

Expand Down
2 changes: 1 addition & 1 deletion components/style/form.styl → components/form/style.styl
@@ -1,4 +1,4 @@
@import "__constants.styl"
@import "../constants.styl"

[data-component-form]
& > :last-child
Expand Down
2 changes: 1 addition & 1 deletion components/input.cjsx → components/input/index.cjsx
Expand Up @@ -2,7 +2,7 @@
@todo
###

Style = require './style/input'
require './style'

module.exports = React.createClass

Expand Down
@@ -1,4 +1,4 @@
@import "__constants.styl"
@import "../constants.styl"

[data-component-input]
position : relative
Expand Down
4 changes: 2 additions & 2 deletions components/link.cjsx → components/link/index.cjsx
Expand Up @@ -2,8 +2,8 @@
@todo
###

Style = require './style/link'
FontIcon = require "./font_icon"
require './style'
FontIcon = require "../font_icon"

module.exports = React.createClass

Expand Down
2 changes: 1 addition & 1 deletion components/style/link.styl → components/link/style.styl
@@ -1,4 +1,4 @@
@import "__constants.styl"
@import "../constants.styl"

[data-component-link]
position : relative
Expand Down
2 changes: 1 addition & 1 deletion components/list.cjsx → components/list/index.cjsx
Expand Up @@ -2,7 +2,7 @@
@todo
###

Style = require './style/list'
require './style'

module.exports = React.createClass

Expand Down
2 changes: 1 addition & 1 deletion components/style/list.styl → components/list/style.styl
@@ -1,4 +1,4 @@
@import "__constants.styl"
@import "../constants.styl"

[data-component-list]
list-style : none
Expand Down
2 changes: 1 addition & 1 deletion components/loading.cjsx → components/loading/index.cjsx
Expand Up @@ -2,7 +2,7 @@
@todo
###

Style = require './style/loading'
require './style'

module.exports = React.createClass

Expand Down
@@ -1,4 +1,4 @@
@import "__constants.styl"
@import "../constants.styl"

[data-component-loading]
z-index : 2
Expand Down
Expand Up @@ -2,10 +2,10 @@
@todo
###

Style = require './style/navigation'
require './style'
# -- Components
Button = require './button'
Link = require './link'
Button = require '../button'
Link = require '../link'

module.exports = React.createClass

Expand Down
@@ -1,4 +1,4 @@
@import "__constants.styl"
@import "../constants.styl"

[data-component-navigation="horizontal"]
> *
Expand Down
2 changes: 1 addition & 1 deletion components/ripple.cjsx → components/ripple/index.cjsx
Expand Up @@ -2,7 +2,7 @@
@todo
###

Style = require './style/ripple'
require './style'

module.exports = React.createClass

Expand Down
@@ -1,4 +1,4 @@
@import "__constants.styl"
@import "../constants.styl"

[data-component-ripple]
position : absolute
Expand Down
File renamed without changes.
42 changes: 0 additions & 42 deletions components/style/__constants.styl

This file was deleted.

2 changes: 1 addition & 1 deletion webpack.config.coffee
Expand Up @@ -11,7 +11,7 @@ module.exports =
context : __dirname

entry:
commons : ['./components/style/__commons.styl']
commons : ['./components/commons.styl']
test : ['webpack/hot/dev-server', './spec/index.cjsx']
# test : ['webpack/hot/dev-server', './spec/index.cjsx']

Expand Down

0 comments on commit 5bcf990

Please sign in to comment.