1
0
Fork 1
mirror of https://github.com/Vendicated/Vencord.git synced 2025-01-10 18:06:22 +00:00

feat(betterActivities): allow showing all activities below each other

This commit is contained in:
D3SOX 2024-05-07 10:04:53 +02:00
parent 58eb7943db
commit 4f0e9312ec
No known key found for this signature in database
GPG key ID: 39EC1673FC37B048

View file

@ -64,6 +64,21 @@ const settings = definePluginSettings({
default: true, default: true,
restartNeeded: false, restartNeeded: false,
}, },
allActivitiesStyle: {
type: OptionType.SELECT,
description: "Style for showing all activities",
options: [
{
default: true,
label: "Carousel",
value: "carousel",
},
{
label: "List",
value: "list",
},
]
}
}); });
const cl = classNameFactory("vc-bactivities-"); const cl = classNameFactory("vc-bactivities-");
@ -364,6 +379,7 @@ export default definePlugin({
if (!activities.length) return null; if (!activities.length) return null;
if (settings.store.allActivitiesStyle === "carousel") {
return ( return (
<div style={{ display: "flex", flexDirection: "column" }}> <div style={{ display: "flex", flexDirection: "column" }}>
<ActivityView <ActivityView
@ -371,8 +387,7 @@ export default definePlugin({
user={user} user={user}
guild={guild} guild={guild}
channelId={channelId} channelId={channelId}
onClose={onClose} onClose={onClose}/>
/>
<div <div
className={cl("controls")} className={cl("controls")}
style={{ style={{
@ -381,7 +396,10 @@ export default definePlugin({
justifyContent: "space-between", justifyContent: "space-between",
}} }}
> >
<Tooltip text="Left" tooltipClassName={cl("controls-tooltip")}>{({ onMouseEnter, onMouseLeave }) => { <Tooltip text="Left" tooltipClassName={cl("controls-tooltip")}>{({
onMouseEnter,
onMouseLeave
}) => {
return <span return <span
onMouseEnter={onMouseEnter} onMouseEnter={onMouseEnter}
onMouseLeave={onMouseLeave} onMouseLeave={onMouseLeave}
@ -393,8 +411,7 @@ export default definePlugin({
> >
<Caret <Caret
disabled={activities.indexOf(currentActivity!) < 1} disabled={activities.indexOf(currentActivity!) < 1}
direction="left" direction="left"/>
/>
</span>; </span>;
}}</Tooltip> }}</Tooltip>
@ -403,12 +420,14 @@ export default definePlugin({
<div <div
key={"dot--" + index} key={"dot--" + index}
onClick={() => setCurrentActivity(activity)} onClick={() => setCurrentActivity(activity)}
className={`dot ${currentActivity === activity ? "selected" : ""}`} className={`dot ${currentActivity === activity ? "selected" : ""}`}/>
/>
))} ))}
</div> </div>
<Tooltip text="Right" tooltipClassName={cl("controls-tooltip")}>{({ onMouseEnter, onMouseLeave }) => { <Tooltip text="Right" tooltipClassName={cl("controls-tooltip")}>{({
onMouseEnter,
onMouseLeave
}) => {
return <span return <span
onMouseEnter={onMouseEnter} onMouseEnter={onMouseEnter}
onMouseLeave={onMouseLeave} onMouseLeave={onMouseLeave}
@ -420,13 +439,34 @@ export default definePlugin({
> >
<Caret <Caret
disabled={activities.indexOf(currentActivity!) >= activities.length - 1} disabled={activities.indexOf(currentActivity!) >= activities.length - 1}
direction="right" direction="right"/>
/>
</span>; </span>;
}}</Tooltip> }}</Tooltip>
</div> </div>
</div> </div>
); );
} else {
return (
<div
style={{
display: "flex",
flexDirection: "column",
gap: "5px",
}}
>
{activities.map((activity, index) => (
<ActivityView
key={index}
activity={activity}
user={user}
guild={guild}
channelId={channelId}
onClose={onClose}
/>
))}
</div>
);
}
}, },
patches: [ patches: [