Skip to content

LONDON | 25-ITP-MAY | TEWODROS BEKERE | SPRINT-3 | Reading-List-App #732

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

iteddy16
Copy link

…ying books and also improve CSS.

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

  • Add a title for the HTML, add a function to render to the HTML, and apply CSS to make it look like an example.

Briefly explain your PR.

Questions

Ask any questions you have for your reviewer.

@iteddy16 iteddy16 added 📅 Sprint 3 Assigned during Sprint 3 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jul 31, 2025
@iteddy16 iteddy16 changed the title LONDON | ITP-MA-25 | TEWODROS BEKERE | SPRINT-3 | Reading-List-App LONDON | 25-ITP-MAY | TEWODROS BEKERE | SPRINT-3 | Reading-List-App Jul 31, 2025
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you run the test? All tests fails at the moment. Please refactor the code accordingly!

</head>
<body>
<div id="content">
<ul id="reading-list"></ul>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hint: You will need to use this id reading-list to match the test cases.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't see the changed files and new commits!


const bookItem = document.createElement("div");
bookItem.className = "book";
bookItem.style.backgroundColor = book.alreadyRead ? "green" : "red";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works fine but it's best to keep styles in the css file rather then modifying in the DOM. I would recommend using class to change the colour. Can you refactor the code accordingly?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

bookItem.style.backgroundColor = book.alreadyRead ? "green" : "red";

const bookInfo = document.createElement("div");
bookInfo.innerHTML = `<strong>${book.title}</strong> by <strong>${book.author}</strong>`;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

innerHTML has a potential security issue. It's better to avoid using it. FYI, find more in this link. Can you refactor the code with an alternative property?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@day-lee day-lee added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Aug 1, 2025
@day-lee
Copy link

day-lee commented Aug 1, 2025

Good job! I've left a few comment. Please let me know if you need any help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reviewed Volunteer to add when completing a review with trainee action still to take. 📅 Sprint 3 Assigned during Sprint 3 of this module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants