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,
|
||||
ActivityListIcon,
|
||||
ActivityViewProps,
|
||||
ActivityViewType,
|
||||
ApplicationIcon,
|
||||
IconCSSProperties
|
||||
} from "./types";
|
||||
|
@ -135,7 +134,7 @@ export default definePlugin({
|
|||
return null;
|
||||
},
|
||||
|
||||
showAllActivitiesComponent({ activity, user, activityGuild }: ActivityViewProps) {
|
||||
showAllActivitiesComponent({ activity, user, ...props }: ActivityViewProps) {
|
||||
const [currentActivity, setCurrentActivity] = React.useState<Activity | null>(
|
||||
activity?.type !== 4 ? activity! : null
|
||||
);
|
||||
|
@ -160,11 +159,10 @@ export default definePlugin({
|
|||
return (
|
||||
<div style={{ display: "flex", flexDirection: "column" }}>
|
||||
<ActivityView
|
||||
type={ActivityViewType.USER_POPOUT_V2}
|
||||
activity={currentActivity}
|
||||
user={user}
|
||||
activityGuild={activityGuild}
|
||||
showChannelDetails={true}/>
|
||||
{...props}
|
||||
/>
|
||||
<div
|
||||
className={cl("controls")}
|
||||
style={{
|
||||
|
@ -234,11 +232,9 @@ export default definePlugin({
|
|||
{activities.map((activity, index) => (
|
||||
<ActivityView
|
||||
key={index}
|
||||
type={ActivityViewType.USER_POPOUT_V2}
|
||||
activity={activity}
|
||||
user={user}
|
||||
activityGuild={activityGuild}
|
||||
showChannelDetails={true}
|
||||
{...props}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* 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";
|
||||
|
||||
export interface Timestamp {
|
||||
|
@ -82,22 +82,7 @@ export interface IconCSSProperties extends CSSProperties {
|
|||
"--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 {
|
||||
activity: Activity | null;
|
||||
user: User;
|
||||
activityGuild: Guild;
|
||||
type: ActivityViewType;
|
||||
showChannelDetails: boolean;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue