search icon functionality
This commit is contained in:
@@ -6,14 +6,6 @@ const movieRow = (props) => (
|
|||||||
<div className="movie__column-poster">
|
<div className="movie__column-poster">
|
||||||
<img src={props.movie.posterSrc} alt="" className="movie__poster" />
|
<img src={props.movie.posterSrc} alt="" className="movie__poster" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* <div className={"movie__column-overview " + (props.val % 2 == 0 ? 'even' : 'odd')}>
|
|
||||||
<h1 className="movie__column-overview-heading">{props.movie.title}</h1>
|
|
||||||
<p className="movie__column-overview-text">{props.movie.overview}</p>
|
|
||||||
<a className="movie__column-overview-btn"
|
|
||||||
onClick={() => { window.location.href = "https://www.themoviedb.org/movie/" + props.movie.id; }}>
|
|
||||||
view</a>
|
|
||||||
</div> */}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -43,12 +43,6 @@ class NavigationItems extends Component {
|
|||||||
|
|
||||||
<div className="navigation__container--left">
|
<div className="navigation__container--left">
|
||||||
<SearchLogo className="logo"/>
|
<SearchLogo className="logo"/>
|
||||||
{/* <SearchMovie show={this.myF}/> */}
|
|
||||||
{/* <input
|
|
||||||
placeholder="Title, people, genres"
|
|
||||||
type="text" /> */}
|
|
||||||
{/* <p>hello</p>
|
|
||||||
<p>hello</p> */}
|
|
||||||
</div>
|
</div>
|
||||||
</ul>
|
</ul>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
|
import NavigationItem from '../../components/NavigationItems/NavigationItem/NavigationItem'
|
||||||
import NavigationItems from '../../components/NavigationItems/NavigationItems';
|
import SearchLogo from '../../static/images/search-icon.svg';
|
||||||
|
|
||||||
|
|
||||||
class navigation extends Component {
|
class navigation extends Component {
|
||||||
state = {
|
state = {
|
||||||
@@ -32,15 +31,24 @@ class navigation extends Component {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<nav className={"navigation " + (this.state.scrolling ? "black" : "")} >
|
<nav className={"navigation " + (this.state.scrolling ? "black" : "")} >
|
||||||
|
|
||||||
<input
|
<ul className="navigation__container">
|
||||||
onKeyDown={this.props.showMan}
|
<NavigationItem link="/" exact>Netflix</NavigationItem>
|
||||||
// onClick={this.props.showMan}
|
<NavigationItem link="/">Home</NavigationItem>
|
||||||
// onChange={props.onSearch}
|
<NavigationItem link="/">TV Shows</NavigationItem>
|
||||||
// onClick={props.onShow}
|
<NavigationItem link="/">Movies</NavigationItem>
|
||||||
type="text"
|
<NavigationItem link="/">Recently Added</NavigationItem>
|
||||||
placeholder="Title, genres, people" />
|
<NavigationItem link="/">My List</NavigationItem>
|
||||||
<NavigationItems />
|
|
||||||
|
<div className="navigation__container--left">
|
||||||
|
<SearchLogo className="logo" />
|
||||||
|
<input
|
||||||
|
onKeyDown={this.props.showMan}
|
||||||
|
type="text"
|
||||||
|
placeholder="Title, genres, people" />
|
||||||
|
</div>
|
||||||
|
</ul>
|
||||||
|
{/* <NavigationItems /> */}
|
||||||
</nav>
|
</nav>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,75 +0,0 @@
|
|||||||
// import React, { Component } from 'react';
|
|
||||||
// import axios from "axios";
|
|
||||||
// // import Search from '../../components/Search/Search';
|
|
||||||
// import MovieRow from '../../components/MovieRow/MovieRow';
|
|
||||||
// import Layout from '../Layout/Layout';
|
|
||||||
|
|
||||||
|
|
||||||
// class SearchMovie extends Component {
|
|
||||||
|
|
||||||
// state = {
|
|
||||||
// // an array that will hold all of our movies component
|
|
||||||
// rows: [],
|
|
||||||
// myVal: false
|
|
||||||
// }
|
|
||||||
|
|
||||||
// makeAipCall = (searchItem) => {
|
|
||||||
// const url = "https://api.themoviedb.org/3/search/movie?api_key=224ce27b38a3805ecf6f6c36eb3ba9d0&page=1&query=" + searchItem;
|
|
||||||
// axios.get(url)
|
|
||||||
// .then(res => {
|
|
||||||
// // extract the data from json object
|
|
||||||
// const movies = res.data.results;
|
|
||||||
// // Holds our movieComponent.
|
|
||||||
// let movieRows = [];
|
|
||||||
// let total = 0;
|
|
||||||
// movies.forEach((movie) => {
|
|
||||||
// // manually build our image url and set it on the movie object
|
|
||||||
// movie.posterSrc = "https://image.tmdb.org/t/p/w185" + movie.poster_path;
|
|
||||||
// total+= 1;
|
|
||||||
// // pass in the movie object to our MovieRow component and keep it in a variable called
|
|
||||||
// // movieComponent
|
|
||||||
// const movieComponent = <MovieRow
|
|
||||||
// val={total}
|
|
||||||
// key={movie.id}
|
|
||||||
// movie={movie}
|
|
||||||
// />
|
|
||||||
// // push our movieComponent to our movieRows array;
|
|
||||||
// movieRows.push(movieComponent);
|
|
||||||
// })
|
|
||||||
// // update state
|
|
||||||
// this.setState({ rows: movieRows });
|
|
||||||
// }).catch(error => {
|
|
||||||
// console.log(error);
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// // get the user input and pass it to the makeAPICall function
|
|
||||||
// searchHandler = (event) => {
|
|
||||||
// // const searchItem = event.target.value;
|
|
||||||
// // this.makeAipCall(searchItem);
|
|
||||||
// alert("Hello");
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
// render() {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// return (
|
|
||||||
// <div>
|
|
||||||
// <input
|
|
||||||
// onKeyPress={this.searchHandler}
|
|
||||||
// onClick={this.props.show}
|
|
||||||
// type="text"
|
|
||||||
// placeholder="Title, genres, people" />
|
|
||||||
// {/* <Search onSearch={this.searchHandler} onShow={this.onChangeHandler} showAll={this.state.myVal}/> */}
|
|
||||||
// {event.key}
|
|
||||||
// </div>
|
|
||||||
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// export default SearchMovie;
|
|
||||||
@@ -69,7 +69,7 @@ html {
|
|||||||
background-color: $color-background;
|
background-color: $color-background;
|
||||||
height: 150%;
|
height: 150%;
|
||||||
padding-bottom: 10rem;
|
padding-bottom: 10rem;
|
||||||
|
padding-left: 4rem;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,8 @@
|
|||||||
|
|
||||||
&__column-poster {
|
&__column-poster {
|
||||||
height: 25rem;
|
height: 25rem;
|
||||||
width: 18rem;
|
width: 17.5rem;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&__poster {
|
&__poster {
|
||||||
@@ -16,12 +17,3 @@
|
|||||||
div.movie:first-child {
|
div.movie:first-child {
|
||||||
padding-top: 15rem;
|
padding-top: 15rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.even {
|
|
||||||
background-color: $color-purple;
|
|
||||||
}
|
|
||||||
|
|
||||||
.odd {
|
|
||||||
background-color: $color-light-blue-2;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -54,11 +54,11 @@ input[type="text"] {
|
|||||||
font-size: 1.4rem;
|
font-size: 1.4rem;
|
||||||
border: none;
|
border: none;
|
||||||
outline: none;
|
outline: none;
|
||||||
background-color: red;
|
// background-color: red;
|
||||||
width: 0px;
|
width: 0px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
padding-right: 2rem;
|
padding-right: 2rem;
|
||||||
// background: none;
|
background: none;
|
||||||
transition: width .5s cubic-bezier(0.000, 0.795, 0.000, 1.000);
|
transition: width .5s cubic-bezier(0.000, 0.795, 0.000, 1.000);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user