Fix issues introduced by #162.

Switch to more consistent naming scheme.
This commit is contained in:
Paul 2021-09-03 11:21:51 +01:00
parent 966daa6c78
commit 9adad4a4ab
4 changed files with 16 additions and 13 deletions

2
external/lang vendored

@ -1 +1 @@
Subproject commit cab80e5c4840c91f53fbc43f97a98923ec3abc51 Subproject commit 8676906ec594a42ee72dcc5ad227357bb300570d

View file

@ -52,9 +52,9 @@ export default observer(
} }
// The border radius of the channel icon, if it's a server-channel it should be square (undefined). // The border radius of the channel icon, if it's a server-channel it should be square (undefined).
let borderRadius; let borderRadius: string | undefined = "--border-radius-channel-icon";
if (!isServerChannel) { if (isServerChannel) {
borderRadius = "--border-radius-half"; borderRadius = undefined;
} }
return ( return (
@ -65,7 +65,7 @@ export default observer(
height={size} height={size}
loading="lazy" loading="lazy"
aria-hidden="true" aria-hidden="true"
{...borderRadius} borderRadius={borderRadius}
src={iconURL ?? fallback} src={iconURL ?? fallback}
/> />
); );

View file

@ -1,4 +1,5 @@
import { MicrophoneOff } from "@styled-icons/boxicons-regular"; import { MicrophoneOff } from "@styled-icons/boxicons-regular";
import { VolumeMute } from "@styled-icons/boxicons-solid";
import { observer } from "mobx-react-lite"; import { observer } from "mobx-react-lite";
import { useParams } from "react-router-dom"; import { useParams } from "react-router-dom";
import { Presence } from "revolt-api/types/Users"; import { Presence } from "revolt-api/types/Users";
@ -12,7 +13,6 @@ import { useClient } from "../../../context/revoltjs/RevoltClient";
import IconBase, { IconBaseProps } from "../IconBase"; import IconBase, { IconBaseProps } from "../IconBase";
import fallback from "../assets/user.png"; import fallback from "../assets/user.png";
import {VolumeMute} from "@styled-icons/boxicons-solid";
type VoiceStatus = "muted" | "deaf"; type VoiceStatus = "muted" | "deaf";
interface Props extends IconBaseProps<User> { interface Props extends IconBaseProps<User> {
@ -104,7 +104,7 @@ export default observer(
width={size} width={size}
height={size} height={size}
hover={hover} hover={hover}
borderRadius="--border-radius-user-profile-picture" borderRadius="--border-radius-user-icon"
aria-hidden="true" aria-hidden="true"
viewBox="0 0 32 32"> viewBox="0 0 32 32">
<foreignObject <foreignObject
@ -127,11 +127,12 @@ export default observer(
{props.voice && ( {props.voice && (
<foreignObject x="22" y="22" width="10" height="10"> <foreignObject x="22" y="22" width="10" height="10">
<VoiceIndicator status={props.voice}> <VoiceIndicator status={props.voice}>
{props.voice === "deaf" && ( {(props.voice === "deaf" && (
<VolumeMute size={6} /> <VolumeMute size={6} />
) ||props.voice === "muted" && ( )) ||
(props.voice === "muted" && (
<MicrophoneOff size={6} /> <MicrophoneOff size={6} />
)} ))}
</VoiceIndicator> </VoiceIndicator>
</foreignObject> </foreignObject>
)} )}

View file

@ -23,7 +23,9 @@
--scrollbar-thickness-ff: thin; --scrollbar-thickness-ff: thin;
--border-radius: 6px; --border-radius: 6px;
--border-radius-half: 50%; --border-radius-half: 50%;
--border-radius-user-profile-picture: var(--border-radius-half);
--border-radius-user-icon: var(--border-radius-half);
--border-radius-channel-icon: var(--border-radius-half);
--border-radius-server-icon: var(--border-radius-half); --border-radius-server-icon: var(--border-radius-half);
--input-border-width: 2px; --input-border-width: 2px;