mirror of
https://github.com/Vendicated/Vencord.git
synced 2024-09-19 22:20:34 +00:00
Compare commits
3 commits
7161e2eed8
...
3ab21ef344
Author | SHA1 | Date | |
---|---|---|---|
|
3ab21ef344 | ||
|
b875ebf92d | ||
|
19c87b6a7a |
6 changed files with 16 additions and 8 deletions
|
@ -103,7 +103,7 @@ function VoiceChannelTooltip({ channel }: VoiceChannelTooltipProps) {
|
||||||
<UserSummaryItem
|
<UserSummaryItem
|
||||||
users={users}
|
users={users}
|
||||||
renderIcon={false}
|
renderIcon={false}
|
||||||
max={7}
|
max={14}
|
||||||
size={18}
|
size={18}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -159,6 +159,7 @@ export const VoiceChannelIndicator = ErrorBoundary.wrap(({ userId }: VoiceChanne
|
||||||
<Tooltip
|
<Tooltip
|
||||||
text={<VoiceChannelTooltip channel={channel} />}
|
text={<VoiceChannelTooltip channel={channel} />}
|
||||||
tooltipClassName={cl("tooltip-container")}
|
tooltipClassName={cl("tooltip-container")}
|
||||||
|
tooltipContentClassName={cl("tooltip-content")}
|
||||||
>
|
>
|
||||||
{props =>
|
{props =>
|
||||||
isLocked ?
|
isLocked ?
|
||||||
|
|
|
@ -32,7 +32,7 @@ const settings = definePluginSettings({
|
||||||
default: true,
|
default: true,
|
||||||
restartNeeded: true
|
restartNeeded: true
|
||||||
},
|
},
|
||||||
showInVoiceMemberList: {
|
showInMemberList: {
|
||||||
type: OptionType.BOOLEAN,
|
type: OptionType.BOOLEAN,
|
||||||
description: "Show a user's Voice Channel indicator in the member and DMs list",
|
description: "Show a user's Voice Channel indicator in the member and DMs list",
|
||||||
default: true,
|
default: true,
|
||||||
|
@ -82,12 +82,12 @@ export default definePlugin({
|
||||||
match: /\.subtext,children:.+?}\)\]}\)(?=])/,
|
match: /\.subtext,children:.+?}\)\]}\)(?=])/,
|
||||||
replace: "$&,$self.VoiceChannelIndicator({userId:arguments[0]?.user?.id})"
|
replace: "$&,$self.VoiceChannelIndicator({userId:arguments[0]?.user?.id})"
|
||||||
},
|
},
|
||||||
predicate: () => settings.store.showInVoiceMemberList
|
predicate: () => settings.store.showInMemberList
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
if (settings.store.showInVoiceMemberList) {
|
if (settings.store.showInMemberList) {
|
||||||
addDecorator("UserVoiceShow", ({ user }) => user == null ? null : <VoiceChannelIndicator userId={user.id} />);
|
addDecorator("UserVoiceShow", ({ user }) => user == null ? null : <VoiceChannelIndicator userId={user.id} />);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -15,7 +15,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.vc-uvs-tooltip-container {
|
.vc-uvs-tooltip-container {
|
||||||
max-width: 200px;
|
max-width: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vc-uvs-tooltip-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.vc-uvs-guild-name {
|
.vc-uvs-guild-name {
|
||||||
|
@ -31,7 +37,5 @@
|
||||||
|
|
||||||
.vc-uvs-vc-members {
|
.vc-uvs-vc-members {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin: 8px 0;
|
|
||||||
flex-direction: row;
|
|
||||||
gap: 6px;
|
gap: 6px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,7 @@ export function makeLazy<T>(factory: () => T, attempts = 5, { isIndirect = false
|
||||||
};
|
};
|
||||||
|
|
||||||
getter.$$vencordLazyFailed = () => tries === attempts;
|
getter.$$vencordLazyFailed = () => tries === attempts;
|
||||||
|
|
||||||
return getter;
|
return getter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ export type LazyComponentType<P extends AnyRecord = AnyRecord> = React.FunctionC
|
||||||
[SYM_LAZY_COMPONENT_INNER]: () => AnyComponentType<P> | null;
|
[SYM_LAZY_COMPONENT_INNER]: () => AnyComponentType<P> | null;
|
||||||
};
|
};
|
||||||
export type AnyLazyComponentType<P extends AnyRecord = AnyRecord> = LazyComponentType<P & AnyRecord>;
|
export type AnyLazyComponentType<P extends AnyRecord = AnyRecord> = LazyComponentType<P & AnyRecord>;
|
||||||
|
export type AnyLazyComponentTypeWithChildren<P extends AnyRecord = AnyRecord> = AnyLazyComponentType<React.PropsWithChildren<P>>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A lazy component. The factory method is called on first render.
|
* A lazy component. The factory method is called on first render.
|
||||||
|
|
3
src/webpack/common/types/components.d.ts
vendored
3
src/webpack/common/types/components.d.ts
vendored
|
@ -16,6 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { AnyLazyComponentTypeWithChildren } from "@utils/lazyReact";
|
||||||
import type { ComponentType, CSSProperties, FunctionComponent, HtmlHTMLAttributes, HTMLProps, KeyboardEvent, MouseEvent, PropsWithChildren, PropsWithRef, ReactNode, Ref } from "react";
|
import type { ComponentType, CSSProperties, FunctionComponent, HtmlHTMLAttributes, HTMLProps, KeyboardEvent, MouseEvent, PropsWithChildren, PropsWithRef, ReactNode, Ref } from "react";
|
||||||
|
|
||||||
import { IconNames } from "./iconNames";
|
import { IconNames } from "./iconNames";
|
||||||
|
@ -371,7 +372,7 @@ export type Slider = ComponentType<PropsWithChildren<{
|
||||||
}>>;
|
}>>;
|
||||||
|
|
||||||
// TODO - type maybe idk probably not that useful other than the constants
|
// TODO - type maybe idk probably not that useful other than the constants
|
||||||
export type Flex = ComponentType<PropsWithChildren<any>> & {
|
export type Flex = AnyLazyComponentTypeWithChildren & {
|
||||||
Align: Record<"START" | "END" | "CENTER" | "STRETCH" | "BASELINE", string>;
|
Align: Record<"START" | "END" | "CENTER" | "STRETCH" | "BASELINE", string>;
|
||||||
Direction: Record<"VERTICAL" | "HORIZONTAL" | "HORIZONTAL_REVERSE", string>;
|
Direction: Record<"VERTICAL" | "HORIZONTAL" | "HORIZONTAL_REVERSE", string>;
|
||||||
Justify: Record<"START" | "END" | "CENTER" | "BETWEEN" | "AROUND", string>;
|
Justify: Record<"START" | "END" | "CENTER" | "BETWEEN" | "AROUND", string>;
|
||||||
|
|
Loading…
Reference in a new issue