diff --git a/src/plugins/betterActivities/index.tsx b/src/plugins/betterActivities/index.tsx index f6b35ebff..1c7699813 100644 --- a/src/plugins/betterActivities/index.tsx +++ b/src/plugins/betterActivities/index.tsx @@ -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,69 +379,94 @@ export default definePlugin({ if (!activities.length) return null; - return ( -
- + if (settings.store.allActivitiesStyle === "carousel") { + return ( +
+ +
+ {({ + onMouseEnter, + onMouseLeave + }) => { + return { + const index = activities.indexOf(currentActivity!); + if (index - 1 >= 0) + setCurrentActivity(activities[index - 1]); + }} + > + + ; + }} + +
+ {activities.map((activity, index) => ( +
setCurrentActivity(activity)} + className={`dot ${currentActivity === activity ? "selected" : ""}`}/> + ))} +
+ + {({ + onMouseEnter, + onMouseLeave + }) => { + return { + const index = activities.indexOf(currentActivity!); + if (index + 1 < activities.length) + setCurrentActivity(activities[index + 1]); + }} + > + = activities.length - 1} + direction="right"/> + ; + }} +
+
+ ); + } else { + return (
- {({ onMouseEnter, onMouseLeave }) => { - return { - const index = activities.indexOf(currentActivity!); - if (index - 1 >= 0) - setCurrentActivity(activities[index - 1]); - }} - > - - ; - }} - -
- {activities.map((activity, index) => ( -
setCurrentActivity(activity)} - className={`dot ${currentActivity === activity ? "selected" : ""}`} - /> - ))} -
- - {({ onMouseEnter, onMouseLeave }) => { - return { - const index = activities.indexOf(currentActivity!); - if (index + 1 < activities.length) - setCurrentActivity(activities[index + 1]); - }} - > - = activities.length - 1} - direction="right" - /> - ; - }} + {activities.map((activity, index) => ( + + ))}
-
- ); + ); + } }, patches: [