mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-10 09:56:24 +00:00
fix(betterActivities): correctly pass props
This commit is contained in:
parent
c6560e8446
commit
917ae898c2
2 changed files with 5 additions and 24 deletions
|
@ -35,7 +35,6 @@ import {
|
||||||
Activity,
|
Activity,
|
||||||
ActivityListIcon,
|
ActivityListIcon,
|
||||||
ActivityViewProps,
|
ActivityViewProps,
|
||||||
ActivityViewType,
|
|
||||||
ApplicationIcon,
|
ApplicationIcon,
|
||||||
IconCSSProperties
|
IconCSSProperties
|
||||||
} from "./types";
|
} from "./types";
|
||||||
|
@ -135,7 +134,7 @@ export default definePlugin({
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
|
|
||||||
showAllActivitiesComponent({ activity, user, activityGuild }: ActivityViewProps) {
|
showAllActivitiesComponent({ activity, user, ...props }: ActivityViewProps) {
|
||||||
const [currentActivity, setCurrentActivity] = React.useState<Activity | null>(
|
const [currentActivity, setCurrentActivity] = React.useState<Activity | null>(
|
||||||
activity?.type !== 4 ? activity! : null
|
activity?.type !== 4 ? activity! : null
|
||||||
);
|
);
|
||||||
|
@ -160,11 +159,10 @@ export default definePlugin({
|
||||||
return (
|
return (
|
||||||
<div style={{ display: "flex", flexDirection: "column" }}>
|
<div style={{ display: "flex", flexDirection: "column" }}>
|
||||||
<ActivityView
|
<ActivityView
|
||||||
type={ActivityViewType.USER_POPOUT_V2}
|
|
||||||
activity={currentActivity}
|
activity={currentActivity}
|
||||||
user={user}
|
user={user}
|
||||||
activityGuild={activityGuild}
|
{...props}
|
||||||
showChannelDetails={true}/>
|
/>
|
||||||
<div
|
<div
|
||||||
className={cl("controls")}
|
className={cl("controls")}
|
||||||
style={{
|
style={{
|
||||||
|
@ -234,11 +232,9 @@ export default definePlugin({
|
||||||
{activities.map((activity, index) => (
|
{activities.map((activity, index) => (
|
||||||
<ActivityView
|
<ActivityView
|
||||||
key={index}
|
key={index}
|
||||||
type={ActivityViewType.USER_POPOUT_V2}
|
|
||||||
activity={activity}
|
activity={activity}
|
||||||
user={user}
|
user={user}
|
||||||
activityGuild={activityGuild}
|
{...props}
|
||||||
showChannelDetails={true}
|
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Guild, User } from "discord-types/general";
|
import { User } from "discord-types/general";
|
||||||
import { CSSProperties, ImgHTMLAttributes } from "react";
|
import { CSSProperties, ImgHTMLAttributes } from "react";
|
||||||
|
|
||||||
export interface Timestamp {
|
export interface Timestamp {
|
||||||
|
@ -82,22 +82,7 @@ export interface IconCSSProperties extends CSSProperties {
|
||||||
"--icon-size": string;
|
"--icon-size": string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum ActivityViewType {
|
|
||||||
USER_POPOUT = "UserPopout",
|
|
||||||
USER_POPOUT_V2 = "UserPopoutV2",
|
|
||||||
ACTIVITY_FEED = "ActivityFeed",
|
|
||||||
PROFILE = "Profile",
|
|
||||||
PROFILE_V2 = "ProfileV2",
|
|
||||||
STREAM_PREVIEW = "StreamPreview",
|
|
||||||
VOICE_CHANNEL = "VoiceChannel",
|
|
||||||
SIMPLIFIED_PROFILE = "SimplifiedProfile",
|
|
||||||
BITE_SIZE_POPOUT = "BiteSizePopout"
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ActivityViewProps {
|
export interface ActivityViewProps {
|
||||||
activity: Activity | null;
|
activity: Activity | null;
|
||||||
user: User;
|
user: User;
|
||||||
activityGuild: Guild;
|
|
||||||
type: ActivityViewType;
|
|
||||||
showChannelDetails: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue