1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-10-03 12:21:52 +02:00

Friend progress tracking

This commit is contained in:
Kamran Ahmed
2023-08-08 19:50:12 +01:00
parent 2c1ab6b19d
commit 92295a7906
4 changed files with 33 additions and 5 deletions

View File

@@ -13,8 +13,10 @@ import { Spinner } from '../ReactIcons/Spinner';
import { ErrorIcon } from '../ReactIcons/ErrorIcon';
export type ProgressMapProps = {
userId?: string;
resourceId: string;
resourceType: ResourceType;
onClose?: () => void;
};
type UserProgressResponse = {
@@ -31,8 +33,13 @@ type UserProgressResponse = {
};
export function UserProgressModal(props: ProgressMapProps) {
const { s: userId } = getUrlParams();
const { resourceId, resourceType } = props;
const {
resourceId,
resourceType,
userId: propUserId,
onClose: onModalClose,
} = props;
const { s: userId = propUserId } = getUrlParams();
const resourceSvgEl = useRef<HTMLDivElement>(null);
const popupBodyEl = useRef<HTMLDivElement>(null);
@@ -95,6 +102,7 @@ export function UserProgressModal(props: ProgressMapProps) {
deleteUrlParam('s');
setError('');
setShowModal(false);
onModalClose?.();
}
useKeydown('Escape', () => {