diff --git a/backend/api/src/like-profile.ts b/backend/api/src/like-profile.ts index 2d9c7318..d9d9b099 100644 --- a/backend/api/src/like-profile.ts +++ b/backend/api/src/like-profile.ts @@ -1,6 +1,6 @@ import { createSupabaseDirectClient } from 'shared/supabase/init' import { APIError, APIHandler } from './helpers/endpoint' -import { createProfileLikeNotification } from 'shared/create-love-notification' +import { createProfileLikeNotification } from 'shared/create-profile-notification' import { getHasFreeLike } from './has-free-like' import { log } from 'shared/utils' import { tryCatch } from 'common/util/try-catch' diff --git a/backend/api/src/ship-profiles.ts b/backend/api/src/ship-profiles.ts index 583fdda2..b288f879 100644 --- a/backend/api/src/ship-profiles.ts +++ b/backend/api/src/ship-profiles.ts @@ -1,6 +1,6 @@ import { createSupabaseDirectClient } from 'shared/supabase/init' import { APIError, APIHandler } from './helpers/endpoint' -import { createLoveShipNotification } from 'shared/create-love-notification' +import { createProfileShipNotification } from 'shared/create-profile-notification' import { log } from 'shared/utils' import { tryCatch } from 'common/util/try-catch' import { insert } from 'shared/supabase/utils' @@ -61,8 +61,8 @@ export const shipProfiles: APIHandler<'ship-profiles'> = async (props, auth) => const continuation = async () => { await Promise.all([ - createLoveShipNotification(data, data.target1_id), - createLoveShipNotification(data, data.target2_id), + createProfileShipNotification(data, data.target1_id), + createProfileShipNotification(data, data.target2_id), ]) } diff --git a/backend/email/emails/new-match.tsx b/backend/email/emails/new-match.tsx index 5ce1ee98..f9867f9a 100644 --- a/backend/email/emails/new-match.tsx +++ b/backend/email/emails/new-match.tsx @@ -21,7 +21,7 @@ export const NewMatchEmail = ({ email }: NewMatchEmailProps) => { const name = onUser.name.split(' ')[0] - // const userImgSrc = getLoveOgImageUrl(matchedWithUser, matchedProfile) + // const userImgSrc = getOgImageUrl(matchedWithUser, matchedProfile) const userUrl = `https://${DOMAIN}/${matchedWithUser.username}` return ( diff --git a/backend/email/emails/new-message.tsx b/backend/email/emails/new-message.tsx index 02eb51a7..f5ae1e9d 100644 --- a/backend/email/emails/new-message.tsx +++ b/backend/email/emails/new-message.tsx @@ -25,7 +25,7 @@ export const NewMessageEmail = ({ const name = toUser.name.split(' ')[0] const creatorName = fromUser.name const messagesUrl = `https://${DOMAIN}/messages/${channelId}` - // const userImgSrc = getLoveOgImageUrl(fromUser, fromUserProfile) + // const userImgSrc = getOgImageUrl(fromUser, fromUserProfile) return ( diff --git a/backend/scripts/import-love-finalize.sql b/backend/scripts/import-profile-finalize.sql similarity index 89% rename from backend/scripts/import-love-finalize.sql rename to backend/scripts/import-profile-finalize.sql index 122c5fd9..9a894d80 100644 --- a/backend/scripts/import-love-finalize.sql +++ b/backend/scripts/import-profile-finalize.sql @@ -14,10 +14,6 @@ select from temp_users; --- Rename temp_love_messages --- alter table temp_love_messages --- rename to private_user_messages; - -- alter table private_user_messages -- alter column channel_id set not null, -- alter column content set not null, diff --git a/backend/scripts/import-love-tables.sh b/backend/scripts/import-tables.sh similarity index 100% rename from backend/scripts/import-love-tables.sh rename to backend/scripts/import-tables.sh diff --git a/backend/shared/src/create-love-notification.ts b/backend/shared/src/create-profile-notification.ts similarity index 98% rename from backend/shared/src/create-love-notification.ts rename to backend/shared/src/create-profile-notification.ts index 67df0ac7..15ad8421 100644 --- a/backend/shared/src/create-love-notification.ts +++ b/backend/shared/src/create-profile-notification.ts @@ -39,7 +39,7 @@ export const createProfileLikeNotification = async (like: Row<'profile_likes'>) return await insertNotificationToSupabase(notification, pg) } -export const createLoveShipNotification = async ( +export const createProfileShipNotification = async ( ship: Row<'profile_ships'>, recipientId: string ) => { diff --git a/common/src/api/love-types.ts b/common/src/api/profile-types.ts similarity index 100% rename from common/src/api/love-types.ts rename to common/src/api/profile-types.ts diff --git a/common/src/api/schema.ts b/common/src/api/schema.ts index cad0f813..3e4dcb20 100644 --- a/common/src/api/schema.ts +++ b/common/src/api/schema.ts @@ -1,6 +1,6 @@ import { contentSchema, - combinedLoveUsersSchema, + combinedProfileSchema, baseProfilesSchema, arraybeSchema, } from 'common/api/zod-types' @@ -11,7 +11,7 @@ import {Profile, ProfileRow} from 'common/profiles/profile' import {Row} from 'common/supabase/utils' import {PrivateUser, User} from 'common/user' import {z} from 'zod' -import {LikeData, ShipData} from './love-types' +import {LikeData, ShipData} from './profile-types' import {DisplayUser, FullUser} from './user-types' import {PrivateMessageChannel} from 'common/supabase/private-messages' import {Notification} from 'common/notifications' @@ -160,7 +160,7 @@ export const API = (_apiTypeCheck = { method: 'POST', authed: true, rateLimited: true, - props: combinedLoveUsersSchema.partial(), + props: combinedProfileSchema.partial(), returns: {} as ProfileRow, }, 'update-notif-settings': { diff --git a/common/src/api/zod-types.ts b/common/src/api/zod-types.ts index 508c92c6..edecd9ba 100644 --- a/common/src/api/zod-types.ts +++ b/common/src/api/zod-types.ts @@ -94,5 +94,5 @@ const optionalProfilesSchema = z.object({ pref_romantic_styles: z.array(z.string()), }) -export const combinedLoveUsersSchema = +export const combinedProfileSchema = baseProfilesSchema.merge(optionalProfilesSchema) diff --git a/common/src/envs/constants.ts b/common/src/envs/constants.ts index 7731891e..b2a56cd0 100644 --- a/common/src/envs/constants.ts +++ b/common/src/envs/constants.ts @@ -87,6 +87,7 @@ export const RESERVED_PATHS = [ 'chat', 'chats', 'common', + 'compatibility', 'confirm-email', 'contact', 'contacts', @@ -110,7 +111,7 @@ export const RESERVED_PATHS = [ 'links', 'live', 'login', - 'love-questions', + 'questions', 'manifest', 'market', 'markets', diff --git a/common/src/profiles/constants.ts b/common/src/profiles/constants.ts index 109e2876..60e645cb 100644 --- a/common/src/profiles/constants.ts +++ b/common/src/profiles/constants.ts @@ -1,6 +1,6 @@ import { isProd } from 'common/envs/is-prod' -export const manifoldLoveUserId = isProd() +export const compassUserId = isProd() ? 'tRZZ6ihugZQLXPf6aPRneGpWLmz1' : 'RlXR2xa4EFfAzdCbSe45wkcdarh1' diff --git a/common/src/profiles/og-image.ts b/common/src/profiles/og-image.ts index 5ecde97f..22439b36 100644 --- a/common/src/profiles/og-image.ts +++ b/common/src/profiles/og-image.ts @@ -3,7 +3,7 @@ import { ProfileRow } from 'common/profiles/profile' import { buildOgUrl } from 'common/util/og' // TODO: handle age, gender undefined better -export type LoveOgProps = { +export type ogProps = { // user props avatarUrl: string username: string @@ -14,15 +14,15 @@ export type LoveOgProps = { gender: string } -export function getLoveOgImageUrl(user: User, profile?: ProfileRow | null) { - const loveProps = { +export function getProfileOgImageUrl(user: User, profile?: ProfileRow | null) { + const props = { avatarUrl: profile?.pinned_url, username: user.username, name: user.name, age: profile?.age?.toString() ?? '25', city: profile?.city ?? 'Internet', gender: profile?.gender ?? '???', - } as LoveOgProps + } as ogProps - return buildOgUrl(loveProps, 'profile') + return buildOgUrl(props, 'profile') } diff --git a/common/src/user.ts b/common/src/user.ts index 1d697045..fa1ee294 100644 --- a/common/src/user.ts +++ b/common/src/user.ts @@ -28,9 +28,6 @@ export type User = { isBannedFromPosting?: boolean userDeleted?: boolean - // fromLove?: boolean // whether originally from manifold.love back when it was synced to manifold - // fromManifold?: boolean // whether has a manifold.markets account - sweestakesVerified?: boolean verifiedPhone?: boolean idVerified?: boolean diff --git a/web/components/answers/add-compatibility-question-button.tsx b/web/components/answers/add-compatibility-question-button.tsx index 44ada699..c56b02c8 100644 --- a/web/components/answers/add-compatibility-question-button.tsx +++ b/web/components/answers/add-compatibility-question-button.tsx @@ -1,22 +1,22 @@ -import { useState } from 'react' -import { Button } from 'web/components/buttons/button' -import { Col } from 'web/components/layout/col' -import { MODAL_CLASS, Modal } from 'web/components/layout/modal' -import { Row } from 'web/components/layout/row' -import { ExpandingInput } from 'web/components/widgets/expanding-input' -import { PlusIcon, XIcon } from '@heroicons/react/outline' -import { MAX_ANSWER_LENGTH } from 'common/envs/constants' -import { useUser } from 'web/hooks/use-user' -import { User } from 'common/user' -import { useEvent } from 'web/hooks/use-event' -import { track } from 'web/lib/service/analytics' -import { toast } from 'react-hot-toast' -import { api } from 'web/lib/api' -import { Row as rowFor } from 'common/supabase/utils' -import { AnswerCompatibilityQuestionContent } from './answer-compatibility-question-content' -import { uniq } from 'lodash' -import { QuestionWithCountType } from 'web/hooks/use-questions' -import { MAX_COMPATIBILITY_QUESTION_LENGTH } from 'common/profiles/constants' +import {useState} from 'react' +import {Button} from 'web/components/buttons/button' +import {Col} from 'web/components/layout/col' +import {Modal, MODAL_CLASS} from 'web/components/layout/modal' +import {Row} from 'web/components/layout/row' +import {ExpandingInput} from 'web/components/widgets/expanding-input' +import {PlusIcon, XIcon} from '@heroicons/react/outline' +import {MAX_ANSWER_LENGTH} from 'common/envs/constants' +import {useUser} from 'web/hooks/use-user' +import {User} from 'common/user' +import {useEvent} from 'web/hooks/use-event' +import {track} from 'web/lib/service/analytics' +import {toast} from 'react-hot-toast' +import {api} from 'web/lib/api' +import {Row as rowFor} from 'common/supabase/utils' +import {AnswerCompatibilityQuestionContent} from './answer-compatibility-question-content' +import {uniq} from 'lodash' +import {QuestionWithCountType} from 'web/hooks/use-questions' +import {MAX_COMPATIBILITY_QUESTION_LENGTH} from 'common/profiles/constants' export function AddCompatibilityQuestionButton(props: { refreshCompatibilityAll: () => void @@ -121,13 +121,13 @@ function CreateCompatibilityModalContent(props: { const noRepeatOptions = uniq(options).length == options.length const generateJson = () => { - const jsonObject = options.reduce((obj, item, index) => { + // Note the change in the generic type + return options.reduce((obj, item, index) => { if (item.trim() !== '') { obj[item] = index // Mapping each option to its index } return obj - }, {} as Record) // Note the change in the generic type - return jsonObject + }, {} as Record) } const onAddQuestion = useEvent(async () => { @@ -142,7 +142,7 @@ function CreateCompatibilityModalContent(props: { if (q) { afterAddQuestion(q as rowFor<'compatibility_prompts'>) } - track('create love compatibility question') + track('create compatibility question') } catch (e) { toast.error('Error creating compatibility question. Try again?') } diff --git a/web/components/answers/opinion-scale-display.tsx b/web/components/answers/opinion-scale-display.tsx index c7f5bef9..ab091b59 100644 --- a/web/components/answers/opinion-scale-display.tsx +++ b/web/components/answers/opinion-scale-display.tsx @@ -47,7 +47,7 @@ export function OpinionScale(props: { size="xs" className={''} onClick={() => { - track('edit love questions') + track('edit questions') Router.push('opinion-scale') }} > diff --git a/web/components/browse-matches-button.tsx b/web/components/browse-matches-button.tsx index e81f9c68..e431c1fa 100644 --- a/web/components/browse-matches-button.tsx +++ b/web/components/browse-matches-button.tsx @@ -4,14 +4,12 @@ // import Link from 'next/link' // // import {MAX_COMMENT_LENGTH} from 'common/comment' -// import {Profile} from 'common/love/profile' // import {Button} from 'web/components/buttons/button' // import {Col} from 'web/components/layout/col' // import {Modal, SCROLLABLE_MODAL_CLASS} from 'web/components/layout/modal' // import {Row} from 'web/components/layout/row' // import {useTextEditor} from 'web/components/widgets/editor' // import {useUser} from 'web/hooks/use-user' -// import {CompatibilityScore} from 'common/love/compatibility-score' // import {CompatibleBadge} from './widgets/compatible-badge' // import {ProfileProfile} from './profile/profile-profile' // import {Pagination} from 'web/components/widgets/pagination' diff --git a/web/components/chat/chat-message.tsx b/web/components/chat/chat-message.tsx index 3180bcdc..8da7d193 100644 --- a/web/components/chat/chat-message.tsx +++ b/web/components/chat/chat-message.tsx @@ -13,7 +13,7 @@ import { UserAvatarAndBadge } from 'web/components/widgets/user-link' import Link from 'next/link' import DropdownMenu from 'web/components/comments/dropdown-menu' import { DotsHorizontalIcon, ReplyIcon } from '@heroicons/react/solid' -import { manifoldLoveUserId } from 'common/profiles/constants' +import { compassUserId } from 'common/profiles/constants' import { DisplayUser } from 'common/api/user-types' export const ChatMessageItem = memo(function ChatMessageItem(props: { @@ -129,7 +129,7 @@ export const SystemChatMessageItem = memo( if (!chat) return null const hideAvatar = chat.visibility === 'system_status' && - chat.userId === manifoldLoveUserId && + chat.userId === compassUserId && chats.length === 1 const totalUsers = otherUsers?.length || 1 return ( diff --git a/web/components/home/home.tsx b/web/components/home/home.tsx index 3d7bf82d..a4df39b3 100644 --- a/web/components/home/home.tsx +++ b/web/components/home/home.tsx @@ -1,6 +1,6 @@ import {useEffect} from "react"; import {Col} from "web/components/layout/col"; -import {SignUpButton} from "web/components/nav/love-sidebar"; +import {SignUpButton} from "web/components/nav/sidebar"; export function AboutBox(props: { title: string diff --git a/web/components/nav/love-bottom-nav-bar.tsx b/web/components/nav/bottom-nav-bar.tsx similarity index 98% rename from web/components/nav/love-bottom-nav-bar.tsx rename to web/components/nav/bottom-nav-bar.tsx index b2ebe95b..9e749285 100644 --- a/web/components/nav/love-bottom-nav-bar.tsx +++ b/web/components/nav/bottom-nav-bar.tsx @@ -4,8 +4,8 @@ import {MenuAlt3Icon} from '@heroicons/react/solid' import {Dialog, Transition} from '@headlessui/react' import {Fragment, useState} from 'react' import {useRouter} from 'next/router' -import Sidebar from './love-sidebar' -import {Item} from './love-sidebar-item' +import Sidebar from './sidebar' +import {Item} from './sidebar-item' import {useUser} from 'web/hooks/use-user' import {Avatar} from 'web/components/widgets/avatar' import {useIsIframe} from 'web/hooks/use-is-iframe' diff --git a/web/components/nav/love-profile-summary.tsx b/web/components/nav/profile-summary.tsx similarity index 100% rename from web/components/nav/love-profile-summary.tsx rename to web/components/nav/profile-summary.tsx diff --git a/web/components/nav/love-sidebar-item.tsx b/web/components/nav/sidebar-item.tsx similarity index 100% rename from web/components/nav/love-sidebar-item.tsx rename to web/components/nav/sidebar-item.tsx diff --git a/web/components/nav/love-sidebar.tsx b/web/components/nav/sidebar.tsx similarity index 97% rename from web/components/nav/love-sidebar.tsx rename to web/components/nav/sidebar.tsx index dcf4b01e..f5c649a4 100644 --- a/web/components/nav/love-sidebar.tsx +++ b/web/components/nav/sidebar.tsx @@ -10,8 +10,8 @@ import Router, { useRouter } from 'next/router' import { useUser } from 'web/hooks/use-user' import { firebaseLogin, firebaseLogout } from 'web/lib/firebase/users' import { withTracking } from 'web/lib/service/analytics' -import { ProfileSummary } from './love-profile-summary' -import { Item, SidebarItem } from './love-sidebar-item' +import { ProfileSummary } from './profile-summary' +import { Item, SidebarItem } from './sidebar-item' import SiteLogo from '../site-logo' import { Button, ColorType, SizeType } from 'web/components/buttons/button' import {signupRedirect} from 'web/lib/util/signup' diff --git a/web/components/notification-items.tsx b/web/components/notification-items.tsx index 36083905..008b0a26 100644 --- a/web/components/notification-items.tsx +++ b/web/components/notification-items.tsx @@ -33,7 +33,7 @@ export function NotificationItem(props: { notification: Notification }) { } else if (reason === 'new_profile_like') { return } else if (reason === 'new_profile_ship') { - return + return } else { return <>unknown notification: {sourceType} } @@ -164,7 +164,7 @@ function ProfileLikeNotification(props: { ) } -function LoveShipNotification(props: { +function ProfileShipNotification(props: { notification: Notification highlighted: boolean setHighlighted: (highlighted: boolean) => void diff --git a/web/components/optional-profile-form.tsx b/web/components/optional-profile-form.tsx index 50d4d1ea..edda87a5 100644 --- a/web/components/optional-profile-form.tsx +++ b/web/components/optional-profile-form.tsx @@ -31,7 +31,7 @@ import {MultipleChoiceOptions} from "common/profiles/multiple-choice"; import {POLITICAL_CHOICES, RELATIONSHIP_CHOICES, ROMANTIC_CHOICES} from "web/components/filters/choices"; import toast from "react-hot-toast"; -export const OptionalLoveUserForm = (props: { +export const OptionalProfileUserForm = (props: { profile: ProfileRow setProfile: >(key: K, value: ProfileRow[K]) => void user: User @@ -87,7 +87,7 @@ export const OptionalLoveUserForm = (props: { onSubmit && (await onSubmit()) setIsSubmitting(false) - track('submit love optional profile') + track('submit optional profile') if (user) router.push(`/${user.username}${fromSignup ? '?fromSignup=true' : ''}`) else router.push('/') diff --git a/web/components/page-base.tsx b/web/components/page-base.tsx index d7f6a116..2e7abc74 100644 --- a/web/components/page-base.tsx +++ b/web/components/page-base.tsx @@ -14,12 +14,12 @@ import {ReactNode, useState} from 'react' import {Toaster} from 'react-hot-toast' import {Col} from 'web/components/layout/col' import {PrivateMessagesIcon} from 'web/components/messaging/messages-icon' -import {BottomNavBar} from 'web/components/nav/love-bottom-nav-bar' +import {BottomNavBar} from 'web/components/nav/bottom-nav-bar' import {useIsMobile} from 'web/hooks/use-is-mobile' import {useTracking} from 'web/hooks/use-tracking' import {useUser} from 'web/hooks/use-user' import {GoogleOneTapLogin} from 'web/lib/firebase/google-onetap-login' -import Sidebar from './nav/love-sidebar' +import Sidebar from './nav/sidebar' import {useProfile} from 'web/hooks/use-profile' import {Profile} from 'common/profiles/profile' import {NotificationsIcon, SolidNotificationsIcon} from './notifications-icon' @@ -55,7 +55,7 @@ export function PageBase(props: { const mobileSidebarOptions = getMobileSidebar(() => setIsAddFundsModalOpen(true)) // eslint-disable-next-line react-hooks/rules-of-hooks - trackPageView && useTracking(`view love ${trackPageView}`, trackPageProps) + trackPageView && useTracking(`view ${trackPageView}`, trackPageProps) useOnline() const [_, setIsAddFundsModalOpen] = useState(false) diff --git a/web/components/profile-carousel.tsx b/web/components/profile-carousel.tsx index 60b0be7d..abe9c0cf 100644 --- a/web/components/profile-carousel.tsx +++ b/web/components/profile-carousel.tsx @@ -6,7 +6,7 @@ import { buildArray } from 'common/util/array' import { Carousel } from 'web/components/widgets/carousel' import { MODAL_CLASS, Modal } from 'web/components/layout/modal' import { Col } from 'web/components/layout/col' -import { SignUpButton } from './nav/love-sidebar' +import { SignUpButton } from './nav/sidebar' import { Profile } from 'common/profiles/profile' import { useAdmin } from 'web/hooks/use-admin' import { Button } from 'web/components/buttons/button' diff --git a/web/components/profile-grid.tsx b/web/components/profile-grid.tsx index 8add122d..a61f97fe 100644 --- a/web/components/profile-grid.tsx +++ b/web/components/profile-grid.tsx @@ -110,7 +110,7 @@ function ProfilePreview(props: { return ( track('click love profile preview')} + onClick={() => track('clickprofile preview')} href={`/${user.username}`} className="cursor-pointer group block bg-canvas-100 rounded-lg overflow-hidden shadow hover:shadow-md transition-shadow duration-200 h-full" > diff --git a/web/components/profile/profile-header.tsx b/web/components/profile/profile-header.tsx index 5df20d54..a26f2ffd 100644 --- a/web/components/profile/profile-header.tsx +++ b/web/components/profile/profile-header.tsx @@ -80,7 +80,7 @@ export default function ProfileHeader(props: {