refactor: tweaks

This commit is contained in:
Tristan Yang
2023-04-06 11:43:06 +08:00
parent ee60def56d
commit e2b560a76a
4 changed files with 5 additions and 6 deletions
+1 -2
View File
@@ -42,10 +42,9 @@ const serverSlice = createSlice({
name = "",
description = "",
show_user_online_status = false,
language = "en",
webclient_auto_update = true
} = action.payload || {};
return { upgraded, name, logo, description, inviteLink, show_user_online_status, language, webclient_auto_update };
return { upgraded, name, logo, description, inviteLink, show_user_online_status, webclient_auto_update };
},
updateInfo(state, action: PayloadAction<Partial<StoredServer>>) {
const values = action.payload || {};
+2 -3
View File
@@ -45,7 +45,7 @@ const User: FC<Props> = ({
const online = curr.online || curr.uid == loginUid;
const containerClass = clsx(`relative flex items-center justify-start gap-2 rounded-lg select-none`, interactive && "md:hover:bg-gray-500/10", compact ? "p-0" : "p-2");
const nameClass = clsx(`text-sm text-gray-500 max-w-[190px] truncate font-semibold dark:text-white`);
const statusClass = clsx(`absolute -bottom-[2.5px] -right-[2.5px] border-content rounded-full border-[1px] border-solid border-white dark:border-gray-300`,
const statusClass = clsx(`absolute -bottom-[2.5px] -right-[2.5px] border-content rounded-full border-[1px] border-white dark:border-gray-300`,
online ? "bg-green-500" : "bg-zinc-400",
compact ? "w-[15px] h-[15px]" : "w-3 h-3");
if (!popover)
@@ -71,7 +71,7 @@ const User: FC<Props> = ({
name={curr.name}
alt="avatar"
/>
<div className={statusClass}></div>
{curr.is_bot ? <IconBot className={clsx(compact && "absolute -bottom-[2.5px] -right-[2.5px]", "!w-[15px] !h-[15px]")} /> : <div className={statusClass}></div>}
</div>
{!compact && (
<span className={nameClass} title={curr?.name}>
@@ -79,7 +79,6 @@ const User: FC<Props> = ({
</span>
)}
{owner && <IconOwner />}
{curr.is_bot && <IconBot className={clsx(compact && "absolute -top-[2.5px] -right-[2.5px]", "!w-[15px] !h-[15px]")} />}
</div>
</ContextMenu>
);
@@ -58,7 +58,7 @@ const VoiceManagement = ({ info, setMute, setDeafen, leave }: Props) => {
return <li key={uid} className="flex items-center justify-between gap-6 pb-4 ">
<div className="flex items-center gap-2 transition-opacity">
<div className={clsx("w-8 h-8 flex shrink-0 relative")}>
{speaking && <div className="z-10 absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 opacity-0 rounded-full bg-green-500 animate-speaking w-10 h-10"></div>}
{speaking && <div className="z-10 absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 opacity-0 rounded-full bg-green-500 animate-speaking w-[36px] h-[36px]"></div>}
<Avatar
width={32}
height={32}