Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Browse Available Books</title>
	<link rel="shortcut icon" href="/images/title-icon.png" type="image/png">
    <link rel="stylesheet" href="<%=htmlWebpackPlugin.files.chunks.main.css %>">
  </head>
  <body>
    <body>
    <div id="root">
    </div>
	
    <script src="<%= htmlWebpackPlugin.files.chunks.main.entry %>"></script>
  </body>
</html>
              
            
!

CSS

              
                
              
            
!

JS

              
                import React from 'react';
import ReactDOM from 'react-dom';
import "./scss/main.scss";
import Header from "./components/Header";
import Nav from "./components/Nav";
import Services from "./components/Services";
import General from "./components/General";

const menu = [
	{
		links: '/',
		label: 'Now Reading',
		className: 'now-reading',
		classNameList: ''
	},
	{
		links: '/',
		label: 'Browse',
		className: 'browse',
		classNameList: 'active-menu'
	},
	{
		links: '/',
		label: 'Buy Books',
		className: 'buy-book',
		classNameList: ''
	},
	{
		links: '/',
		label: 'Favourite Books',
		className: 'favorite-book',
		classNameList: ''
	},
	{
		links: '/',
		label: 'Wishlist',
		className: 'wishlist',
		classNameList: ''
	}
];
const books = [
	{
		ID: 1,
		Name: 'Jewels of Nizam',
		Author: 'by Geeta Devi',
	},
	{
		ID: 2,
		Name: 'Cakes & Bakes',
		Author: 'by Sanjeev Kapoor'
	},
	{
		ID: 3,
		Name: 'Jamie’s Kitchen',
		Author: 'by Jamie Oliver'
	},
	{
		ID: 4,
		Name: 'Inexpensive Family Meals',
		Author: 'by Simon Holst'
	},
	{
		ID: 5,
		Name: 'Paleo Slow Cooking',
		Author: 'by Chrissy Gower'
	},
	{
		ID: 6,
		Name: 'Cook Like an Italian',
		Author: 'by Tobie Puttock'
	},
	{
		ID: 7,
		Name: 'Suneeta Vaswani',
		Author: 'by Geeta Devi'
	},
	{
		ID: 8,
		Name: 'Jamie Does',
		Author: 'by Jamie Oliver'
	},
	{
		ID: 9,
		Name: 'Jamie’s italy',
		Author: 'by Jamie Oliver'
	},
	{
		ID: 10,
		Name: 'Vegetables Cookbook',
		Author: 'by Matthew Biggs'
	}
];

class App extends React.Component {
	constructor(props){
		super(props);
		this.state = {
			AllBooks: props.books,
			filteredBooks: props.books,
		}
	};

	showAllBooks() {
		const {AllBooks} = this.state;
		this.setState({filteredBooks: allBooks});
	}

	filteredByName(name) {
		const {AllBooks} = this.state;
		const filteredBooks = AllBooks.filter(book => book.Name ===name);
		this.setState({filteredBooks});
	}

	filteredByAuthoor(author) {
		const {AllBooks} = this.state;
		const filteredBooks = AllBooks.filter(book => book.Author === author)
	}



	render(){
		return(
			<div className="wrapper">
				<Header />
				<Nav action
					 showAllBooks={this.showAllBooks}
					 filterByName={this.filterByName}
					 filterByAuthor={this.filterByAuthor}
				/>
				<Services items={menu} />
				<General filteredBooks={this.state.filteredBooks} />
			</div>
		)
	}
}


ReactDOM.render(<App />, document.getElementById("root"));









import React, { Component } from "react";

class Nav extends React.Component{

	filteredByName(event) {
		const name = "One";
		this.props.filteredByName(name);

	}

	render(){
		return(
			<div className="nav">
				<div className="sort">
					<ul>
						<li>
							<a onClick={this.filterByName}>ByName</a>
						</li>
						<li>
							<a onClick={() => this.SortMostPopular}>Most Popular</a>
						</li>
						<li>
							<a onClick={() => this.SortMostRecent}>Most Recent</a>
						</li>
						<li>
							<a onClick={() => this.SortFreeBook}>Free Book</a>
						</li>
					</ul>
				</div>
				<div className="search">
					<form method="get" action="/search" className="form-search">
						<input type="text" placeholder="Enter Keywords" />
					</form>
				</div>
			</div>
		)
	}
}

export default Nav;



import React, { Component } from "react";


class General extends React.Component {

	render() {
		return (
			<div className="general">
				{this.props.filteredBooks.map((index, key) =>
					<div>
					</div>
				)}
			</div>
		)
	}
}

export default General;
              
            
!
999px

Console