<commit_before>import React from 'react'
import { NavLink } from 'react-router-dom'
import Thumbnail from './Thumbnail.jsx'
import Sidebar from './Sidebar.jsx'
import {connect} from 'react-redux'

/* EXPLANATION
  1.Renders a container that wraps the sidebar and all the product thumbnails
  2.Sidebar and thumbnails are then wrapped in bootstrap row
  3. Within that row we create a new col-lg-9(bootstrap stuff) which will hold all our thumbnails
  4. Maps through products and creates thumbnail for each product that are list elements inside a greater
  unordered list
*/

function AllProducts(props) {
    let category ='all'
    console.log(category)
    console.log(props)
    return (
        <div>
            <div className="col-lg-9">
                <section id="gallery" className="gallery margin-top-120 bg-grey">
                    <div className="container">
                        <div className="row">
                            <div className="main-gallery roomy-80">
                                <div className="col-md-12">
                                    <div className="head_title text-left sm-text-center wow fadeInDown">
                                        <h2>Selection</h2>
                                        <h5><em>Get your head in the clouds</em></h5>
                                        <div className="separator_left"></div>
                                    </div>
                                </div>

                                <div className="col-md-12 m-bottom-60">
                                    <div className="filters-button-group text-right sm-text-center">
                                        <button className="button is-checked" onClick={() => category='all'}>View all</button>
                                        <button className="button" onClick={(evt) => {
                                            console.log('this is working', category)
                                            return category='clouds'
                                        }}>Clouds</button>
                                        <button className="button" onClick={() => category='fog'}>Fog</button>
                                        <button className="button" onClick={() => category='storms'}>Storms</button>
                                        <button className="button" onClick={() => category='rain'}>Rain</button>
                                    </div>
                                </div>

                                <div className="grid text-center">
                                    {props.products.filter((product) => {
                                        console.log(category)
                                        console.log(category!=='all')
                                        if (category!=='all') {
                                            console.log(product.category===category)
                                            return product.category===category
                                        } else {
                                            return true
                                        }
                                    }).map(
                                        (product) => (
                                            <NavLink to={`/products/${product.id}`} key={ product.id }><commit_msg>fix all products filter<commit_after>import React from 'react'
import { NavLink } from 'react-router-dom'
import Thumbnail from './Thumbnail.jsx'
import Sidebar from './Sidebar.jsx'
import {connect} from 'react-redux'

/* EXPLANATION
  1.Renders a container that wraps the sidebar and all the product thumbnails
  2.Sidebar and thumbnails are then wrapped in bootstrap row
  3. Within that row we create a new col-lg-9(bootstrap stuff) which will hold all our thumbnails
  4. Maps through products and creates thumbnail for each product that are list elements inside a greater
  unordered list
*/

function AllProducts(props) {
    let category ='all'
    console.log(category)
    console.log(props)
    return (
        <div>
            <div className="col-lg-9">
                <section id="gallery" className="gallery margin-top-120 bg-grey">
                    <div className="container">
                        <div className="row">
                            <div className="main-gallery roomy-80">
                                <div className="col-md-12">
                                    <div className="head_title text-left sm-text-center wow fadeInDown">
                                        <h2>Selection</h2>
                                        <h5><em>Get your head in the clouds</em></h5>
                                        <div className="separator_left"></div>
                                    </div>
                                </div>

                                <div className="col-md-12 m-bottom-60">
                                    <div className="filters-button-group text-right sm-text-center">
                                        <button className="button is-checked" onClick={() => category='all'}>View all</button>
                                        <button className="button" onClick={() => {
                                          console.log("this is working");
                                          return category}='clouds'}>Clouds</button>
                                        <button className="button" onClick={() => category='fog'}>Fog</button>
                                        <button className="button" onClick={() => category='storms'}>Storms</button>
                                        <button className="button" onClick={() => category='rain'}>Rain</button>
                                    </div>
                                </div>

                                <div className="grid text-center">
                                    {props.products.filter((product) => {
                                        console.log(category)
                                        console.log(category!=='all')
                                        if (category!=='all') {
                                            console.log(product.category===category)
                                            return product.category===category
                                        } else {
                                            return true
                                        }
                                    }).map(
                                        (product) => (
                                            <NavLink to={`/products/${product.id}`} key={ product.id }>
{'fraction_non_alphanumeric': 0.09929291409658493, 'fraction_numerical': 0.006318639987964495, 'mean_word_length': 1.0505860579888957, 'pattern_counts': {'":': 0, '<': 71, '<?xml version=': 0, '>': 85, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 75, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4600819', 'n_tokens_mistral': 1363, 'n_tokens_neox': 1300, 'n_words': 353}