@@ -6,6 +6,7 @@ import { SendBtn } from '#/app/components/input_components/send_button' import { IModelInputs } from '#/shared/api/models/models' import { c } from '#/shared/lib/helpers' import { useShowDataStore } from '#/shared/lib/hooks/use-show-data' +import { ChatDisclaimer } from '#/shared/ui/chat-disclaimer/chat-disclaimer' import { PredictPrice } from './predict-price' @@ -320,9 +321,10 @@ export const ModelInput: FC = ({ )} - - + {styles === 'chats' && ( + + )} > ) } @@ -1,11 +1,10 @@ import React, { useState } from 'react' import { useCookies } from 'react-cookie' import { useForm } from 'react-hook-form' +import { Button, InputAdornment, TextField, Typography, Checkbox } from '@mui/material' import { SubmitErrorHandler, SubmitHandler } from 'react-hook-form' -import { Button, InputAdornment, TextField } from '@mui/material' import Box from '@mui/material/Box' import CircularProgress from '@mui/material/CircularProgress' -import Typography from '@mui/material/Typography' import axios from 'axios' import Link from 'next/link' import { useRouter } from 'next/router' @@ -39,6 +38,7 @@ export const RegisterEmailForm: React.FC = ({ successLo const [cookie] = useCookies() const [passwordShowed, showPassword] = React.useState(false) + const [subscribedToEmails, setSubscribedToEmails] = React.useState(false) const makeNewAccount: SubmitHandler = async (data) => { setLoading(true) @@ -52,6 +52,7 @@ export const RegisterEmailForm: React.FC = ({ successLo utm_term: any utm_content: any referer?: string | null + subscribed_to_emails?: boolean } = { email: data.email, password: data.password1, @@ -66,6 +67,10 @@ export const RegisterEmailForm: React.FC = ({ successLo req_data.referer = localStorage.getItem('referral') } + if (subscribedToEmails) { + req_data.subscribed_to_emails = true + } + const { status, data: result } = await axios.post(getApiUrl() + '/auth/register', req_data) if (status !== 201) { @@ -183,6 +188,21 @@ export const RegisterEmailForm: React.FC = ({ successLo })} /> + + setSubscribedToEmails(e.target.checked)} + size='medium' + sx={{ + color: '#7F7DF3', + paddingTop: 0, + '&.Mui-checked': { color: '#7F7DF3' }, + }} + /> + + Хочу получать полезные материалы про ИИ, обновления моделей и маркетинговые сообщения на email + + {loading ? ( @@ -1,16 +1,15 @@ import { Button } from '@mui/material' import { signIn } from 'next-auth/react' import Image from 'next/image' -import React from 'react' +import React, { useState } from 'react' -import styles from './yandex-auth-button.module.scss' +export const YandexAuthButton = ({ children = 'Войти с Яндекс ID' }: { children?: React.ReactNode }) => { + const [hovered, setHovered] = useState(false) -interface YandexAuthButtonProps {} - -export const YandexAuthButton = ({}: YandexAuthButtonProps) => { return ( setHovered(true)} + onMouseLeave={() => setHovered(false)} data-testid='yandex-auth-button' variant='contained' onClick={async () => { @@ -19,6 +18,7 @@ export const YandexAuthButton = ({}: YandexAuthButtonProps) => { redirect: false, }) }} + style={{ opacity: hovered ? 0.7 : 1 }} sx={{ backgroundColor: '#1C1C1E', color: 'white', @@ -38,8 +38,8 @@ export const YandexAuthButton = ({}: YandexAuthButtonProps) => { }, }} > - - Войти с Яндекс ID + + {children} ) } @@ -0,0 +1,18 @@ +.root { + width: 100%; + color: #80808e; + font-weight: 400; + text-align: center; + letter-spacing: -0.01em; + line-height: 100%; +} + +.desktop { + margin-top: 6px; + font-size: 11px; +} + +.mobile { + margin-top: 6px; + font-size: 10px; +} @@ -0,0 +1,13 @@ +import { c } from '#/shared' + +import styles from './chat-disclaimer.module.scss' + +export const ChatDisclaimer = ({ desktop }: { desktop: boolean }) => { + return ( + + ИИ может делать ошибки, перепроверяйте результат. + {desktop ? ' ' : } + Не вводите личные данные других людей без их согласия. + + ) +} @@ -120,7 +120,7 @@ const Register: NextPageWithLayout = () => { {referral === '' && isReferral && ( <> - + Зарегистрироваться с Яндекс ID или email
+ ИИ может делать ошибки, перепроверяйте результат. + {desktop ? ' ' : } + Не вводите личные данные других людей без их согласия. +