UserVoiceShow: fix visual issues (#4457)
This commit is contained in:
parent
de489fc6bd
commit
32b463059b
3 changed files with 8 additions and 6 deletions
|
|
@ -116,13 +116,14 @@ function VoiceChannelTooltip({ channel, isLocked }: VoiceChannelTooltipProps) {
|
|||
export interface VoiceChannelIndicatorProps {
|
||||
userId: string;
|
||||
isProfile?: boolean;
|
||||
isMessage?: boolean;
|
||||
isActionButton?: boolean;
|
||||
shouldHighlight?: boolean;
|
||||
}
|
||||
|
||||
const clickTimers = new Map<string, any>();
|
||||
|
||||
export const VoiceChannelIndicator = ErrorBoundary.wrap(({ userId, isProfile, isActionButton, shouldHighlight }: VoiceChannelIndicatorProps) => {
|
||||
export const VoiceChannelIndicator = ErrorBoundary.wrap(({ userId, isProfile, isMessage, isActionButton, shouldHighlight }: VoiceChannelIndicatorProps) => {
|
||||
const channelId = useStateFromStores([VoiceStateStore], () => VoiceStateStore.getVoiceStateForUser(userId)?.channelId);
|
||||
|
||||
const { isMuted, isDeaf } = useStateFromStores([VoiceStateStore], () => {
|
||||
|
|
@ -192,7 +193,7 @@ export const VoiceChannelIndicator = ErrorBoundary.wrap(({ userId, isProfile, is
|
|||
isActionButton && shouldHighlight && ActionButtonClasses.highlight,
|
||||
cl(isProfile && "profile-speaker")
|
||||
)}
|
||||
size={isActionButton ? 20 : 16}
|
||||
size={(isActionButton || isMessage) ? 20 : 16}
|
||||
/>
|
||||
)}
|
||||
</Tooltip>
|
||||
|
|
|
|||
|
|
@ -60,8 +60,8 @@ export default definePlugin({
|
|||
{
|
||||
find: "#{intl::USER_PROFILE_PRONOUNS}",
|
||||
replacement: {
|
||||
match: /(?<=children:\[\i," ",\i)(?=\])/,
|
||||
replace: ",$self.VoiceChannelIndicator({userId:arguments[0]?.user?.id,isProfile:true})"
|
||||
match: /(user:(\i).{0,100}onClickDisplayName:\i,trailing:)(\i)/,
|
||||
replace: "$1[$self.VoiceChannelIndicator({userId:$2.id,isProfile:true}),$3]"
|
||||
},
|
||||
predicate: () => settings.store.showInUserProfileModal
|
||||
},
|
||||
|
|
@ -100,7 +100,7 @@ export default definePlugin({
|
|||
addMemberListDecorator("UserVoiceShow", ({ user }) => user == null ? null : <VoiceChannelIndicator userId={user.id} />);
|
||||
}
|
||||
if (settings.store.showInMessages) {
|
||||
addMessageDecoration("UserVoiceShow", ({ message }) => message?.author == null ? null : <VoiceChannelIndicator userId={message.author.id} />);
|
||||
addMessageDecoration("UserVoiceShow", ({ message }) => message?.author == null ? null : <VoiceChannelIndicator userId={message.author.id} isMessage={true} />);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -14,8 +14,9 @@
|
|||
}
|
||||
|
||||
.vc-uvs-profile-speaker {
|
||||
width: var(--custom-nickname-icon-size);
|
||||
height: var(--custom-nickname-icon-size);
|
||||
margin-right: 4px;
|
||||
transform: translateY(1.3px);
|
||||
}
|
||||
|
||||
.vc-uvs-tooltip-container {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue