FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
processing-website/src/components/Button.js at main · processing/processing-website · GitHub
processing
processing-website
Repository navigation
Code
Issues
112
(112)
Pull requests
16
(16)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
processing-website
/
src
/
components
/
Button.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
64 lines (58 loc) · 1.29 KB
Breadcrumbs
processing-website
/
src
/
components
/
Button.js
Copy path
File metadata and controls
64 lines (58 loc) · 1.29 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import
React
from
'react'
;
import
PropTypes
from
'prop-types'
;
import
classnames
from
'classnames'
;
import
{
LocalizedLink
as
Link
}
from
'gatsby-theme-i18n'
;
import
*
as
css
from
'./Button.module.css'
;
export
const
Button
=
(
{
className
,
to
,
href
,
size
,
variant
,
target
,
onClick
,
children
,
tabIndex
}
)
=>
{
const
classNames
=
classnames
(
css
.
root
,
className
,
{
[
css
[
size
]
]
:
size
,
[
css
[
variant
]
]
:
variant
}
)
;
return
(
<
>
{
to
?
(
<
Link
className
=
{
classNames
}
to
=
{
to
}
tabIndex
=
{
tabIndex
?
tabIndex
:
0
}
>
{
children
}
</
Link
>
)
:
href
?
(
<
a
className
=
{
classNames
}
href
=
{
href
}
target
=
{
target
}
rel
=
{
target
===
'_blank'
?
'noreferrer'
:
null
}
tabIndex
=
{
tabIndex
?
tabIndex
:
0
}
>
{
children
}
</
a
>
)
:
(
<
button
className
=
{
classNames
}
onClick
=
{
onClick
}
tabIndex
=
{
tabIndex
?
tabIndex
:
0
}
>
{
children
}
</
button
>
)
}
</
>
)
;
}
;
export
default
Button
;
Button
.
defaultProps
=
{
onClick
:
(
)
=>
{
}
}
;
Button
.
propTypes
=
{
children
:
PropTypes
.
node
,
className
:
PropTypes
.
string
,
to
:
PropTypes
.
string
,
onClick
:
PropTypes
.
func
,
color
:
PropTypes
.
oneOf
(
[
'gray'
]
)
,
size
:
PropTypes
.
oneOf
(
[
'large'
,
'small'
]
)
}
;
Back
|
FazBrowse Home
|
New Git URL