Skip to content

Commit

Permalink
chore(docs): Changes to buttons and textInputs docs
Browse files Browse the repository at this point in the history
Updated styled-components example in buttons and textInputs. Added private doc explaining why we use

the statefulSelectors internal helper
  • Loading branch information
bhough committed Dec 16, 2016
1 parent deda26a commit e4bec7d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/internalHelpers/_statefulSelectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ type State =
| null
| string;

/**
* Function helper that adds an array of states to a template of selectors. Used in textInputs and buttons.
* @private
*/
function statefulSelectors(states: Array<State>, template: Function, stateMap: ?Array<State>) {
if (!template) throw new Error('You must provide a template to this method.')
if (states.length === 0) return generateSelectors(template, null)
Expand Down
2 changes: 1 addition & 1 deletion src/shorthands/buttons.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type State =
*
* // styled-components usage
* const div = styled.div`
* ${buttons('active')} {
* > ${buttons('active')} {
* border: none;
* }
* `
Expand Down
2 changes: 1 addition & 1 deletion src/shorthands/textInputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type State =
*
* // styled-components usage
* const div = styled.div`
* ${textInputs('active')} {
* > ${textInputs('active')} {
* border: none;
* }
* `
Expand Down

0 comments on commit e4bec7d

Please sign in to comment.