Giter Site home page Giter Site logo

prateekoctane / sorting-filtering-with-react-hooks Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 651 KB

This is a small react app which handles a collection of books and displays them on the home screen. Through this app I have tried to implement sorting, filtering data using redux state and json-server sorting and filtering api features.

HTML 37.72% CSS 20.38% JavaScript 41.90%
api app axios filter json-server private-routes react react-redux react-router-dom sort

sorting-filtering-with-react-hooks's Introduction

Book Management

This is a small react app which handles a collection of books and displays them on the home screen. Through this app I have tried to implement sorting, filtering data using redux state and json-server sorting and filtering api features. Also implemented the persisting of data with the use of useSearchParams() hooks, useLocation(), useEffect(). Also implemented Private Routes, meaning only those who are logged in can view the single book page and can have admin access for editing the details of the books.

Tech Stacks Used:

1. react
2. react-redux
3. react-router-dom
4. axios
5. json-server
6. redux
7. useSearchParams()
8. redux-thunk

Glimpse of App:

More focuc on functionalities, UI is kept to minimal

Home Page

homePage

Flow of App

On load the app opens in Home Page. Where you can see navbar, sidebar and bookcards. Now if you want to click on any book card to go to the single book card page then it redirect to you the login page, asking you to login first, only then can you see the single book page. This is the implementation of the private route. After logging in, it redirect you to the single book page where you wanted to go originally.

On the home page there is sidebar. It has two options, one of sorting by category and the other one is filtering by release year. On clicking on sorting and filtering options the URL in the browser also changes accordingly which is accomplished the hook useSearchParams() provided by ract-router-dom library.

On refreshing the page the selections of radio and checkbox buttons remain the same. They dont get re-initialised. They persist.

After logging in you also can edit the book details by clicking on the small edit button below each Book Card.

sorting-filtering-with-react-hooks's People

Contributors

prateekoctane avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.