aboutsummaryrefslogtreecommitdiff
path: root/src/components/PluginSettings/index.tsx
diff options
context:
space:
mode:
authormegumin <megumin.bakaretsurie@gmail.com>2023-08-04 18:52:20 +0100
committerGitHub <noreply@github.com>2023-08-04 19:52:20 +0200
commitd6c43986fd665b60a8a83d41ef907dab22e990e7 (patch)
treeff9eda6794ef371568662b389a5e71e32bbbc16c /src/components/PluginSettings/index.tsx
parentbb7deeb09cb263d158de0d99e873c3d3f43a73bb (diff)
downloadVencord-d6c43986fd665b60a8a83d41ef907dab22e990e7.tar.gz
Vencord-d6c43986fd665b60a8a83d41ef907dab22e990e7.tar.bz2
Vencord-d6c43986fd665b60a8a83d41ef907dab22e990e7.zip
Add proper user-friendly theme manager (#635)
Co-authored-by: Justice Almanzar <superdash993@gmail.com> Co-authored-by: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Co-authored-by: V <vendicated@riseup.net>
Diffstat (limited to 'src/components/PluginSettings/index.tsx')
-rw-r--r--src/components/PluginSettings/index.tsx29
1 files changed, 13 insertions, 16 deletions
diff --git a/src/components/PluginSettings/index.tsx b/src/components/PluginSettings/index.tsx
index 7749abd..12487c6 100644
--- a/src/components/PluginSettings/index.tsx
+++ b/src/components/PluginSettings/index.tsx
@@ -22,10 +22,8 @@ import * as DataStore from "@api/DataStore";
import { showNotice } from "@api/Notices";
import { Settings, useSettings } from "@api/Settings";
import { classNameFactory } from "@api/Styles";
-import { Flex } from "@components/Flex";
-import { Badge } from "@components/PluginSettings/components";
import PluginModal from "@components/PluginSettings/PluginModal";
-import { Switch } from "@components/Switch";
+import { AddonCard } from "@components/VencordSettings/AddonCard";
import { SettingsTab } from "@components/VencordSettings/shared";
import { ChangeList } from "@utils/ChangeList";
import { Logger } from "@utils/Logger";
@@ -152,24 +150,23 @@ function PluginCard({ plugin, disabled, onRestartNeeded, onMouseEnter, onMouseLe
}
return (
- <Flex className={cl("card", { "card-disabled": disabled })} flexDirection="column" onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave}>
- <div className={cl("card-header")}>
- <Text variant="text-md/bold" className={cl("name")}>
- {plugin.name}{isNew && <Badge text="NEW" color="#ED4245" />}
- </Text>
+ <AddonCard
+ name={plugin.name}
+ description={plugin.description}
+ isNew={isNew}
+ enabled={isEnabled()}
+ setEnabled={toggleEnabled}
+ disabled={disabled}
+ onMouseEnter={onMouseEnter}
+ onMouseLeave={onMouseLeave}
+ infoButton={
<button role="switch" onClick={() => openModal()} className={classes(ButtonClasses.button, cl("info-button"))}>
{plugin.options
? <CogWheel />
: <InfoIcon width="24" height="24" />}
</button>
- <Switch
- checked={isEnabled()}
- onChange={toggleEnabled}
- disabled={disabled}
- />
- </div>
- <Text className={cl("note")} variant="text-sm/normal">{plugin.description}</Text>
- </Flex >
+ }
+ />
);
}