/** * Copyright 2022 Beijing Volcano Engine Technology Co., Ltd. All Rights Reserved. * SPDX-license-identifier: BSD-3-Clause */ import { Button, Form, Input } from 'antd'; import { useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; import { v4 as uuid } from 'uuid'; import Header from '@/components/Header'; import { RootState } from '@/store'; import Utils from '@/utils/utils'; import ResizeWrapper from '@/components/ResizeWrapper'; import BubbleMsg from '@/components/BubbleMsg'; import RippleWave from '@/components/RippleWave'; import { useJoin } from '../../lib/useCommon'; import MagicTools from '@/assets/img/magicTool.svg'; import DouBao from '@/assets/img/doubao.svg'; import styles from './index.module.less'; import Config from '@/config'; export interface FormProps { username: string; roomId: string; } export default function () { const localUser = useSelector((state: RootState) => state.room.localUser); /** * Get roomId & UserId randomly */ const localRoomId = useSelector( (state: RootState) => Config.RoomId || state.room.roomId || Utils.getUrlArgs()?.roomId || uuid() ); const username = Config.UserId || Utils.getUrlArgs()?.userId || uuid(); const { t } = useTranslation(); const [form] = Form.useForm(); const [joining, dispatchJoin] = useJoin(); const handleStart = async (formValues: FormProps) => { if (joining) { return; } dispatchJoin(formValues, false); }; return (
Logo
{t('welcomeViewPart1')}
{t('welcomeViewPart2')}
{/* User not need to set it, just hidden and gen it randomly */} {/* User not need to set it, just hidden and gen it randomly */} ['roomId', 'username'].some((key) => prevValues[key] !== curValues[key]) } > {({ getFieldValue }) => ( )}
); }