- Newest Additions
+ {searchValue.status === SearchStatus.LIKED ? "Most Liked" : "Newest Additions"}
{themes.slice(0, 2).map((theme: Theme) => (
@@ -305,7 +322,7 @@ function ThemeTab() {
}}>
Themes
-
+
setContent(v);
return (
-
+
(your theme will be reviewed and can take up to 24 hours to be approved)
-
+
diff --git a/src/equicordplugins/themeLibrary/components/styles.css b/src/equicordplugins/themeLibrary/components/styles.css
index e1d943c5..c72ab412 100644
--- a/src/equicordplugins/themeLibrary/components/styles.css
+++ b/src/equicordplugins/themeLibrary/components/styles.css
@@ -1,7 +1,3 @@
-@keyframes bounce {
- 0%, 100% { transform: scale(1); }
- 50% { transform: scale(1.2); }
-}
[data-tab-id="ThemeLibrary"]::before {
/* stylelint-disable-next-line property-no-vendor-prefix */
@@ -51,10 +47,10 @@
.vce-text-input {
display: inline-block !important;
color: var(--text-normal) !important;
- font-family: var(--font-code) !important;
font-size: 16px !important;
padding: 0.5em;
border: 2px solid var(--background-tertiary);
+ line-height: 1.2;
max-height: unset;
}
@@ -74,3 +70,23 @@
display: flex;
width: 100%;
}
+
+.vce-search-grid {
+ display: grid;
+ height: 40px;
+ gap: 10px;
+ grid-template-columns: 1fr 200px;
+}
+
+.vce-button {
+ white-space: normal;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.vce-overwrite-modal {
+ border: 1px solid var(--background-modifier-accent);
+ border-radius: 8px;
+ padding: 0.5em;
+}
diff --git a/src/equicordplugins/themeLibrary/index.tsx b/src/equicordplugins/themeLibrary/index.tsx
index 48e4c5fb..6378ec17 100644
--- a/src/equicordplugins/themeLibrary/index.tsx
+++ b/src/equicordplugins/themeLibrary/index.tsx
@@ -8,7 +8,7 @@ import { EquicordDevs } from "@utils/constants";
import definePlugin from "@utils/types";
import { SettingsRouter } from "@webpack/common";
-import { settings } from "./settings";
+import { settings } from "./utils/settings";
export default definePlugin({
name: "ThemeLibrary",
diff --git a/src/equicordplugins/themeLibrary/native.ts b/src/equicordplugins/themeLibrary/native.ts
new file mode 100644
index 00000000..e0399362
--- /dev/null
+++ b/src/equicordplugins/themeLibrary/native.ts
@@ -0,0 +1,25 @@
+/*
+ * Vencord, a Discord client mod
+ * Copyright (c) 2024 Vendicated and contributors
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+import { IpcMainInvokeEvent } from "electron";
+import { existsSync, type PathLike, writeFileSync } from "fs";
+import { join } from "path";
+
+import type { Theme } from "./types";
+
+export async function themeExists(_: IpcMainInvokeEvent, dir: PathLike, theme: Theme) {
+ return existsSync(join(dir.toString(), `${theme.name}.theme.css`));
+}
+
+export function getThemesDir(_: IpcMainInvokeEvent, dir: PathLike, theme: Theme) {
+ return join(dir.toString(), `${theme.name}.theme.css`);
+}
+
+export async function downloadTheme(_: IpcMainInvokeEvent, dir: PathLike, theme: Theme) {
+ if (!theme.content || !theme.name) return;
+ const path = join(dir.toString(), `${theme.name}.theme.css`);
+ writeFileSync(path, Buffer.from(theme.content, "base64"));
+}
diff --git a/src/equicordplugins/themeLibrary/types.ts b/src/equicordplugins/themeLibrary/types.ts
index c7a6f75e..70abbd70 100644
--- a/src/equicordplugins/themeLibrary/types.ts
+++ b/src/equicordplugins/themeLibrary/types.ts
@@ -10,20 +10,16 @@ import { User } from "discord-types/general";
export interface Theme {
id: string;
name: string;
- file_name: string;
content: string;
type: string | "theme" | "snippet";
description: string;
- external_url?: string;
- download_url: string;
- version?: string;
+ version: string;
author: {
github_name?: string;
discord_name: string;
discord_snowflake: string;
};
- likes?: number;
- downloads?: number;
+ likes: number;
tags: string[];
thumbnail_url: string;
release_date: string;
@@ -31,7 +27,6 @@ export interface Theme {
name: string;
snowflake: string;
invite_link: string;
- avatar_hash: string;
};
source?: string;
}
diff --git a/src/equicordplugins/themeLibrary/utils/Icons.tsx b/src/equicordplugins/themeLibrary/utils/Icons.tsx
new file mode 100644
index 00000000..791b92bb
--- /dev/null
+++ b/src/equicordplugins/themeLibrary/utils/Icons.tsx
@@ -0,0 +1,32 @@
+/*
+ * Vencord, a Discord client mod
+ * Copyright (c) 2024 Vendicated and contributors
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+export const LikeIcon = (isLiked: boolean) => (
+
+);
+
+export const DownloadIcon = (props: any) => (
+
+);
diff --git a/src/equicordplugins/themeLibrary/auth.tsx b/src/equicordplugins/themeLibrary/utils/auth.tsx
similarity index 98%
rename from src/equicordplugins/themeLibrary/auth.tsx
rename to src/equicordplugins/themeLibrary/utils/auth.tsx
index 6e214f6b..a38142cf 100644
--- a/src/equicordplugins/themeLibrary/auth.tsx
+++ b/src/equicordplugins/themeLibrary/utils/auth.tsx
@@ -9,7 +9,7 @@ import { showNotification } from "@api/Notifications";
import { openModal } from "@utils/modal";
import { OAuth2AuthorizeModal, Toasts, UserStore } from "@webpack/common";
-import { logger } from "./components/LikesComponent";
+import { logger } from "../components/LikesComponent";
export async function authorizeUser(triggerModal: boolean = true) {
const isAuthorized = await getAuthorization();
diff --git a/src/equicordplugins/themeLibrary/settings.tsx b/src/equicordplugins/themeLibrary/utils/settings.tsx
similarity index 100%
rename from src/equicordplugins/themeLibrary/settings.tsx
rename to src/equicordplugins/themeLibrary/utils/settings.tsx