mirror of
https://github.com/Sosokker/B2D-Ventures.git
synced 2025-12-18 21:44:06 +01:00
feat: replace Tooltip with CustomTooltip in FollowShareButtons; pass projectName as prop
This commit is contained in:
parent
7f68a31afa
commit
6e70bdf084
@ -3,7 +3,7 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
|
|
||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
|
import CustomTooltip from "@/components/customToolTip";
|
||||||
import { ShareIcon, StarIcon } from "lucide-react";
|
import { ShareIcon, StarIcon } from "lucide-react";
|
||||||
import { deleteFollow, getFollow, insertFollow } from "@/lib/data/followQuery";
|
import { deleteFollow, getFollow, insertFollow } from "@/lib/data/followQuery";
|
||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
@ -13,9 +13,10 @@ import { useQuery } from "@supabase-cache-helpers/postgrest-react-query";
|
|||||||
interface FollowShareButtons {
|
interface FollowShareButtons {
|
||||||
userId: string;
|
userId: string;
|
||||||
projectId: number;
|
projectId: number;
|
||||||
|
projectName: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const FollowShareButtons = ({ userId, projectId }: FollowShareButtons) => {
|
const FollowShareButtons = ({ userId, projectId, projectName }: FollowShareButtons) => {
|
||||||
const supabase = createSupabaseClient();
|
const supabase = createSupabaseClient();
|
||||||
const { data: follow, isLoading: followIsLoading } = useQuery(getFollow(supabase, userId, projectId), {
|
const { data: follow, isLoading: followIsLoading } = useQuery(getFollow(supabase, userId, projectId), {
|
||||||
staleTime: 0,
|
staleTime: 0,
|
||||||
@ -71,16 +72,9 @@ const FollowShareButtons = ({ userId, projectId }: FollowShareButtons) => {
|
|||||||
return (
|
return (
|
||||||
<div className="grid grid-cols-2 gap-5 justify-self-end ">
|
<div className="grid grid-cols-2 gap-5 justify-self-end ">
|
||||||
<div className="mt-2 cursor-pointer" onClick={handleFollow}>
|
<div className="mt-2 cursor-pointer" onClick={handleFollow}>
|
||||||
<TooltipProvider>
|
<CustomTooltip message={`Follow ${projectName}`}>
|
||||||
<Tooltip>
|
<StarIcon id="follow" fill={isFollowState ? "#fcb30e" : "#fff"} strokeWidth={2} />
|
||||||
<TooltipTrigger asChild>
|
</CustomTooltip>
|
||||||
<StarIcon id="follow" fill={isFollowState ? "#fcb30e" : "#fff"} strokeWidth={2} />
|
|
||||||
</TooltipTrigger>
|
|
||||||
<TooltipContent>
|
|
||||||
<p>Follow NVIDIA</p>
|
|
||||||
</TooltipContent>
|
|
||||||
</Tooltip>
|
|
||||||
</TooltipProvider>
|
|
||||||
</div>
|
</div>
|
||||||
<div onClick={handleShare} className="cursor-pointer mt-2">
|
<div onClick={handleShare} className="cursor-pointer mt-2">
|
||||||
<ShareIcon />
|
<ShareIcon />
|
||||||
|
|||||||
@ -89,7 +89,7 @@ export default async function ProjectDealPage({ params }: { params: { id: number
|
|||||||
<Image src="/logo.svg" alt="logo" width={50} height={50} className="sm:scale-75" />
|
<Image src="/logo.svg" alt="logo" width={50} height={50} className="sm:scale-75" />
|
||||||
<h1 className="mt-3 font-bold text-lg md:text-3xl">{projectData?.project_name}</h1>
|
<h1 className="mt-3 font-bold text-lg md:text-3xl">{projectData?.project_name}</h1>
|
||||||
</span>
|
</span>
|
||||||
<FollowShareButtons userId={user!.user.id} projectId={params.id} />
|
<FollowShareButtons userId={user!.user.id} projectId={params.id} projectName ={projectData?.project_name}/>
|
||||||
</div>
|
</div>
|
||||||
{/* end of pack */}
|
{/* end of pack */}
|
||||||
<p className="mt-2 sm:text-sm">{projectData?.project_short_description}</p>
|
<p className="mt-2 sm:text-sm">{projectData?.project_short_description}</p>
|
||||||
|
|||||||
@ -26,6 +26,7 @@ import { UnAuthorizedAlert } from "@/components/alert/unauthorized/alert";
|
|||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { DataTable } from "@/components/dataTable";
|
import { DataTable } from "@/components/dataTable";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
|
import CustomTooltip from "@/components/customToolTip";
|
||||||
|
|
||||||
export default async function Portfolio({ params }: { params: { uid: string } }) {
|
export default async function Portfolio({ params }: { params: { uid: string } }) {
|
||||||
const supabase = createSupabaseClient();
|
const supabase = createSupabaseClient();
|
||||||
|
|||||||
@ -34,9 +34,12 @@ export const AuthenticatedComponents = ({ uid, avatarUrl, notificationCount }: A
|
|||||||
<div className="relative inline-block">
|
<div className="relative inline-block">
|
||||||
<Bell className="h-6 w-6 " />
|
<Bell className="h-6 w-6 " />
|
||||||
{notificationCount >= 1 && (
|
{notificationCount >= 1 && (
|
||||||
<span className="absolute -top-1 -right-1 inline-flex items-center justify-center w-4 h-4 text-xs font-bold text-white bg-red-600 rounded-full animate-ping">
|
<div>
|
||||||
{notificationCount}
|
<span className="absolute -top-1 -right-1 inline-flex items-center justify-center w-4 h-4 text-xs font-bold text-white bg-red-600 rounded-full animate-ping"></span>
|
||||||
</span>
|
<span className="absolute -top-1 -right-1 inline-flex items-center justify-center w-4 h-4 text-xs font-bold text-white bg-red-600 rounded-full ">
|
||||||
|
{notificationCount}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user