mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-05-05 21:54:47 -04:00
Refactor
This commit is contained in:
@@ -1,26 +1,20 @@
|
||||
import { useState, useEffect } from 'react'
|
||||
import { Col } from 'web/components/layout/col'
|
||||
import {
|
||||
initialRequiredState,
|
||||
RequiredLoveUserForm,
|
||||
} from 'web/components/required-lover-form'
|
||||
import { OptionalLoveUserForm } from 'web/components/optional-lover-form'
|
||||
import { useUser } from 'web/hooks/use-user'
|
||||
import { LoadingIndicator } from 'web/components/widgets/loading-indicator'
|
||||
import { GoogleSignInButton } from 'web/components/buttons/sign-up-button'
|
||||
import {
|
||||
CACHED_REFERRAL_USERNAME_KEY,
|
||||
firebaseLogin,
|
||||
} from 'web/lib/firebase/users'
|
||||
import { api } from 'web/lib/api'
|
||||
import { useRouter } from 'next/router'
|
||||
import {useEffect, useState} from 'react'
|
||||
import {Col} from 'web/components/layout/col'
|
||||
import {initialRequiredState, RequiredLoveUserForm,} from 'web/components/required-lover-form'
|
||||
import {OptionalLoveUserForm} from 'web/components/optional-lover-form'
|
||||
import {useUser} from 'web/hooks/use-user'
|
||||
import {LoadingIndicator} from 'web/components/widgets/loading-indicator'
|
||||
import {GoogleSignInButton} from 'web/components/buttons/sign-up-button'
|
||||
import {CACHED_REFERRAL_USERNAME_KEY, firebaseLogin,} from 'web/lib/firebase/users'
|
||||
import {api} from 'web/lib/api'
|
||||
import {useRouter} from 'next/router'
|
||||
import ManifoldLoveLogo from 'web/components/manifold-love-logo'
|
||||
import { useTracking } from 'web/hooks/use-tracking'
|
||||
import { track } from 'web/lib/service/analytics'
|
||||
import { safeLocalStorage } from 'web/lib/util/local'
|
||||
import { removeUndefinedProps } from 'common/util/object'
|
||||
import { useLoverByUserId } from 'web/hooks/use-lover'
|
||||
import { LoverRow } from 'common/love/lover'
|
||||
import {useTracking} from 'web/hooks/use-tracking'
|
||||
import {track} from 'web/lib/service/analytics'
|
||||
import {safeLocalStorage} from 'web/lib/util/local'
|
||||
import {removeUndefinedProps} from 'common/util/object'
|
||||
import {useLoverByUserId} from 'web/hooks/use-lover'
|
||||
import {LoverRow} from 'common/love/lover'
|
||||
|
||||
export default function SignupPage() {
|
||||
const [step, setStep] = useState(0)
|
||||
@@ -33,7 +27,7 @@ export default function SignupPage() {
|
||||
...initialRequiredState,
|
||||
} as any)
|
||||
const setLoverState = (key: keyof LoverRow, value: any) => {
|
||||
setLoverForm((prevState) => ({ ...prevState, [key]: value }))
|
||||
setLoverForm((prevState) => ({...prevState, [key]: value}))
|
||||
}
|
||||
|
||||
const [isSubmitting, setIsSubmitting] = useState(false)
|
||||
@@ -49,11 +43,11 @@ export default function SignupPage() {
|
||||
return (
|
||||
<Col className="items-center">
|
||||
{user === undefined ? (
|
||||
<div />
|
||||
<div/>
|
||||
) : user === null ? (
|
||||
<Col className={'items-center justify-around gap-4 pt-[20vh]'}>
|
||||
<ManifoldLoveLogo noLink />
|
||||
<GoogleSignInButton onClick={firebaseLogin} />
|
||||
<ManifoldLoveLogo noLink/>
|
||||
<GoogleSignInButton onClick={firebaseLogin}/>
|
||||
</Col>
|
||||
) : (
|
||||
<Col className={'bg-canvas-0 w-full max-w-2xl px-6 py-4'}>
|
||||
@@ -70,7 +64,7 @@ export default function SignupPage() {
|
||||
}
|
||||
const referredByUsername = safeLocalStorage
|
||||
? safeLocalStorage.getItem(CACHED_REFERRAL_USERNAME_KEY) ??
|
||||
undefined
|
||||
undefined
|
||||
: undefined
|
||||
|
||||
setIsSubmitting(true)
|
||||
@@ -101,7 +95,7 @@ export default function SignupPage() {
|
||||
fromSignup
|
||||
/>
|
||||
) : (
|
||||
<LoadingIndicator />
|
||||
<LoadingIndicator/>
|
||||
)}
|
||||
</Col>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user