diff --git a/components/atoms/NotificationsCard/notification-card.tsx b/components/atoms/NotificationsCard/notification-card.tsx index 3272248b96..9cefa3ba1c 100644 --- a/components/atoms/NotificationsCard/notification-card.tsx +++ b/components/atoms/NotificationsCard/notification-card.tsx @@ -5,7 +5,7 @@ import { FaRegSmile, FaUserCircle } from "react-icons/fa"; import { getNotificationURL } from "lib/utils/get-notification-url"; interface NotificationCard { - type: "highlight_reaction" | "follow" | "collaboration"; + type: "highlight_reaction" | "follow" | "connections"; message: string; id: string; } @@ -14,7 +14,7 @@ const NotificationCard = ({ type, message, id }: NotificationCard) => { const Icons = { highlight_reaction: FaRegSmile, follow: FaUserCircle, - collaboration: FaUserCircle, + connections: FaUserCircle, }; const Icon = Icons[type]; diff --git a/components/molecules/CollaborationCard/collaboration-card.tsx b/components/molecules/ConnectionCard/connection-card.tsx similarity index 88% rename from components/molecules/CollaborationCard/collaboration-card.tsx rename to components/molecules/ConnectionCard/connection-card.tsx index 5ffc35593c..c834894b7d 100644 --- a/components/molecules/CollaborationCard/collaboration-card.tsx +++ b/components/molecules/ConnectionCard/connection-card.tsx @@ -4,7 +4,7 @@ import Avatar from "components/atoms/Avatar/avatar"; import { getAvatarByUsername } from "lib/utils/github"; import Button from "components/atoms/Button/button"; -export interface CollaborationRequestObject extends React.ComponentProps<"div"> { +export interface ConnectionRequestObject extends React.ComponentProps<"div"> { requestor: DbUser; outreachMessage: string; requestId: string; @@ -12,14 +12,14 @@ export interface CollaborationRequestObject extends React.ComponentProps<"div"> onDecline: (id: string) => void; } -const CollaborationCard = ({ +const ConnectionCard = ({ requestor, outreachMessage, className, requestId, onAccept, onDecline, -}: CollaborationRequestObject) => { +}: ConnectionRequestObject) => { return (
@@ -45,4 +45,4 @@ const CollaborationCard = ({ ); }; -export default CollaborationCard; +export default ConnectionCard; diff --git a/components/molecules/CollaborationSummaryCard/collaboration-summary-card.tsx b/components/molecules/ConnectionSummaryCard/connection-summary-card.tsx similarity index 62% rename from components/molecules/CollaborationSummaryCard/collaboration-summary-card.tsx rename to components/molecules/ConnectionSummaryCard/connection-summary-card.tsx index 5adf07ca65..83c961fd6f 100644 --- a/components/molecules/CollaborationSummaryCard/collaboration-summary-card.tsx +++ b/components/molecules/ConnectionSummaryCard/connection-summary-card.tsx @@ -3,20 +3,20 @@ import { TbMessageCode } from "react-icons/tb"; import React from "react"; import { BiMessage } from "react-icons/bi"; import Avatar from "components/atoms/Avatar/avatar"; -import { CollaborationRequestObject } from "../CollaborationCard/collaboration-card"; +import { ConnectionRequestObject } from "../ConnectionCard/connection-card"; -interface CollaborationSummaryCardProps { - requests: CollaborationRequestObject[]; +interface ConnectionSummaryCardProps { + requests: ConnectionRequestObject[]; connectionsCount?: number; messagesCount?: number; } -const CollaborationSummaryCard = ({ requests, connectionsCount, messagesCount }: CollaborationSummaryCardProps) => { +const ConnectionSummaryCard = ({ requests, connectionsCount, messagesCount }: ConnectionSummaryCardProps) => { return ( -
-
-
+
+
+
- Collaboration requests:{" "} + Connection requests:{" "} {requests.map((i, index) => (
- +
{requests[0].outreachMessage}
-
+
{connectionsCount} connections
@@ -47,4 +47,4 @@ const CollaborationSummaryCard = ({ requests, connectionsCount, messagesCount }: ); }; -export default CollaborationSummaryCard; +export default ConnectionSummaryCard; diff --git a/components/molecules/ContributorProfileHeader/contributor-profile-header.tsx b/components/molecules/ContributorProfileHeader/contributor-profile-header.tsx index 5176fa28bf..f1d5372e10 100644 --- a/components/molecules/ContributorProfileHeader/contributor-profile-header.tsx +++ b/components/molecules/ContributorProfileHeader/contributor-profile-header.tsx @@ -21,7 +21,7 @@ import RainbowBg from "img/rainbow-cover.png"; import Button from "components/atoms/Button/button"; import Text from "components/atoms/Typography/text"; import { Textarea } from "components/atoms/Textarea/text-area"; -import { useUserCollaborations } from "lib/hooks/useUserCollaborations"; +import { useUserConnections } from "lib/hooks/useUserConnections"; import { useToast } from "lib/hooks/useToast"; import { cardPageUrl } from "lib/utils/urls"; import { Dialog, DialogContent, DialogHeader, DialogTitle } from "../Dialog/dialog"; @@ -37,7 +37,7 @@ interface ContributorProfileHeaderProps { username: string | undefined; handleSignIn: (params: SignInWithOAuthCredentials) => void; isOwner: boolean; - isRecievingCollaborations?: boolean; + isRecievingConnections?: boolean; isPremium?: boolean; } const ContributorProfileHeader = ({ @@ -51,14 +51,14 @@ const ContributorProfileHeader = ({ user, handleSignIn, isOwner, - isRecievingCollaborations, + isRecievingConnections, isPremium, }: ContributorProfileHeaderProps) => { const router = useRouter(); const currentPath = router.asPath; const [isDialogOpen, setIsDialogOpen] = useState(false); const [loading, setLoading] = useState(false); - const { requestCollaboration } = useUserCollaborations(); + const { requestConnection } = useUserConnections(); const [message, setMessage] = useState(""); const [charCount, setCharCount] = useState(0); const [isCheckingCharLimit, setIsCheckingCharLimit] = useState(false); @@ -82,12 +82,12 @@ const ContributorProfileHeader = ({ } }; - const handleCollaborationRequest = async (e: React.FormEvent) => { + const handleConnectionRequest = async (e: React.FormEvent) => { e.preventDefault(); if (message && username) { setLoading(true); - await requestCollaboration({ username, message }); + await requestConnection({ username, message }); setIsDialogOpen(false); setTimeout(() => { document.body.setAttribute("style", "pointer-events:auto !important"); @@ -230,7 +230,7 @@ const ContributorProfileHeader = ({ - {isPremium && isRecievingCollaborations && ( + {isPremium && isRecievingConnections && ( - {isRecievingCollaborations && ( + {isRecievingConnections && (