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
Enes Tasbasi
whats-open-web
Commits
ef7d7c65
Commit
ef7d7c65
authored
Apr 03, 2019
by
Matthew J Endries
Browse files
Add tooltip to favorite
parent
598b4b67
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/components/FavoriteButton.tsx
View file @
ef7d7c65
...
...
@@ -3,6 +3,7 @@ import * as classNames from 'classnames';
import
FavoriteBorderIcon
from
'
@material-ui/icons/FavoriteBorder
'
;
import
FavoriteIcon
from
'
@material-ui/icons/Favorite
'
;
import
Tooltip
from
'
@material-ui/core/Tooltip
'
;
import
{
trackPiwikEvent
}
from
'
../piwik/piwik
'
;
class
FavoriteButton
extends
React
.
Component
<
FavoriteButtonProps
,
FavoriteButtonState
>
{
...
...
@@ -43,14 +44,18 @@ class FavoriteButton extends React.Component<FavoriteButtonProps, FavoriteButton
render
()
{
if
(
this
.
state
.
isFavorite
)
{
return
(
<
FavoriteIcon
onClick
=
{
this
.
handleClick
}
className
=
{
classNames
(
'
favorite-button-heart
'
,
'
favorite-button-heart-favorited
'
)
}
/>
<
Tooltip
title
=
"Remove Favorite"
>
<
FavoriteIcon
onClick
=
{
this
.
handleClick
}
className
=
{
classNames
(
'
favorite-button-heart
'
,
'
favorite-button-heart-favorited
'
)
}
/>
</
Tooltip
>
);
}
return
(
<
FavoriteBorderIcon
onClick
=
{
this
.
handleClick
}
className
=
{
classNames
(
'
favorite-button-heart
'
)
}
/>
<
Tooltip
title
=
"Add Favorite"
>
<
FavoriteBorderIcon
onClick
=
{
this
.
handleClick
}
className
=
{
classNames
(
'
favorite-button-heart
'
)
}
/>
</
Tooltip
>
);
}
}
...
...
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