mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-04-04 06:51:45 -04:00
Fix warnings
This commit is contained in:
@@ -21,7 +21,7 @@ export const createUser: APIHandler<'create-user'> = async (
|
||||
auth,
|
||||
req
|
||||
) => {
|
||||
const { deviceToken: preDeviceToken, adminToken } = props
|
||||
const { deviceToken: preDeviceToken } = props
|
||||
const firebaseUser = await admin.auth().getUser(auth.uid)
|
||||
|
||||
const testUserAKAEmailPasswordUser =
|
||||
|
||||
@@ -16,7 +16,7 @@ interface NewMatchEmailProps {
|
||||
export const NewMatchEmail = ({
|
||||
onUser,
|
||||
matchedWithUser,
|
||||
matchedProfile,
|
||||
// matchedProfile,
|
||||
unsubscribeUrl,
|
||||
email
|
||||
}: NewMatchEmailProps) => {
|
||||
@@ -88,11 +88,11 @@ const container = {
|
||||
maxWidth: '600px',
|
||||
}
|
||||
|
||||
const logoContainer = {
|
||||
padding: '20px 0px 5px 0px',
|
||||
textAlign: 'center' as const,
|
||||
backgroundColor: '#ffffff',
|
||||
}
|
||||
// const logoContainer = {
|
||||
// padding: '20px 0px 5px 0px',
|
||||
// textAlign: 'center' as const,
|
||||
// backgroundColor: '#ffffff',
|
||||
// }
|
||||
|
||||
const content = {
|
||||
backgroundColor: '#ffffff',
|
||||
@@ -112,9 +112,9 @@ const imageContainer = {
|
||||
margin: '20px 0',
|
||||
}
|
||||
|
||||
const profileImage = {
|
||||
// border: '1px solid #ec489a',
|
||||
}
|
||||
// const profileImage = {
|
||||
// // border: '1px solid #ec489a',
|
||||
// }
|
||||
|
||||
const button = {
|
||||
backgroundColor: '#4887ec',
|
||||
|
||||
@@ -1,26 +1,9 @@
|
||||
import {
|
||||
Body,
|
||||
Button,
|
||||
Container,
|
||||
Head,
|
||||
Html,
|
||||
Img,
|
||||
Link,
|
||||
Preview,
|
||||
Section,
|
||||
Text,
|
||||
} from '@react-email/components'
|
||||
import { type User } from 'common/user'
|
||||
import { type ProfileRow } from 'common/love/profile'
|
||||
import {
|
||||
jamesProfile,
|
||||
jamesUser,
|
||||
sinclairProfile,
|
||||
sinclairUser,
|
||||
} from './functions/mock'
|
||||
import { DOMAIN } from 'common/envs/constants'
|
||||
import { getLoveOgImageUrl } from 'common/love/og-image'
|
||||
import {button, container, content, Footer, imageContainer, main, paragraph, profileImage} from "email/utils";
|
||||
import {Body, Button, Container, Head, Html, Preview, Section, Text,} from '@react-email/components'
|
||||
import {type User} from 'common/user'
|
||||
import {type ProfileRow} from 'common/love/profile'
|
||||
import {jamesProfile, jamesUser, sinclairUser,} from './functions/mock'
|
||||
import {DOMAIN} from 'common/envs/constants'
|
||||
import {button, container, content, Footer, imageContainer, main, paragraph} from "email/utils";
|
||||
|
||||
interface NewMessageEmailProps {
|
||||
fromUser: User
|
||||
@@ -32,21 +15,21 @@ interface NewMessageEmailProps {
|
||||
}
|
||||
|
||||
export const NewMessageEmail = ({
|
||||
fromUser,
|
||||
fromUserProfile,
|
||||
toUser,
|
||||
channelId,
|
||||
unsubscribeUrl,
|
||||
email,
|
||||
}: NewMessageEmailProps) => {
|
||||
fromUser,
|
||||
// fromUserProfile,
|
||||
toUser,
|
||||
channelId,
|
||||
unsubscribeUrl,
|
||||
email,
|
||||
}: NewMessageEmailProps) => {
|
||||
const name = toUser.name.split(' ')[0]
|
||||
const creatorName = fromUser.name
|
||||
const messagesUrl = `https://${DOMAIN}/messages/${channelId}`
|
||||
const userImgSrc = getLoveOgImageUrl(fromUser, fromUserProfile)
|
||||
// const userImgSrc = getLoveOgImageUrl(fromUser, fromUserProfile)
|
||||
|
||||
return (
|
||||
<Html>
|
||||
<Head />
|
||||
<Head/>
|
||||
<Preview>New message from {creatorName}</Preview>
|
||||
<Body style={main}>
|
||||
<Container style={container}>
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
select,
|
||||
from,
|
||||
where,
|
||||
} from '../shared/src/supabase/sql-builder'
|
||||
} from 'shared/supabase/sql-builder'
|
||||
import { type JSONContent } from '@tiptap/core'
|
||||
|
||||
const removeNodesOfType = (
|
||||
|
||||
@@ -750,7 +750,7 @@ export type Database = {
|
||||
Returns: Json
|
||||
}
|
||||
ts_to_millis: {
|
||||
Args: { ts: string } | { ts: string }
|
||||
Args: { ts: string }
|
||||
Returns: number
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,15 @@
|
||||
import { PlusIcon } from '@heroicons/react/outline'
|
||||
import {ArrowLeftIcon, PlusIcon} from '@heroicons/react/outline'
|
||||
import clsx from 'clsx'
|
||||
import { User } from 'common/user'
|
||||
import { QuestionWithCountType } from 'web/hooks/use-questions'
|
||||
import { Button } from 'web/components/buttons/button'
|
||||
import { Col } from 'web/components/layout/col'
|
||||
import {
|
||||
MODAL_CLASS,
|
||||
Modal,
|
||||
SCROLLABLE_MODAL_CLASS,
|
||||
} from 'web/components/layout/modal'
|
||||
import { Row } from 'web/components/layout/row'
|
||||
import { IndividualQuestionRow } from '../questions-form'
|
||||
import { TbMessage } from 'react-icons/tb'
|
||||
import { OtherProfileAnswers } from './other-profile-answers'
|
||||
import { ArrowLeftIcon } from '@heroicons/react/outline'
|
||||
import { usePersistentInMemoryState } from 'web/hooks/use-persistent-in-memory-state'
|
||||
import {User} from 'common/user'
|
||||
import {QuestionWithCountType} from 'web/hooks/use-questions'
|
||||
import {Button} from 'web/components/buttons/button'
|
||||
import {Col} from 'web/components/layout/col'
|
||||
import {Modal, MODAL_CLASS, SCROLLABLE_MODAL_CLASS,} from 'web/components/layout/modal'
|
||||
import {Row} from 'web/components/layout/row'
|
||||
import {IndividualQuestionRow} from '../questions-form'
|
||||
import {TbMessage} from 'react-icons/tb'
|
||||
import {OtherProfileAnswers} from './other-profile-answers'
|
||||
import {usePersistentInMemoryState} from 'web/hooks/use-persistent-in-memory-state'
|
||||
|
||||
export function AddQuestionButton(props: {
|
||||
isFirstQuestion?: boolean
|
||||
@@ -22,7 +17,7 @@ export function AddQuestionButton(props: {
|
||||
user: User
|
||||
refreshAnswers: () => void
|
||||
}) {
|
||||
const { isFirstQuestion, questions, user, refreshAnswers } = props
|
||||
const {questions, user, refreshAnswers} = props
|
||||
const [openModal, setOpenModal] = usePersistentInMemoryState(
|
||||
false,
|
||||
`add-question-${user.id}`
|
||||
@@ -31,7 +26,7 @@ export function AddQuestionButton(props: {
|
||||
<>
|
||||
<Button color={'gray-outline'} onClick={() => setOpenModal(true)}>
|
||||
<Row className="items-center gap-1">
|
||||
<PlusIcon className="h-4 w-4" />
|
||||
<PlusIcon className="h-4 w-4"/>
|
||||
Add Free Response
|
||||
</Row>
|
||||
</Button>
|
||||
@@ -53,7 +48,7 @@ function AddQuestionModal(props: {
|
||||
user: User
|
||||
refreshAnswers: () => void
|
||||
}) {
|
||||
const { open, setOpen, questions, user, refreshAnswers } = props
|
||||
const {open, setOpen, questions, user, refreshAnswers} = props
|
||||
const addableQuestions = questions.filter(
|
||||
(q) => q.answer_type === 'free_response'
|
||||
)
|
||||
@@ -83,7 +78,7 @@ function AddQuestionModal(props: {
|
||||
setExpandedQuestion(null)
|
||||
}}
|
||||
>
|
||||
<ArrowLeftIcon className={'h-4 w-4'} />
|
||||
<ArrowLeftIcon className={'h-4 w-4'}/>
|
||||
</Button>
|
||||
<span className="font-semibold">{expandedQuestion.question}</span>
|
||||
</Row>
|
||||
@@ -120,7 +115,7 @@ function AddQuestionModal(props: {
|
||||
}}
|
||||
>
|
||||
{question.answer_count}
|
||||
<TbMessage className="h-4 w-4" />
|
||||
<TbMessage className="h-4 w-4"/>
|
||||
</button>
|
||||
</Row>
|
||||
)
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { User } from 'common/user'
|
||||
import { Col } from 'web/components/layout/col'
|
||||
import { CompatibilityQuestionsDisplay } from './compatibility-questions-display'
|
||||
import { FreeResponseDisplay } from './free-response-display'
|
||||
import { Profile } from 'common/love/profile'
|
||||
import {User} from 'common/user'
|
||||
import {Col} from 'web/components/layout/col'
|
||||
import {CompatibilityQuestionsDisplay} from './compatibility-questions-display'
|
||||
import {Profile} from 'common/love/profile'
|
||||
|
||||
export function ProfileAnswers(props: {
|
||||
isCurrentUser: boolean
|
||||
@@ -11,7 +10,7 @@ export function ProfileAnswers(props: {
|
||||
fromSignup?: boolean
|
||||
fromProfilePage?: Profile
|
||||
}) {
|
||||
const { isCurrentUser, user, fromSignup, fromProfilePage, profile } = props
|
||||
const {isCurrentUser, user, fromSignup, fromProfilePage, profile} = props
|
||||
|
||||
return (
|
||||
<Col className={'mt-2 gap-5'}>
|
||||
|
||||
@@ -1,230 +1,227 @@
|
||||
import clsx from 'clsx'
|
||||
import { Editor } from '@tiptap/react'
|
||||
import { useState } from 'react'
|
||||
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'
|
||||
import { Title } from 'web/components/widgets/title'
|
||||
import { Input } from 'web/components/widgets/input'
|
||||
|
||||
export const BrowseMatchesButton = (props: {
|
||||
profile: Profile
|
||||
potentialProfiles: Profile[]
|
||||
compatibilityScores: Record<string, CompatibilityScore>
|
||||
className?: string
|
||||
}) => {
|
||||
const { profile, potentialProfiles, compatibilityScores, className } = props
|
||||
|
||||
const currentUser = useUser()
|
||||
const isCurrentUser = currentUser?.id === profile.user_id
|
||||
|
||||
const [dialogOpen, setDialogOpen] = useState(false)
|
||||
const key = `comment ${potentialProfiles.map((l) => l.id).join(',')}`
|
||||
const editor = useTextEditor({
|
||||
key,
|
||||
size: 'sm',
|
||||
max: MAX_COMMENT_LENGTH,
|
||||
placeholder: 'Write your introduction...',
|
||||
})
|
||||
|
||||
const [isSubmitting, setIsSubmitting] = useState(false)
|
||||
|
||||
const submit = async () => {
|
||||
const introduction =
|
||||
(editor?.getCharacterCount() ?? 0) > 0 ? editor?.getJSON() : undefined
|
||||
|
||||
// setIsSubmitting(true)
|
||||
// const result = await createMatch({
|
||||
// userId1: profile.user_id,
|
||||
// userId2: selectedMatchId,
|
||||
// betAmount,
|
||||
// introduction,
|
||||
// }).finally(() => {
|
||||
// setIsSubmitting(false)
|
||||
// })
|
||||
setDialogOpen(false)
|
||||
|
||||
// console.log('result', result)
|
||||
|
||||
// if (result.success) {
|
||||
// window.location.reload()
|
||||
// }
|
||||
}
|
||||
if (!profile.looking_for_matches)
|
||||
return (
|
||||
<div className="text-ink-500 text-sm">
|
||||
Not looking for more matches right now
|
||||
</div>
|
||||
)
|
||||
|
||||
return (
|
||||
<>
|
||||
<Button
|
||||
className={clsx(className)}
|
||||
color="indigo"
|
||||
onClick={() => setDialogOpen(true)}
|
||||
disabled={isSubmitting}
|
||||
loading={isSubmitting}
|
||||
>
|
||||
Browse {isCurrentUser ? 'your compatible' : `for ${profile.user.name}`}
|
||||
</Button>
|
||||
{dialogOpen && (
|
||||
<BrowseMatchesDialog
|
||||
profile={profile}
|
||||
potentialProfiles={potentialProfiles}
|
||||
compatibilityScores={compatibilityScores}
|
||||
isSubmitting={isSubmitting}
|
||||
setOpen={setDialogOpen}
|
||||
submit={submit}
|
||||
editor={editor}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
const BrowseMatchesDialog = (props: {
|
||||
profile: Profile
|
||||
potentialProfiles: Profile[]
|
||||
compatibilityScores: Record<string, CompatibilityScore>
|
||||
isSubmitting: boolean
|
||||
setOpen: (open: boolean) => void
|
||||
submit: () => void
|
||||
editor: Editor | null
|
||||
}) => {
|
||||
const {
|
||||
profile,
|
||||
potentialProfiles,
|
||||
compatibilityScores,
|
||||
isSubmitting,
|
||||
setOpen,
|
||||
submit,
|
||||
editor,
|
||||
} = props
|
||||
|
||||
const [query, setQuery] = useState('')
|
||||
const [error, setError] = useState<string | undefined>(undefined)
|
||||
|
||||
const currentUser = useUser()
|
||||
const isCurrentUser = currentUser?.id === profile.user_id
|
||||
|
||||
const filteredProfiles = potentialProfiles.filter((profile) =>
|
||||
profile.user.name.toLowerCase().includes(query.toLowerCase())
|
||||
)
|
||||
const [potentialIndex, setPotentialIndex] = useState(0)
|
||||
const index = Math.min(potentialIndex, filteredProfiles.length - 1)
|
||||
const potentialProfile = filteredProfiles[index]
|
||||
|
||||
const compatibility = potentialProfile
|
||||
? compatibilityScores[potentialProfile.user_id]
|
||||
: undefined
|
||||
|
||||
return (
|
||||
<Modal
|
||||
className={clsx(SCROLLABLE_MODAL_CLASS, '!min-h-full')}
|
||||
size="lg"
|
||||
open
|
||||
setOpen={setOpen}
|
||||
>
|
||||
<Col className="bg-canvas-0 min-h-full gap-2 rounded p-4 pb-8">
|
||||
<Row className="justify-between">
|
||||
<Title className="!mb-0">
|
||||
Browse {!isCurrentUser && `for ${profile.user.name}`}
|
||||
</Title>
|
||||
<Input
|
||||
className={'!h-10 max-w-[200px] self-end text-sm'}
|
||||
value={query}
|
||||
placeholder={'Search name'}
|
||||
onChange={(e) => {
|
||||
setQuery(e.target.value)
|
||||
}}
|
||||
/>
|
||||
</Row>
|
||||
{filteredProfiles.length === 0 ? (
|
||||
<Col className="gap-4">
|
||||
<div>No remaining compatible matches.</div>
|
||||
<Link href="/referrals">
|
||||
<Button color="indigo">Refer friends</Button>
|
||||
</Link>
|
||||
</Col>
|
||||
) : (
|
||||
<Pagination
|
||||
className="self-start"
|
||||
page={index}
|
||||
setPage={setPotentialIndex}
|
||||
totalItems={filteredProfiles.length}
|
||||
pageSize={1}
|
||||
/>
|
||||
)}
|
||||
|
||||
{potentialProfile && (
|
||||
<>
|
||||
<CompatibilityScoreDisplay compatibility={compatibility} />
|
||||
<ProfileProfile
|
||||
profile={potentialProfile}
|
||||
user={potentialProfile.user}
|
||||
refreshProfile={() => window.location.reload()}
|
||||
fromProfilePage={profile}
|
||||
/>
|
||||
|
||||
{/* <Col key={profile.id} className={clsx('gap-4 px-3 py-2')}>
|
||||
<CommentInputTextArea
|
||||
isSubmitting={isSubmitting}
|
||||
editor={editor}
|
||||
user={user}
|
||||
hideToolbar={true}
|
||||
/>
|
||||
|
||||
<Button
|
||||
className="font-semibold"
|
||||
color="green"
|
||||
onClick={() => submit()}
|
||||
disabled={
|
||||
!selectedMatchId ||
|
||||
isSubmitting ||
|
||||
!betAmount ||
|
||||
betAmount < MIN_BET_AMOUNT_FOR_NEW_MATCH
|
||||
}
|
||||
loading={isSubmitting}
|
||||
>
|
||||
Submit match
|
||||
</Button>
|
||||
</Col> */}
|
||||
</>
|
||||
)}
|
||||
</Col>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
|
||||
function CompatibilityScoreDisplay(props: {
|
||||
compatibility: CompatibilityScore | undefined
|
||||
}) {
|
||||
const { compatibility } = props
|
||||
|
||||
if (!compatibility) return null
|
||||
|
||||
const lowConfidence = compatibility.confidence === 'low'
|
||||
|
||||
return (
|
||||
<Row className="text-ink-600 items-center gap-1">
|
||||
<CompatibleBadge
|
||||
className="text-primary-600 self-end font-semibold"
|
||||
compatibility={compatibility}
|
||||
/>
|
||||
compatible
|
||||
{lowConfidence && ' (low confidence)'}
|
||||
</Row>
|
||||
)
|
||||
}
|
||||
// import clsx from 'clsx'
|
||||
// import {Editor} from '@tiptap/react'
|
||||
// import {useState} from 'react'
|
||||
// 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'
|
||||
// import {Title} from 'web/components/widgets/title'
|
||||
// import {Input} from 'web/components/widgets/input'
|
||||
//
|
||||
// export const BrowseMatchesButton = (props: {
|
||||
// profile: Profile
|
||||
// potentialProfiles: Profile[]
|
||||
// compatibilityScores: Record<string, CompatibilityScore>
|
||||
// className?: string
|
||||
// }) => {
|
||||
// const {profile, potentialProfiles, compatibilityScores, className} = props
|
||||
//
|
||||
// const currentUser = useUser()
|
||||
// const isCurrentUser = currentUser?.id === profile.user_id
|
||||
//
|
||||
// const [dialogOpen, setDialogOpen] = useState(false)
|
||||
// const key = `comment ${potentialProfiles.map((l) => l.id).join(',')}`
|
||||
// const editor = useTextEditor({
|
||||
// key,
|
||||
// size: 'sm',
|
||||
// max: MAX_COMMENT_LENGTH,
|
||||
// placeholder: 'Write your introduction...',
|
||||
// })
|
||||
//
|
||||
// const [isSubmitting, _] = useState(false)
|
||||
//
|
||||
// const submit = async () => {
|
||||
// // const introduction =
|
||||
// // (editor?.getCharacterCount() ?? 0) > 0 ? editor?.getJSON() : undefined
|
||||
//
|
||||
// // setIsSubmitting(true)
|
||||
// // const result = await createMatch({
|
||||
// // userId1: profile.user_id,
|
||||
// // userId2: selectedMatchId,
|
||||
// // betAmount,
|
||||
// // introduction,
|
||||
// // }).finally(() => {
|
||||
// // setIsSubmitting(false)
|
||||
// // })
|
||||
// setDialogOpen(false)
|
||||
//
|
||||
// // console.log('result', result)
|
||||
//
|
||||
// // if (result.success) {
|
||||
// // window.location.reload()
|
||||
// // }
|
||||
// }
|
||||
// if (!profile.looking_for_matches)
|
||||
// return (
|
||||
// <div className="text-ink-500 text-sm">
|
||||
// Not looking for more matches right now
|
||||
// </div>
|
||||
// )
|
||||
//
|
||||
// return (
|
||||
// <>
|
||||
// <Button
|
||||
// className={clsx(className)}
|
||||
// color="indigo"
|
||||
// onClick={() => setDialogOpen(true)}
|
||||
// disabled={isSubmitting}
|
||||
// loading={isSubmitting}
|
||||
// >
|
||||
// Browse {isCurrentUser ? 'your compatible' : `for ${profile.user.name}`}
|
||||
// </Button>
|
||||
// {dialogOpen && (
|
||||
// <BrowseMatchesDialog
|
||||
// profile={profile}
|
||||
// potentialProfiles={potentialProfiles}
|
||||
// compatibilityScores={compatibilityScores}
|
||||
// isSubmitting={isSubmitting}
|
||||
// setOpen={setDialogOpen}
|
||||
// submit={submit}
|
||||
// editor={editor}
|
||||
// />
|
||||
// )}
|
||||
// </>
|
||||
// )
|
||||
// }
|
||||
//
|
||||
// const BrowseMatchesDialog = (props: {
|
||||
// profile: Profile
|
||||
// potentialProfiles: Profile[]
|
||||
// compatibilityScores: Record<string, CompatibilityScore>
|
||||
// isSubmitting: boolean
|
||||
// setOpen: (open: boolean) => void
|
||||
// submit: () => void
|
||||
// editor: Editor | null
|
||||
// }) => {
|
||||
// const {
|
||||
// profile,
|
||||
// potentialProfiles,
|
||||
// compatibilityScores,
|
||||
// setOpen,
|
||||
// } = props
|
||||
//
|
||||
// const [query, setQuery] = useState('')
|
||||
// // const [error, setError] = useState<string | undefined>(undefined)
|
||||
//
|
||||
// const currentUser = useUser()
|
||||
// const isCurrentUser = currentUser?.id === profile.user_id
|
||||
//
|
||||
// const filteredProfiles = potentialProfiles.filter((profile) =>
|
||||
// profile.user.name.toLowerCase().includes(query.toLowerCase())
|
||||
// )
|
||||
// const [potentialIndex, setPotentialIndex] = useState(0)
|
||||
// const index = Math.min(potentialIndex, filteredProfiles.length - 1)
|
||||
// const potentialProfile = filteredProfiles[index]
|
||||
//
|
||||
// const compatibility = potentialProfile
|
||||
// ? compatibilityScores[potentialProfile.user_id]
|
||||
// : undefined
|
||||
//
|
||||
// return (
|
||||
// <Modal
|
||||
// className={clsx(SCROLLABLE_MODAL_CLASS, '!min-h-full')}
|
||||
// size="lg"
|
||||
// open
|
||||
// setOpen={setOpen}
|
||||
// >
|
||||
// <Col className="bg-canvas-0 min-h-full gap-2 rounded p-4 pb-8">
|
||||
// <Row className="justify-between">
|
||||
// <Title className="!mb-0">
|
||||
// Browse {!isCurrentUser && `for ${profile.user.name}`}
|
||||
// </Title>
|
||||
// <Input
|
||||
// className={'!h-10 max-w-[200px] self-end text-sm'}
|
||||
// value={query}
|
||||
// placeholder={'Search name'}
|
||||
// onChange={(e) => {
|
||||
// setQuery(e.target.value)
|
||||
// }}
|
||||
// />
|
||||
// </Row>
|
||||
// {filteredProfiles.length === 0 ? (
|
||||
// <Col className="gap-4">
|
||||
// <div>No remaining compatible matches.</div>
|
||||
// <Link href="/referrals">
|
||||
// <Button color="indigo">Refer friends</Button>
|
||||
// </Link>
|
||||
// </Col>
|
||||
// ) : (
|
||||
// <Pagination
|
||||
// className="self-start"
|
||||
// page={index}
|
||||
// setPage={setPotentialIndex}
|
||||
// totalItems={filteredProfiles.length}
|
||||
// pageSize={1}
|
||||
// />
|
||||
// )}
|
||||
//
|
||||
// {potentialProfile && (
|
||||
// <>
|
||||
// <CompatibilityScoreDisplay compatibility={compatibility}/>
|
||||
// <ProfileProfile
|
||||
// profile={potentialProfile}
|
||||
// user={potentialProfile.user}
|
||||
// refreshProfile={() => window.location.reload()}
|
||||
// fromProfilePage={profile}
|
||||
// />
|
||||
//
|
||||
// {/* <Col key={profile.id} className={clsx('gap-4 px-3 py-2')}>
|
||||
// <CommentInputTextArea
|
||||
// isSubmitting={isSubmitting}
|
||||
// editor={editor}
|
||||
// user={user}
|
||||
// hideToolbar={true}
|
||||
// />
|
||||
//
|
||||
// <Button
|
||||
// className="font-semibold"
|
||||
// color="green"
|
||||
// onClick={() => submit()}
|
||||
// disabled={
|
||||
// !selectedMatchId ||
|
||||
// isSubmitting ||
|
||||
// !betAmount ||
|
||||
// betAmount < MIN_BET_AMOUNT_FOR_NEW_MATCH
|
||||
// }
|
||||
// loading={isSubmitting}
|
||||
// >
|
||||
// Submit match
|
||||
// </Button>
|
||||
// </Col> */}
|
||||
// </>
|
||||
// )}
|
||||
// </Col>
|
||||
// </Modal>
|
||||
// )
|
||||
// }
|
||||
//
|
||||
// function CompatibilityScoreDisplay(props: {
|
||||
// compatibility: CompatibilityScore | undefined
|
||||
// }) {
|
||||
// const {compatibility} = props
|
||||
//
|
||||
// if (!compatibility) return null
|
||||
//
|
||||
// const lowConfidence = compatibility.confidence === 'low'
|
||||
//
|
||||
// return (
|
||||
// <Row className="text-ink-600 items-center gap-1">
|
||||
// <CompatibleBadge
|
||||
// className="text-primary-600 self-end font-semibold"
|
||||
// compatibility={compatibility}
|
||||
// />
|
||||
// compatible
|
||||
// {lowConfidence && ' (low confidence)'}
|
||||
// </Row>
|
||||
// )
|
||||
// }
|
||||
|
||||
@@ -1,30 +1,18 @@
|
||||
import { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/outline'
|
||||
import { RelationshipType } from 'web/lib/util/convert-relationship-type'
|
||||
import { ReactNode } from 'react'
|
||||
import { FaUserGroup } from 'react-icons/fa6'
|
||||
import DropdownMenu from 'web/components/comments/dropdown-menu'
|
||||
import { Col } from 'web/components/layout/col'
|
||||
import { Row } from 'web/components/layout/row'
|
||||
import { CustomizeableDropdown } from 'web/components/widgets/customizeable-dropdown'
|
||||
import { Gender } from 'common/gender'
|
||||
import { AgeFilter, AgeFilterText } from './age-filter'
|
||||
import { GenderFilter, GenderFilterText } from './gender-filter'
|
||||
import {
|
||||
LocationFilter,
|
||||
LocationFilterProps,
|
||||
LocationFilterText,
|
||||
} from './location-filter'
|
||||
import { PrefGenderFilter, PrefGenderFilterText } from './pref-gender-filter'
|
||||
import {
|
||||
RelationshipFilter,
|
||||
RelationshipFilterText,
|
||||
} from './relationship-filter'
|
||||
import { KidsLabel, wantsKidsLabelsWithIcon } from './wants-kids-filter'
|
||||
import { HasKidsLabel } from './has-kids-filter'
|
||||
import { MyMatchesToggle } from './my-matches-toggle'
|
||||
import { Profile } from 'common/love/profile'
|
||||
import {ChevronDownIcon, ChevronUpIcon} from '@heroicons/react/outline'
|
||||
import {RelationshipType} from 'web/lib/util/convert-relationship-type'
|
||||
import {ReactNode} from 'react'
|
||||
import {FaUserGroup} from 'react-icons/fa6'
|
||||
import {Col} from 'web/components/layout/col'
|
||||
import {Row} from 'web/components/layout/row'
|
||||
import {CustomizeableDropdown} from 'web/components/widgets/customizeable-dropdown'
|
||||
import {Gender} from 'common/gender'
|
||||
import {AgeFilter, AgeFilterText} from './age-filter'
|
||||
import {GenderFilter, GenderFilterText} from './gender-filter'
|
||||
import {LocationFilter, LocationFilterProps, LocationFilterText,} from './location-filter'
|
||||
import {RelationshipFilter, RelationshipFilterText,} from './relationship-filter'
|
||||
import {MyMatchesToggle} from './my-matches-toggle'
|
||||
import {Profile} from 'common/love/profile'
|
||||
import {FilterFields} from "common/filters";
|
||||
import {hasKidsLabels} from "common/has-kids";
|
||||
|
||||
export function DesktopFilters(props: {
|
||||
filters: Partial<FilterFields>
|
||||
@@ -60,7 +48,7 @@ export function DesktopFilters(props: {
|
||||
open={open}
|
||||
content={
|
||||
<Row className="items-center gap-1">
|
||||
<FaUserGroup className="h-4 w-4" />
|
||||
<FaUserGroup className="h-4 w-4"/>
|
||||
<RelationshipFilterText
|
||||
relationship={
|
||||
filters.pref_relation_styles as
|
||||
@@ -74,7 +62,7 @@ export function DesktopFilters(props: {
|
||||
/>
|
||||
)}
|
||||
dropdownMenuContent={
|
||||
<RelationshipFilter filters={filters} updateFilter={updateFilter} />
|
||||
<RelationshipFilter filters={filters} updateFilter={updateFilter}/>
|
||||
}
|
||||
popoverClassName="bg-canvas-50"
|
||||
menuWidth="w-50"
|
||||
@@ -119,7 +107,7 @@ export function DesktopFilters(props: {
|
||||
)}
|
||||
dropdownMenuContent={
|
||||
<Col className="mx-2 mb-4">
|
||||
<AgeFilter filters={filters} updateFilter={updateFilter} />
|
||||
<AgeFilter filters={filters} updateFilter={updateFilter}/>
|
||||
</Col>
|
||||
}
|
||||
popoverClassName="bg-canvas-50"
|
||||
@@ -140,7 +128,7 @@ export function DesktopFilters(props: {
|
||||
)}
|
||||
dropdownMenuContent={
|
||||
<Col>
|
||||
<GenderFilter filters={filters} updateFilter={updateFilter} />
|
||||
<GenderFilter filters={filters} updateFilter={updateFilter}/>
|
||||
</Col>
|
||||
}
|
||||
popoverClassName="bg-canvas-50"
|
||||
@@ -264,15 +252,15 @@ export function DesktopFilters(props: {
|
||||
}
|
||||
|
||||
export function DropdownButton(props: { open: boolean; content: ReactNode }) {
|
||||
const { open, content } = props
|
||||
const {open, content} = props
|
||||
return (
|
||||
<Row className="hover:text-ink-700 items-center gap-0.5 transition-all">
|
||||
{content}
|
||||
<span className="text-ink-400">
|
||||
{open ? (
|
||||
<ChevronUpIcon className="h-4 w-4" />
|
||||
<ChevronUpIcon className="h-4 w-4"/>
|
||||
) : (
|
||||
<ChevronDownIcon className="h-4 w-4" />
|
||||
<ChevronDownIcon className="h-4 w-4"/>
|
||||
)}
|
||||
</span>
|
||||
</Row>
|
||||
|
||||
@@ -1,34 +1,17 @@
|
||||
import { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/outline'
|
||||
import {ChevronDownIcon, ChevronUpIcon} from '@heroicons/react/outline'
|
||||
import clsx from 'clsx'
|
||||
import { ReactNode, useState } from 'react'
|
||||
import { Col } from 'web/components/layout/col'
|
||||
import { Row } from 'web/components/layout/row'
|
||||
import { AgeFilter, AgeFilterText, getNoMinMaxAge } from './age-filter'
|
||||
import { GenderFilter, GenderFilterText } from './gender-filter'
|
||||
import { HasKidsFilter, HasKidsLabel } from './has-kids-filter'
|
||||
import {
|
||||
LocationFilter,
|
||||
LocationFilterProps,
|
||||
LocationFilterText,
|
||||
} from './location-filter'
|
||||
import { PrefGenderFilter, PrefGenderFilterText } from './pref-gender-filter'
|
||||
import {
|
||||
RelationshipFilter,
|
||||
RelationshipFilterText,
|
||||
} from './relationship-filter'
|
||||
import {
|
||||
KidsLabel,
|
||||
WantsKidsFilter,
|
||||
WantsKidsIcon,
|
||||
wantsKidsLabelsWithIcon,
|
||||
} from './wants-kids-filter'
|
||||
import { FaChild } from 'react-icons/fa6'
|
||||
import { MyMatchesToggle } from './my-matches-toggle'
|
||||
import { Profile } from 'common/love/profile'
|
||||
import { Gender } from 'common/gender'
|
||||
import { RelationshipType } from 'web/lib/util/convert-relationship-type'
|
||||
import {ReactNode, useState} from 'react'
|
||||
import {Col} from 'web/components/layout/col'
|
||||
import {Row} from 'web/components/layout/row'
|
||||
import {AgeFilter, AgeFilterText, getNoMinMaxAge} from './age-filter'
|
||||
import {GenderFilter, GenderFilterText} from './gender-filter'
|
||||
import {LocationFilter, LocationFilterProps, LocationFilterText,} from './location-filter'
|
||||
import {RelationshipFilter, RelationshipFilterText,} from './relationship-filter'
|
||||
import {MyMatchesToggle} from './my-matches-toggle'
|
||||
import {Profile} from 'common/love/profile'
|
||||
import {Gender} from 'common/gender'
|
||||
import {RelationshipType} from 'web/lib/util/convert-relationship-type'
|
||||
import {FilterFields} from "common/filters";
|
||||
import {hasKidsLabels} from "common/has-kids";
|
||||
|
||||
export function MobileFilters(props: {
|
||||
filters: Partial<FilterFields>
|
||||
@@ -50,6 +33,7 @@ export function MobileFilters(props: {
|
||||
} = props
|
||||
|
||||
const [openFilter, setOpenFilter] = useState<string | undefined>(undefined)
|
||||
|
||||
function hasAny(filterArray: any[] | undefined) {
|
||||
return filterArray && filterArray.length > 0
|
||||
}
|
||||
@@ -86,7 +70,7 @@ export function MobileFilters(props: {
|
||||
/>
|
||||
}
|
||||
>
|
||||
<RelationshipFilter filters={filters} updateFilter={updateFilter} />
|
||||
<RelationshipFilter filters={filters} updateFilter={updateFilter}/>
|
||||
</MobileFilterSection>
|
||||
{/* LOCATION */}
|
||||
<MobileFilterSection
|
||||
@@ -129,7 +113,7 @@ export function MobileFilters(props: {
|
||||
/>
|
||||
}
|
||||
>
|
||||
<AgeFilter filters={filters} updateFilter={updateFilter} />
|
||||
<AgeFilter filters={filters} updateFilter={updateFilter}/>
|
||||
</MobileFilterSection>
|
||||
{/* GENDER */}
|
||||
<MobileFilterSection
|
||||
@@ -146,7 +130,7 @@ export function MobileFilters(props: {
|
||||
/>
|
||||
}
|
||||
>
|
||||
<GenderFilter filters={filters} updateFilter={updateFilter} />
|
||||
<GenderFilter filters={filters} updateFilter={updateFilter}/>
|
||||
</MobileFilterSection>
|
||||
{/* PREFERRED GENDER */}
|
||||
{/*<MobileFilterSection*/}
|
||||
@@ -263,9 +247,9 @@ export function MobileFilterSection(props: {
|
||||
</Row>
|
||||
<div className="text-ink-400">
|
||||
{isOpen ? (
|
||||
<ChevronUpIcon className="h-5 w-5" />
|
||||
<ChevronUpIcon className="h-5 w-5"/>
|
||||
) : (
|
||||
<ChevronDownIcon className="h-5 w-5" />
|
||||
<ChevronDownIcon className="h-5 w-5"/>
|
||||
)}
|
||||
</div>
|
||||
</button>
|
||||
|
||||
@@ -54,7 +54,7 @@ export function LovePage(props: {
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
trackPageView && useTracking(`view love ${trackPageView}`, trackPageProps)
|
||||
useOnline()
|
||||
const [isAddFundsModalOpen, setIsAddFundsModalOpen] = useState(false)
|
||||
const [_, setIsAddFundsModalOpen] = useState(false)
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -10,8 +10,6 @@ import {ProfileAnswers} from 'web/components/answers/profile-answers'
|
||||
import {SignUpButton} from 'web/components/nav/love-sidebar'
|
||||
import {Profile} from 'common/love/profile'
|
||||
import {ProfileBio} from 'web/components/bio/profile-bio'
|
||||
import {areGenderCompatible} from 'common/love/compatibility-util'
|
||||
import {useProfile} from 'web/hooks/use-profile'
|
||||
import {useGetter} from 'web/hooks/use-getter'
|
||||
import {getStars} from 'web/lib/supabase/stars'
|
||||
import {Content} from "web/components/widgets/editor";
|
||||
@@ -29,7 +27,7 @@ export function ProfileProfile(props: {
|
||||
const {profile, user, refreshProfile, fromProfilePage, fromSignup} = props
|
||||
|
||||
const currentUser = useUser()
|
||||
const currentProfile = useProfile()
|
||||
// const currentProfile = useProfile()
|
||||
// const isCurrentUser = currentUser?.id === user.id
|
||||
|
||||
const {data: starredUserIds, refresh: refreshStars} = useGetter(
|
||||
@@ -55,8 +53,8 @@ export function ProfileProfile(props: {
|
||||
// const shipped =
|
||||
// !!ships && hasShipped(currentUser, fromProfilePage?.user_id, user.id, ships)
|
||||
|
||||
const areCompatible =
|
||||
!!currentProfile && areGenderCompatible(currentProfile, profile)
|
||||
// const areCompatible =
|
||||
// !!currentProfile && areGenderCompatible(currentProfile, profile)
|
||||
|
||||
// Allow everyone to message everyone for now
|
||||
const showMessageButton = true // liked || likedBack || !areCompatible
|
||||
|
||||
@@ -26,7 +26,7 @@ function RegisterComponent() {
|
||||
const searchParams = useSearchParams();
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [isLoadingGoogle, setIsLoadingGoogle] = useState(false);
|
||||
const [_, setIsLoadingGoogle] = useState(false);
|
||||
const user = useUser()
|
||||
|
||||
useEffect(() => {
|
||||
@@ -64,7 +64,7 @@ function RegisterComponent() {
|
||||
setError(null);
|
||||
try {
|
||||
const creds = await firebaseLogin();
|
||||
if (creds){
|
||||
if (creds) {
|
||||
setIsLoading(true)
|
||||
setIsLoadingGoogle(true);
|
||||
}
|
||||
@@ -80,6 +80,7 @@ function RegisterComponent() {
|
||||
const handleEmailPasswordSignIn = async (email: string, password: string) => {
|
||||
try {
|
||||
const creds = await signInWithEmailAndPassword(auth, email, password);
|
||||
console.log(creds)
|
||||
} catch (error) {
|
||||
console.error("Error signing in:", error);
|
||||
const message = 'Failed to sign in with your email and password';
|
||||
|
||||
Reference in New Issue
Block a user