chore: remove current user component
This commit is contained in:
@@ -1,92 +0,0 @@
|
||||
import styled from "styled-components";
|
||||
import soundIcon from "../../assets/icons/sound.on.svg?url";
|
||||
import micIcon from "../../assets/icons/mic.on.svg?url";
|
||||
import Avatar from "./Avatar";
|
||||
import useConfig from "../hook/useConfig";
|
||||
import { useAppSelector } from "../../app/store";
|
||||
import { FC } from "react";
|
||||
import { AgoraConfig } from "../../types/server";
|
||||
|
||||
const StyledWrapper = styled.div`
|
||||
background-color: #f4f4f5;
|
||||
position: sticky;
|
||||
bottom: 16px;
|
||||
margin: 8px;
|
||||
width: 94%;
|
||||
width: -webkit-fill-available;
|
||||
border-radius: 25px;
|
||||
padding: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.profile {
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 5px;
|
||||
.avatar {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 50%;
|
||||
object-fit: cover;
|
||||
}
|
||||
.toggle {
|
||||
}
|
||||
.info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.name {
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
color: #27272a;
|
||||
}
|
||||
.id {
|
||||
padding: 0 2px;
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
color: #52525b;
|
||||
}
|
||||
}
|
||||
}
|
||||
.settings {
|
||||
gap: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.icon {
|
||||
cursor: pointer;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
}
|
||||
`;
|
||||
type Props = {};
|
||||
const CurrentUser: FC<Props> = () => {
|
||||
const { values: agoraConfig } = useConfig("agora");
|
||||
const currUser = useAppSelector((store) => {
|
||||
return store.authData.user;
|
||||
});
|
||||
|
||||
if (!currUser) return null;
|
||||
const { uid, name, avatar } = currUser;
|
||||
return (
|
||||
<StyledWrapper>
|
||||
<div className="profile">
|
||||
<Avatar url={avatar} name={name} alt="user avatar" className="avatar" />
|
||||
<div className="info">
|
||||
<span className="name">{name}</span>
|
||||
<span className="id">#{uid}</span>
|
||||
</div>
|
||||
</div>
|
||||
{(agoraConfig as AgoraConfig)?.enabled && (
|
||||
<div className="settings">
|
||||
<img src={soundIcon} className="icon" alt="mic icon" />
|
||||
<img src={micIcon} className="icon" alt="sound icon" />
|
||||
</div>
|
||||
)}
|
||||
</StyledWrapper>
|
||||
);
|
||||
};
|
||||
export default CurrentUser;
|
||||
@@ -81,7 +81,6 @@ export default function ChatPage() {
|
||||
/>
|
||||
</nav>
|
||||
</div>
|
||||
{/* <CurrentUser /> */}
|
||||
</div>
|
||||
<div className={`right ${placeholderVisible ? "placeholder" : ""}`}>
|
||||
{placeholderVisible && <BlankPlaceholder />}
|
||||
|
||||
@@ -5,7 +5,6 @@ import { useParams } from "react-router-dom";
|
||||
import StyledWrapper from "./styled";
|
||||
import BlankPlaceholder from "../../common/component/BlankPlaceholder";
|
||||
import Server from "../../common/component/Server";
|
||||
import CurrentUser from "../../common/component/CurrentUser";
|
||||
import ChannelChat from "./ChannelChat";
|
||||
import DMChat from "./DMChat";
|
||||
import UsersModal from "../../common/component/UsersModal";
|
||||
@@ -48,7 +47,6 @@ export default function ChatPage() {
|
||||
<div className="left">
|
||||
<Server />
|
||||
<SessionList tempSession={tmpSession} />
|
||||
<CurrentUser />
|
||||
</div>
|
||||
<div className={`right ${placeholderVisible ? "placeholder" : ""}`}>
|
||||
{placeholderVisible && <BlankPlaceholder />}
|
||||
|
||||
@@ -40,7 +40,6 @@ export default function UsersPage() {
|
||||
})}
|
||||
</nav>
|
||||
</div>
|
||||
{/* <CurrentUser /> */}
|
||||
</div>
|
||||
{user_id ? (
|
||||
<div className="right">
|
||||
|
||||
Reference in New Issue
Block a user