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:
parent
58eb7943db
commit
4f0e9312ec
1 changed files with 97 additions and 57 deletions
|
@ -64,6 +64,21 @@ const settings = definePluginSettings({
|
|||
default: true,
|
||||
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-");
|
||||
|
@ -364,6 +379,7 @@ export default definePlugin({
|
|||
|
||||
if (!activities.length) return null;
|
||||
|
||||
if (settings.store.allActivitiesStyle === "carousel") {
|
||||
return (
|
||||
<div style={{ display: "flex", flexDirection: "column" }}>
|
||||
<ActivityView
|
||||
|
@ -371,8 +387,7 @@ export default definePlugin({
|
|||
user={user}
|
||||
guild={guild}
|
||||
channelId={channelId}
|
||||
onClose={onClose}
|
||||
/>
|
||||
onClose={onClose}/>
|
||||
<div
|
||||
className={cl("controls")}
|
||||
style={{
|
||||
|
@ -381,7 +396,10 @@ export default definePlugin({
|
|||
justifyContent: "space-between",
|
||||
}}
|
||||
>
|
||||
<Tooltip text="Left" tooltipClassName={cl("controls-tooltip")}>{({ onMouseEnter, onMouseLeave }) => {
|
||||
<Tooltip text="Left" tooltipClassName={cl("controls-tooltip")}>{({
|
||||
onMouseEnter,
|
||||
onMouseLeave
|
||||
}) => {
|
||||
return <span
|
||||
onMouseEnter={onMouseEnter}
|
||||
onMouseLeave={onMouseLeave}
|
||||
|
@ -393,8 +411,7 @@ export default definePlugin({
|
|||
>
|
||||
<Caret
|
||||
disabled={activities.indexOf(currentActivity!) < 1}
|
||||
direction="left"
|
||||
/>
|
||||
direction="left"/>
|
||||
</span>;
|
||||
}}</Tooltip>
|
||||
|
||||
|
@ -403,12 +420,14 @@ export default definePlugin({
|
|||
<div
|
||||
key={"dot--" + index}
|
||||
onClick={() => setCurrentActivity(activity)}
|
||||
className={`dot ${currentActivity === activity ? "selected" : ""}`}
|
||||
/>
|
||||
className={`dot ${currentActivity === activity ? "selected" : ""}`}/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<Tooltip text="Right" tooltipClassName={cl("controls-tooltip")}>{({ onMouseEnter, onMouseLeave }) => {
|
||||
<Tooltip text="Right" tooltipClassName={cl("controls-tooltip")}>{({
|
||||
onMouseEnter,
|
||||
onMouseLeave
|
||||
}) => {
|
||||
return <span
|
||||
onMouseEnter={onMouseEnter}
|
||||
onMouseLeave={onMouseLeave}
|
||||
|
@ -420,13 +439,34 @@ export default definePlugin({
|
|||
>
|
||||
<Caret
|
||||
disabled={activities.indexOf(currentActivity!) >= activities.length - 1}
|
||||
direction="right"
|
||||
/>
|
||||
direction="right"/>
|
||||
</span>;
|
||||
}}</Tooltip>
|
||||
</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: [
|
||||
|
|
Loading…
Reference in a new issue