Giter Site home page Giter Site logo

project-1's People

Contributors

saramontasser avatar

Stargazers

 avatar  avatar

Watchers

 avatar

project-1's Issues

[PHASE-2] Add a README file describing how to run the project

you should add a README file detailing how anyone could run the project in the repository. I suggest initializing npm in the project so that I can have a package.json file so I can just type
npm install
then it will install all the project dependencies.

[PHASE-2] Create React like component instead of accessing all of these html elements in the js file

for example, the end result after you create the course component will look like this in HTML

<li class="course">
  <img src="imgs/python1.jpeg" alt="course image">
    <h3 class="course-title">Learn Python: The Complete Python Programming Course</h3>
    <p class="instructor">Avinash Jain , The Codex</p>
    <div class="rating-container">
      <span class="rating">4.4</span>
      <i class="fa-solid fa-star"></i>
      <i class="fa-solid fa-star"></i>
      <i class="fa-solid fa-star"></i>
      <i class="fa-solid fa-star"></i>
      <i class="fa-solid fa-star-half"></i>
      <span class="raters-number"> (1,284) </span>
    </div>
    <div class="price-container">
      <span class="new-price">E£199.99 </span>
      <span class="old-price">E£679.99</span>
    </div>
    <span class="best-seller">Bestseller</span>
</li>

I suggest you create this component one time as a string with dynamic content as if it is a react component and you give it its properties:

<li class="course">
  <img src=`{course.imageUrl}` alt="course image">
    <h3 class="course-title">{course.title}</h3>
    <p class="instructor">{course.instructor}</p>
    <div class="rating-container">
      <span class="rating">{course.rating}</span>
      <i class="fa-solid fa-star"></i>
      <i class="fa-solid fa-star"></i>
      <i class="fa-solid fa-star"></i>
      <i class="fa-solid fa-star"></i>
      <i class="fa-solid fa-star-half"></i>
      <span class="raters-number"> {course.raters_no} </span>
    </div>
    <div class="price-container">
      <span class="new-price">{course.newPrice} </span>
      <span class="old-price">{course.oldPrice}</span>
    </div>
    <span class="best-seller">Bestseller</span>
</li>

[PHASE-3] There is no need to fetch the courses every time you search for a course

You should fetch the courses for one time at first then apply your filters on these courses. For example, if you want to display only python courses you should filter the courses and create a new one with only python courses then render these courses.

check the javascript filter method here

Or you can use a library called lodash to do that for you you can find it here

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.