added i18next language lib and some style fixes

This commit is contained in:
VyacheslavShtyrlin
2022-12-27 19:49:00 +05:00
parent c21a5c55a0
commit 5c8403fd7f
29 changed files with 732 additions and 335 deletions
+5 -16
View File
@@ -1,5 +1,5 @@
import "./toolbar.css";
import React, { useState, useEffect, useCallback } from "react";
import React, { useState, useEffect } from "react";
import { UserList } from "../UserList/UserList";
import { FullscreenButton } from "../ui/FullscreenButton/FullscreenButton";
import { PopupShare } from "../PopupShare/PopupShare";
@@ -8,7 +8,6 @@ import { ControlPanel } from "../ControlPanel/ControlPanel";
import { AnimatePresence, motion } from "framer-motion";
import { sidebarVariants, popupAnimation } from "../../utils/animationProps";
type link = {
id: string;
};
@@ -16,29 +15,22 @@ const userLocal = {
id: Math.floor(Math.random() * 100),
};
export const Sidebar: React.FC<any> = ({
closeStream,
data,
}) => {
export const Sidebar: React.FC<any> = ({ closeStream, data }) => {
const [open, setOpen] = useState(true);
const [popup, setPopup] = useState({
popup1: false,
popup2: false,
});
const [selected, setSelected] = useState(false);
const [icon, setIcon] = useState("");
const [isMuted, setMuted] = useState(true);
const handleMuteClick = () => {
setMuted((prev) => !prev);
};
function handleClosePopups() {
setPopup({
popup1: false,
@@ -65,7 +57,6 @@ export const Sidebar: React.FC<any> = ({
setSelected(false);
}
useEffect(() => () => unmountComponent(), []);
function unmountComponent() {
@@ -77,7 +68,6 @@ export const Sidebar: React.FC<any> = ({
}
return (
<div>
<motion.div
@@ -88,12 +78,11 @@ export const Sidebar: React.FC<any> = ({
<div className="toolbar-field">
<div className="toolbar-field-part">
<FullscreenButton></FullscreenButton>
<UserList
selected={selected}
setSelected={setSelected}
></UserList>
<UserList selected={selected} setSelected={setSelected}></UserList>
</div>
<ControlPanel
isMuted={isMuted}
handleMuteClick={handleMuteClick}
handleOpenSharePopup={handleOpenSharePopup}
handleOpenExitPopup={handleOpenExitPopup}
></ControlPanel>