mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-08-07 01:36:29 +02:00
Add favorite functionality
This commit is contained in:
@@ -10,7 +10,7 @@ import { FriendProgressItem } from './FriendProgressItem';
|
|||||||
import { UserProgressModal } from '../UserProgress/UserProgressModal';
|
import { UserProgressModal } from '../UserProgress/UserProgressModal';
|
||||||
import { InviteFriendPopup } from './InviteFriendPopup';
|
import { InviteFriendPopup } from './InviteFriendPopup';
|
||||||
import { UserCustomProgressModal } from '../UserProgress/UserCustomProgressModal';
|
import { UserCustomProgressModal } from '../UserProgress/UserCustomProgressModal';
|
||||||
import {UserIcon} from "lucide-react";
|
import { UserIcon } from 'lucide-react';
|
||||||
|
|
||||||
type FriendResourceProgress = {
|
type FriendResourceProgress = {
|
||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
|
@@ -96,7 +96,7 @@ export async function getResourceProgress(
|
|||||||
|
|
||||||
const userId = getUser()?.id;
|
const userId = getUser()?.id;
|
||||||
const progressKey = `${resourceType}-${resourceId}-${userId}-progress`;
|
const progressKey = `${resourceType}-${resourceId}-${userId}-progress`;
|
||||||
const isFavoriteKey = `${resourceType}-${resourceId}-${userId}-favorite`;
|
const isFavoriteKey = `${resourceType}-${resourceId}-favorite`;
|
||||||
|
|
||||||
const rawIsFavorite = localStorage.getItem(isFavoriteKey);
|
const rawIsFavorite = localStorage.getItem(isFavoriteKey);
|
||||||
const isFavorite = JSON.parse(rawIsFavorite || '0') === 1;
|
const isFavorite = JSON.parse(rawIsFavorite || '0') === 1;
|
||||||
|
Reference in New Issue
Block a user