Skip to content

Commit

Permalink
update: note kyberAI (#2193)
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenhoaidanh authored Aug 28, 2023
1 parent 38e2694 commit 2805d9c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
25 changes: 10 additions & 15 deletions src/pages/TrueSightV2/pages/RegisterWhitelist/SubscribeForm.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Trans, t } from '@lingui/macro'
import { debounce } from 'lodash'
import { FormEvent, useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { useMedia } from 'react-use'
import { Text } from 'rebass'
import { useLazyCheckReferralCodeQuery, useRequestWhiteListMutation } from 'services/kyberAISubscription'

Expand All @@ -13,10 +12,9 @@ import useParsedQueryString from 'hooks/useParsedQueryString'
import useTheme from 'hooks/useTheme'
import { getErrorMessage, isReferrerCodeInvalid } from 'pages/TrueSightV2/utils'
import { useSessionInfo } from 'state/authen/hooks'
import { MEDIA_WIDTHS } from 'theme'
import { isEmailValid } from 'utils/string'

import { FormWrapper, Input, Label } from './styled'
import { FormWrapper, Input } from './styled'

export default function EmailForm({
showVerify,
Expand All @@ -28,7 +26,6 @@ export default function EmailForm({
const qs = useParsedQueryString<{ referrer: string }>()
const [referredByCode, setCode] = useState(qs.referrer || '')
const [errorInput, setErrorInput] = useState({ email: '', referredByCode: '' })
const isMobile = useMedia(`(max-width: ${MEDIA_WIDTHS.upToSmall}px)`)

const { userInfo } = useSessionInfo()
const [requestWaitList] = useRequestWhiteListMutation()
Expand Down Expand Up @@ -101,35 +98,33 @@ export default function EmailForm({
return (
<>
<FormWrapper>
<Column style={{ width: isMobile ? '100%' : '70%' }} gap="6px">
<Label>
<Trans>Your Email*</Trans>
</Label>
<Column width="100%" gap="6px">
<Tooltip text={errorInput.email} show={!!errorInput.email} placement="top">
<Input
disabled={!!userInfo?.email}
$borderColor={errorInput.email ? theme.red : theme.border}
value={inputEmail}
placeholder="Enter your email address"
placeholder={t`Email Address`}
onChange={onChangeInput}
/>
</Tooltip>
<Text fontSize={10} color={theme.subText}>
<Trans>We will never share your email with third parties</Trans>
<Trans>We will never share your email with third parties.</Trans>
</Text>
</Column>
<Column gap="6px" style={{ width: isMobile ? '100%' : undefined }}>
<Label>
<Trans>Referral Code (Optional)</Trans>
</Label>

<Column width="100%" gap="6px">
<Tooltip text={errorInput.referredByCode} show={!!errorInput.referredByCode} placement="top">
<Input
$borderColor={errorInput.referredByCode ? theme.red : theme.border}
value={referredByCode}
placeholder="Enter your Code"
placeholder={t`Referral Code (Optional)`}
onChange={onChangeCode}
/>
</Tooltip>
<Text fontSize={10} color={theme.subText}>
<Trans>Use a referral code to get access to KyberAI faster!</Trans>
</Text>
</Column>
</FormWrapper>

Expand Down
4 changes: 2 additions & 2 deletions src/pages/TrueSightV2/pages/RegisterWhitelist/styled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ export const InputWithCopy = (props: InputProps) => {
}

export const FormWrapper = styled.div`
width: 500px;
width: 380px;
display: flex;
gap: 1rem;
z-index: 1;
flex-direction: column;
${({ theme }) => theme.mediaWidth.upToSmall`
width: 100%;
flex-wrap: wrap;
`}
`

0 comments on commit 2805d9c

Please sign in to comment.