mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-26 17:26:22 +00:00
feat(memberListActivities): configurable icon size
This commit is contained in:
parent
d7404417be
commit
358fa1d1b4
1 changed files with 15 additions and 2 deletions
|
@ -18,15 +18,26 @@
|
||||||
|
|
||||||
import "./styles.css";
|
import "./styles.css";
|
||||||
|
|
||||||
|
import { definePluginSettings } from "@api/Settings";
|
||||||
import { classNameFactory } from "@api/Styles";
|
import { classNameFactory } from "@api/Styles";
|
||||||
import ErrorBoundary from "@components/ErrorBoundary";
|
import ErrorBoundary from "@components/ErrorBoundary";
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
import definePlugin from "@utils/types";
|
import definePlugin, { OptionType } from "@utils/types";
|
||||||
import { findByPropsLazy, findStoreLazy } from "@webpack";
|
import { findByPropsLazy, findStoreLazy } from "@webpack";
|
||||||
|
|
||||||
import { SpotifyIcon } from "./components/SpotifyIcon";
|
import { SpotifyIcon } from "./components/SpotifyIcon";
|
||||||
import { TwitchIcon } from "./components/TwitchIcon";
|
import { TwitchIcon } from "./components/TwitchIcon";
|
||||||
|
|
||||||
|
const settings = definePluginSettings({
|
||||||
|
iconSize: {
|
||||||
|
type: OptionType.SLIDER,
|
||||||
|
description: "Size of the activity icons",
|
||||||
|
markers: [10, 15, 20],
|
||||||
|
default: 20,
|
||||||
|
stickToMarkers: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
interface Activity {
|
interface Activity {
|
||||||
created_at: number;
|
created_at: number;
|
||||||
id: string;
|
id: string;
|
||||||
|
@ -90,6 +101,8 @@ export default definePlugin({
|
||||||
authors: [Devs.D3SOX],
|
authors: [Devs.D3SOX],
|
||||||
tags: ["activity"],
|
tags: ["activity"],
|
||||||
|
|
||||||
|
settings,
|
||||||
|
|
||||||
patchActivityList: (activities: Activity[]) => {
|
patchActivityList: (activities: Activity[]) => {
|
||||||
const icons: JSX.Element[] = [];
|
const icons: JSX.Element[] = [];
|
||||||
|
|
||||||
|
@ -154,7 +167,7 @@ export default definePlugin({
|
||||||
return <ErrorBoundary noop>
|
return <ErrorBoundary noop>
|
||||||
<div className={cl("row")}>
|
<div className={cl("row")}>
|
||||||
{icons.map((icon, i) => (
|
{icons.map((icon, i) => (
|
||||||
<div key={i} className={cl("icon")}>
|
<div key={i} className={cl("icon")} style={{ width: `${settings.store.iconSize}px`, height: `${settings.store.iconSize}px` }}>
|
||||||
{icon}
|
{icon}
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
|
|
Loading…
Reference in a new issue