mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-08-27 19:20:12 +02:00
Fix rating form does not show login popup
This commit is contained in:
@@ -3,6 +3,8 @@ import { Rating } from '../Rating/Rating';
|
|||||||
import type { RoadmapDocument } from './CreateRoadmap/CreateRoadmapModal';
|
import type { RoadmapDocument } from './CreateRoadmap/CreateRoadmapModal';
|
||||||
import { CustomRoadmapRatingsModal } from './CustomRoadmapRatingsModal';
|
import { CustomRoadmapRatingsModal } from './CustomRoadmapRatingsModal';
|
||||||
import { Star } from 'lucide-react';
|
import { Star } from 'lucide-react';
|
||||||
|
import { isLoggedIn } from '../../lib/jwt.ts';
|
||||||
|
import { showLoginPopup } from '../../lib/popup.ts';
|
||||||
|
|
||||||
type CustomRoadmapRatingsProps = {
|
type CustomRoadmapRatingsProps = {
|
||||||
roadmapSlug: string;
|
roadmapSlug: string;
|
||||||
@@ -40,6 +42,11 @@ export function CustomRoadmapRatings(props: CustomRoadmapRatingsProps) {
|
|||||||
<button
|
<button
|
||||||
className="flex h-[34px] items-center gap-2 rounded-md border border-gray-300 bg-white py-1 pl-2 pr-3 text-sm font-medium hover:border-black"
|
className="flex h-[34px] items-center gap-2 rounded-md border border-gray-300 bg-white py-1 pl-2 pr-3 text-sm font-medium hover:border-black"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
if (!isLoggedIn()) {
|
||||||
|
showLoginPopup();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
setIsDetailsOpen(true);
|
setIsDetailsOpen(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
Reference in New Issue
Block a user