feat: init agora

This commit is contained in:
Tristan Yang
2023-03-23 10:33:23 +08:00
parent 07ab652221
commit 88a8f061b5
12 changed files with 184 additions and 17 deletions
+36
View File
@@ -0,0 +1,36 @@
// import React from 'react';
import Tippy from '@tippyjs/react';
import { useTranslation } from 'react-i18next';
import { useAppSelector } from '../../../app/store';
import IconHeadphone from '../../../assets/icons/headphone.svg';
import Tooltip from '../../../common/component/Tooltip';
import Dashboard from './Dashboard';
type Props = {
channel: string
}
const VoiceChat = ({ channel }: Props) => {
const { loginUser, voice } = useAppSelector(store => { return { loginUser: store.authData.user, voice: store.authData.voice }; });
const { t } = useTranslation("chat");
const toolClass = `relative cursor-pointer`;
if (!loginUser) return null;
return (
<Tooltip tip={t("fav")} placement="left">
<Tippy
placement="left-start"
popperOptions={{ strategy: "fixed" }}
offset={[0, 164]}
interactive
trigger="click"
content={<Dashboard uid={loginUser.uid} channel={channel} voicing={voice} />}
>
<li className={`${toolClass}`}>
<IconHeadphone className="fill-gray-500" />
</li>
</Tippy>
</Tooltip>
);
};
export default VoiceChat;