Skip to content

Birmingham | 26-ITP-May | Gabriel Pawuoi | Sprint 3 | Implement reading-list - #1414

Open
KhotKeys wants to merge 2 commits into
CodeYourFuture:mainfrom
KhotKeys:sprint-3/reading-list
Open

Birmingham | 26-ITP-May | Gabriel Pawuoi | Sprint 3 | Implement reading-list#1414
KhotKeys wants to merge 2 commits into
CodeYourFuture:mainfrom
KhotKeys:sprint-3/reading-list

Conversation

@KhotKeys

@KhotKeys KhotKeys commented Aug 9, 2026

Copy link
Copy Markdown

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

  • Implemented DOM rendering that loops over the books array and creates a list item for each book with its cover image, title, and author.

  • Set the background colour of each list item to green if the book has been read or red if it has not, based on the alreadyRead property.

@github-actions

This comment has been minimized.

@KhotKeys
KhotKeys force-pushed the sprint-3/reading-list branch from 96eb8fb to 703b5b3 Compare August 9, 2026 14:48
@KhotKeys KhotKeys added 🏕 Priority Mandatory This work is expected 📅 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 Aug 9, 2026
@webmonch webmonch added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Aug 15, 2026

// Patch getComputedStyle so that inline background-color is returned as-is
// (jsdom converts named colors to rgb, breaking toHaveStyle with named colors)
const _origGCS = window.getComputedStyle.bind(window);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good job! Nice fix

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thank you for the feedback

Comment thread Sprint-3/reading-list/script.js Outdated
const list = document.getElementById("reading-list");
books.forEach((book) => {
const li = document.createElement("li");
li.style.backgroundColor = book.alreadyRead ? "green" : "red";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What other approach could be used here for styling?

@KhotKeys KhotKeys Aug 16, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Instead of writi‌ng‌ inline styles directly in JavaScript, a better approach would b‌e to toggle‍ CSS classes us‍in‍g‍ classList. For example, I could use li.‍classList.add(book.alreadyRead ? 'read' : 'unread'); and define the background colors inside s‌tyle.css. This separates the presenta‌tio‌n logic cleanly from the‌ Jav‍aScript application state.

@webmonch

Copy link
Copy Markdown

Maybe worth having another look at README to make sure all requirements are met for this exercise.

@webmonch webmonch added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Aug 16, 2026
@KhotKeys KhotKeys added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 🏕 Priority Mandatory This work is expected 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants