Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
whats-open-web
Commits
2e77b8c3
Commit
2e77b8c3
authored
Sep 29, 2017
by
Andrew Hrdy
Browse files
Favorite stars changed to hearts.
parent
fb577ce1
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/components/FavoriteButton.js
View file @
2e77b8c3
import
React
from
'
react
'
import
{
withStyles
}
from
'
material-ui/styles
'
;
import
yellow
from
'
material-ui/colors/yellow
'
;
import
StarIcon
from
'
material-ui-icons/Star
'
;
import
StarBorderIcon
from
'
material-ui-icons/StarBorder
'
;
import
grey
from
'
material-ui/colors/grey
'
import
pink
from
'
material-ui/colors/pink
'
;
import
FavoriteBorderIcon
from
'
material-ui-icons/FavoriteBorder
'
;
import
FavoriteIcon
from
'
material-ui-icons/Favorite
'
;
import
PropTypes
from
'
prop-types
'
;
class
FavoriteButton
extends
React
.
Component
{
...
...
@@ -25,10 +26,12 @@ class FavoriteButton extends React.Component {
render
()
{
if
(
this
.
props
.
isFavorite
)
{
return
(
<
StarIcon
onClick
=
{
this
.
handleClick
}
className
=
{
this
.
props
.
classes
.
star
}
/>
)
;
return
(
<
FavoriteIcon
onClick
=
{
this
.
handleClick
}
className
=
{
this
.
props
.
classes
.
heart
}
style
=
{{
color
:
pink
[
400
]}}
/>
)
;
}
return
(
<
StarBorderIcon
onClick
=
{
this
.
handleClick
}
className
=
{
this
.
props
.
classes
.
star
}
/>
)
;
return
(
<
FavoriteBorderIcon
onClick
=
{
this
.
handleClick
}
className
=
{
this
.
props
.
classes
.
heart
}
style
=
{{
color
:
grey
[
400
]}}
/>
)
;
}
}
...
...
@@ -41,14 +44,13 @@ FavoriteButton.propTypes = {
};
const
styleSheet
=
{
st
ar
:
{
he
ar
t
:
{
position
:
'
absolute
'
,
top
:
'
0px
'
,
right
:
'
0px
'
,
color
:
yellow
[
600
],
height
:
'
26px
'
,
width
:
'
26px
'
,
padding
:
'
4px
'
,
height
:
'
24px
'
,
width
:
'
24px
'
,
padding
:
'
5px
'
,
cursor
:
'
pointer
'
,
}
};
...
...
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