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
8b56a117
Commit
8b56a117
authored
Jul 06, 2017
by
Ari Rizzitano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
local imports for button and dropdown
parent
6676a7cc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
18 deletions
+23
-18
src/Button/Button.scss
+5
-0
src/Button/index.jsx
+10
-10
src/Dropdown/Dropdown.scss
+1
-0
src/Dropdown/index.jsx
+7
-8
No files found.
src/Button/Button.scss
0 → 100644
View file @
8b56a117
@import
"~bootstrap/scss/_buttons"
;
.btn-borderless
{
border
:
0
;
}
src/Button/index.jsx
View file @
8b56a117
...
...
@@ -2,7 +2,7 @@ import React from 'react';
import
classNames
from
'classnames'
;
import
PropTypes
from
'prop-types'
;
import
buttons
from
'bootstrap/scss/_buttons
.scss'
;
import
styles
from
'./Button
.scss'
;
function
Button
(
props
)
{
const
{
...
...
@@ -20,19 +20,19 @@ function Button(props) {
return
(
<
button
className=
{
classNames
([
button
s
.
btn
,
...
props
.
className
,
style
s
.
btn
,
...
className
.
map
(
cn
=>
styles
[
cn
])
,
],
{
[
buttons
[
`btn-${props.buttonType}`
]]:
props
.
buttonType
!==
undefined
,
[
styles
[
`btn-${buttonType}`
]]:
buttonType
!==
undefined
,
})
}
onBlur=
{
props
.
onBlur
}
onClick=
{
props
.
onClick
}
onKeyDown=
{
props
.
onKeyDown
}
type=
{
props
.
type
}
ref=
{
props
.
inputRef
}
onBlur=
{
onBlur
}
onClick=
{
onClick
}
onKeyDown=
{
onKeyDown
}
type=
{
type
}
ref=
{
inputRef
}
{
...
other
}
>
{
props
.
display
}
{
display
}
</
button
>
);
}
...
...
src/Dropdown/Dropdown.scss
0 → 100644
View file @
8b56a117
@import
"~bootstrap/scss/_dropdown"
;
src/Dropdown/index.jsx
View file @
8b56a117
import
React
from
'react'
;
import
classNames
from
'classnames'
;
import
PropTypes
from
'prop-types'
;
import
dd
from
'bootstrap/scss/_dropdown.scss'
;
import
borders
from
'bootstrap/scss/utilities/_borders.scss'
;
import
styles
from
'./Dropdown.scss'
;
import
pc
from
'../utils/base-styles.scss'
;
import
Button
from
'../Button'
;
...
...
@@ -100,7 +99,7 @@ class Dropdown extends React.Component {
generateMenuItems
(
menuItems
)
{
return
menuItems
.
map
((
menuItem
,
i
)
=>
(
<
li
className=
{
dd
[
'dropdown-item'
]
}
key=
{
i
}
>
<
li
className=
{
styles
[
'dropdown-item'
]
}
key=
{
i
}
>
<
a
role=
"menuitem"
href=
{
menuItem
.
href
}
...
...
@@ -122,8 +121,8 @@ class Dropdown extends React.Component {
<
div
className=
{
classNames
([
pc
[
'paragon-component'
],
dd
.
dropdown
,
{
[
dd
.
show
]:
this
.
state
.
open
},
styles
.
dropdown
,
{
[
styles
.
show
]:
this
.
state
.
open
},
])
}
ref=
{
(
container
)
=>
{
this
.
container
=
container
;
}
}
>
...
...
@@ -135,8 +134,8 @@ class Dropdown extends React.Component {
onClick=
{
this
.
toggle
}
onKeyDown=
{
this
.
handleToggleKeyDown
}
className=
{
[
borders
[
'border-0'
]
,
dd
[
'dropdown-toggle'
],
'btn-borderless'
,
styles
[
'dropdown-toggle'
],
]
}
type=
"button"
inputRef=
{
(
toggleElem
)
=>
{
this
.
toggleElem
=
toggleElem
;
}
}
...
...
@@ -144,7 +143,7 @@ class Dropdown extends React.Component {
<
ul
aria
-
label=
{
this
.
props
.
title
}
aria
-
hidden=
{
!
this
.
state
.
open
}
className=
{
dd
[
'dropdown-menu'
]
}
className=
{
styles
[
'dropdown-menu'
]
}
role=
"menu"
>
{
menuItems
}
...
...
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