Skip to content

Commit c38fc7a

Browse files
committed
installing delete button
1 parent 31dac04 commit c38fc7a

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

src/index.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class App extends Component {
2121

2222
this.videoSearch('Best beaches');
2323
this.favoritesList = this.favoritesList.bind(this);
24+
this.deleteFavorite = this.deleteFavorite.bind(this);
2425
}
2526

2627
videoSearch(term) {
@@ -46,19 +47,39 @@ class App extends Component {
4647
});
4748
}
4849

50+
deleteFavorite(url) {
51+
// var urlID = "";
52+
// axios.get('https://hm-msg-forum-f02c3.firebaseio.com/messages/.json')
53+
// .then((res) => {
54+
// Object.values(res).map((elm,idx) => {
55+
// // if (Object.values(elm)[idx] !== undefined && Object.values(elm)[idx].favorites === url) {
56+
// // urlID = Object.keys(elm)[idx];
57+
// // console.log(urlID);
58+
// // }
59+
// // console.log(Object.values(elm)[0]);
60+
// keys = Object.keys(elm));
61+
// values = Object.values(elm));
62+
// })
63+
// // console.log(urlID);
64+
// console.log(keys);
65+
// console.log(values);
66+
// })
67+
}
68+
4969
favoritesList() {
5070
return (
5171
this.state.favoritesList.reverse().map(el =>
5272
<div className="infoz">
5373
<div className="titz">{el.title}</div>
5474
<a href={el.favorites} target="_blank">{el.favorites}</a>
75+
{/* <button onClick={() => this.deleteFavorite(el.favorites)}>Delete</button> */}
5576
</div>
5677
)
5778
)
5879
}
5980

6081
render() {
61-
const videoSearch = _.debounce((term) => {this.videoSearch(term)}, 100);
82+
const videoSearch = _.debounce((term) => {this.videoSearch(term)}, );
6283

6384
return (
6485
<div className="container">

0 commit comments

Comments
 (0)