Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
paragon
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
paragon
Commits
b0017b2c
Commit
b0017b2c
authored
Jul 05, 2017
by
Ari Rizzitano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clunky fix for passing non-canon props
parent
4b59f66e
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
14 deletions
+18
-14
.storybook/__snapshots__/Storyshots.test.js.snap
+0
-9
package.json
+1
-0
src/Button/index.jsx
+16
-4
src/Dropdown/index.jsx
+1
-1
No files found.
.storybook/__snapshots__/Storyshots.test.js.snap
View file @
b0017b2c
...
@@ -83,16 +83,7 @@ exports[`Storyshots Dropdown basic usage 1`] = `
...
@@ -83,16 +83,7 @@ exports[`Storyshots Dropdown basic usage 1`] = `
<button
<button
aria-expanded={false}
aria-expanded={false}
aria-haspopup="true"
aria-haspopup="true"
buttonType="secondary"
className="btn border-0 dropdown-toggle btn-secondary"
className="btn border-0 dropdown-toggle btn-secondary"
classNames={
Array [
"border-0",
"dropdown-toggle",
]
}
display="Search Engines"
inputRef={[Function]}
onBlur={[Function]}
onBlur={[Function]}
onClick={[Function]}
onClick={[Function]}
onKeyDown={[Function]}
onKeyDown={[Function]}
...
...
package.json
View file @
b0017b2c
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
"deploy-storybook"
:
"storybook-to-ghpages"
,
"deploy-storybook"
:
"storybook-to-ghpages"
,
"lint"
:
"eslint --ext .js --ext .jsx ."
,
"lint"
:
"eslint --ext .js --ext .jsx ."
,
"precommit"
:
"yarn run lint"
,
"precommit"
:
"yarn run lint"
,
"snapshot"
:
"jest --updateSnapshot"
,
"start"
:
"start-storybook -p 6006"
,
"start"
:
"start-storybook -p 6006"
,
"test"
:
"jest --coverage"
"test"
:
"jest --coverage"
},
},
...
...
src/Button/index.jsx
View file @
b0017b2c
...
@@ -5,11 +5,23 @@ import PropTypes from 'prop-types';
...
@@ -5,11 +5,23 @@ import PropTypes from 'prop-types';
import
buttons
from
'bootstrap/scss/_buttons.scss'
;
import
buttons
from
'bootstrap/scss/_buttons.scss'
;
function
Button
(
props
)
{
function
Button
(
props
)
{
const
{
buttonType
,
className
,
display
,
inputRef
,
onBlur
,
onClick
,
onKeyDown
,
type
,
...
other
}
=
props
;
return
(
return
(
<
button
<
button
className=
{
classNames
([
className=
{
classNames
([
buttons
.
btn
,
buttons
.
btn
,
...
props
.
className
s
,
...
props
.
className
,
],
{
],
{
[
buttons
[
`btn-${props.buttonType}`
]]:
props
.
buttonType
!==
undefined
,
[
buttons
[
`btn-${props.buttonType}`
]]:
props
.
buttonType
!==
undefined
,
})
}
})
}
...
@@ -18,7 +30,7 @@ function Button(props) {
...
@@ -18,7 +30,7 @@ function Button(props) {
onKeyDown=
{
props
.
onKeyDown
}
onKeyDown=
{
props
.
onKeyDown
}
type=
{
props
.
type
}
type=
{
props
.
type
}
ref=
{
props
.
inputRef
}
ref=
{
props
.
inputRef
}
{
...
props
}
{
...
other
}
>
>
{
props
.
display
}
{
props
.
display
}
</
button
>
</
button
>
...
@@ -27,7 +39,7 @@ function Button(props) {
...
@@ -27,7 +39,7 @@ function Button(props) {
Button
.
propTypes
=
{
Button
.
propTypes
=
{
buttonType
:
PropTypes
.
string
,
buttonType
:
PropTypes
.
string
,
className
s
:
PropTypes
.
arrayOf
(
PropTypes
.
string
),
className
:
PropTypes
.
arrayOf
(
PropTypes
.
string
),
display
:
PropTypes
.
string
.
isRequired
,
display
:
PropTypes
.
string
.
isRequired
,
inputRef
:
PropTypes
.
func
,
inputRef
:
PropTypes
.
func
,
onBlur
:
PropTypes
.
func
,
onBlur
:
PropTypes
.
func
,
...
@@ -38,7 +50,7 @@ Button.propTypes = {
...
@@ -38,7 +50,7 @@ Button.propTypes = {
Button
.
defaultProps
=
{
Button
.
defaultProps
=
{
buttonType
:
undefined
,
buttonType
:
undefined
,
className
s
:
[],
className
:
[],
inputRef
:
()
=>
{},
inputRef
:
()
=>
{},
onBlur
:
()
=>
{},
onBlur
:
()
=>
{},
onClick
:
()
=>
{},
onClick
:
()
=>
{},
...
...
src/Dropdown/index.jsx
View file @
b0017b2c
...
@@ -134,7 +134,7 @@ class Dropdown extends React.Component {
...
@@ -134,7 +134,7 @@ class Dropdown extends React.Component {
display=
{
this
.
props
.
title
}
display=
{
this
.
props
.
title
}
onClick=
{
this
.
toggle
}
onClick=
{
this
.
toggle
}
onKeyDown=
{
this
.
handleToggleKeyDown
}
onKeyDown=
{
this
.
handleToggleKeyDown
}
className
s
=
{
[
className=
{
[
borders
[
'border-0'
],
borders
[
'border-0'
],
dd
[
'dropdown-toggle'
],
dd
[
'dropdown-toggle'
],
]
}
]
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment