Skip to content

miranlegin/fem-notifications-page

Repository files navigation

Frontend Mentor - Notifications page solution

This is a solution to the Notifications page challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.

Table of contents

Overview

The challenge

Users should be able to:

  • Distinguish between "unread" and "read" notifications
  • Select "Mark all as read" to toggle the visual state of the unread notifications and set the number of unread messages to zero
  • View the optimal layout for the interface depending on their device's screen size
  • See hover and focus states for all interactive elements on the page

Screenshot

Links

My process

Built with

  • React with Vite
  • Vanilla CSS

What I learned

After creating static version of this challenge i extracted the code into components and made initial state of the app. Then all there is needed to do was handle some logic for clearing the unread messages and updating message count. Snippet below is responsible for these functionality.

function clearNotificationsHandler() {
  const clearedNotifications = notifications.map((notification) => ({
    ...notification,
    status: true,
  }));

  setNotifications(clearedNotifications);
}

const unreadNotifications = notifications.filter(
  (notification) => notification.status === false
);

Useful resources

  • react.dev - Goto place for everything React!

Author

About

This project will be a brilliant test of your HTML, CSS, and basic JavaScript skills. You'll use JS to toggle the visual state of the notifications.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published