@@ -7,6 +7,7 @@ import ListManagementDropdown from './ListManagementDropdown';
77import Navbar from '../../NavBar/Navbar'
88import { ProductSearch } from '../ProductSearch/ProductSearch' ;
99import ErrorPage from "../404Page/ErrorPage"
10+ import { Link } from "react-router-dom" ;
1011
1112export class ShoppingListView extends React . Component {
1213 constructor ( props ) {
@@ -25,12 +26,8 @@ export class ShoppingListView extends React.Component {
2526 this . togglePop = this . togglePop . bind ( this ) ;
2627 this . handleAddProduct = this . handleAddProduct . bind ( this ) ;
2728 this . handleRemoveProduct = this . handleRemoveProduct . bind ( this ) ;
28- // this.updateCurrentProductIndex = this.updateCurrentProductIndex.bind(this);
29-
3029 }
3130
32-
33-
3431 changeListHandler ( newIndex ) {
3532 //alert('new list index: ' + newIndex);
3633 this . setState ( {
@@ -39,9 +36,6 @@ export class ShoppingListView extends React.Component {
3936 } )
4037 }
4138
42-
43-
44-
4539 handleInput ( event ) {
4640 this . setState ( { value : event . target . value } ) ;
4741 }
@@ -132,7 +126,6 @@ export class ShoppingListView extends React.Component {
132126 } ) ;
133127 }
134128
135-
136129 handleRemoveProduct = ( clickedIndex ) => {
137130 //alert('called handleremoveproduct');
138131 //this.updateCurrentProductIndex(clickedIndex);
@@ -168,7 +161,9 @@ export class ShoppingListView extends React.Component {
168161 < ShoppingListSelection changeListHandler = { this . changeListHandler } handleAddList = { this . handleAddList } lists = { this . state . lists } handleInput = { this . handleInput } value = { this . state . value } togglePop = { this . togglePop } seen = { this . state . seen } />
169162 </ div >
170163 < div className = 'productlistcolumn bg-purple-200' >
171- < button onClick = { this . handleAddProduct } > + Add a Product</ button >
164+ < Link to = { `/search` } className = "" >
165+ < div className = "px-2 py-1 text-sm rounded-full text-white bg-purple-600" > + Add a Product</ div >
166+ </ Link >
172167 < ShoppingListDisplay displayIndex = { this . state . listIndex } lists = { this . state . lists } currentList = { this . state . currentList } removeProduct = { this . handleRemoveProduct } productIndex = { this . state . productIndex } />
173168
174169 </ div >
0 commit comments