aboutsummaryrefslogtreecommitdiff
path: root/src/components/PluginSettings
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
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')
-rw-r--r--src/components/PluginSettings/index.tsx29
-rw-r--r--src/components/PluginSettings/styles.css53
2 files changed, 13 insertions, 69 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 >
+ }
+ />
);
}
diff --git a/src/components/PluginSettings/styles.css b/src/components/PluginSettings/styles.css
index a756fa9..66b2a21 100644
--- a/src/components/PluginSettings/styles.css
+++ b/src/components/PluginSettings/styles.css
@@ -23,38 +23,6 @@
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
-.vc-plugins-card {
- background-color: var(--background-secondary-alt);
- color: var(--interactive-active);
- border-radius: 8px;
- display: block;
- height: 100%;
- padding: 12px;
- width: 100%;
- transition: 0.1s ease-out;
- transition-property: box-shadow, transform, background, opacity;
-}
-
-.vc-plugins-card-disabled {
- opacity: 0.6;
-}
-
-.vc-plugins-card:hover {
- background-color: var(--background-tertiary);
- transform: translateY(-1px);
- box-shadow: var(--elevation-high);
-}
-
-.vc-plugins-card-header {
- margin-top: auto;
- display: flex;
- width: 100%;
- justify-content: flex-end;
- height: 1.5rem;
- align-items: center;
- gap: 8px;
-}
-
.vc-plugins-info-button {
height: 24px;
width: 24px;
@@ -86,27 +54,6 @@
text-align: center;
}
-.vc-plugins-note {
- height: 36px;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- line-clamp: 2;
- -webkit-box-orient: vertical;
- /* stylelint-disable-next-line property-no-unknown */
- box-orient: vertical;
-}
-
-.vc-plugins-name {
- display: flex;
- width: 100%;
- align-items: center;
- flex-grow: 1;
- gap: 8px;
- cursor: "default";
-}
-
.vc-plugins-dep-name {
margin: 0 auto;
}