Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
IT2810_P2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
IT2810-H19
T
Teams
Team 36
IT2810_P2
Commits
81944cd0
Commit
81944cd0
authored
Sep 24, 2019
by
Svein Olav Styve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#19
Add favorite save feedback
parent
ad58e2b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
7 deletions
+36
-7
src/components/FavoriteSection.js
src/components/FavoriteSection.js
+36
-7
No files found.
src/components/FavoriteSection.js
View file @
81944cd0
import
React
from
'
react
'
;
import
'
../style/FavoriteButton.css
'
;
export
default
function
FavoriteSection
(
props
)
{
return
(
<
div
className
=
"
Button-container
"
>
<
button
onClick
=
{
props
.
save
}
>
Save
as
favorite
<
/button
>
<
button
onClick
=
{
props
.
open
}
>
Open
favourite
<
/button
>
<
/div
>
);
export
default
class
FavoriteSection
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
showSaveFeedback
:
false
};
this
.
save
=
this
.
save
.
bind
(
this
);
}
save
=
(
e
)
=>
{
this
.
props
.
save
(
e
);
this
.
setState
({
showSaveFeedback
:
true
});
this
.
timerID
=
setInterval
(
()
=>
{
this
.
setState
({
showSaveFeedback
:
false
});
},
3500
);
}
render
()
{
return
(
<
div
className
=
"
Button-container
"
>
<
button
onClick
=
{
this
.
save
}
>
Save
as
favorite
<
/button
>
<
button
onClick
=
{
this
.
props
.
open
}
>
Open
favourite
<
/button
>
<
p
>
{
(
this
.
state
.
showSaveFeedback
)
&&
"
Favorite saved!
"
}
<
/p
>
<
/div
>
);
}
}
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