From 4f9299d6a047311ade09d85dc25b0723ad2c6821 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Thu, 13 Nov 2025 14:11:50 -0500 Subject: [PATCH] GithubRepos: Make UI Colors Match Theme --- .../components/GitHubReposComponent.tsx | 13 ++-- .../githubRepos/components/RepoCard.tsx | 19 +++--- .../githubRepos/components/ReposModal.tsx | 14 ++-- src/equicordplugins/githubRepos/index.tsx | 3 + src/equicordplugins/githubRepos/styles.css | 67 +++++++++++++++++-- 5 files changed, 85 insertions(+), 31 deletions(-) diff --git a/src/equicordplugins/githubRepos/components/GitHubReposComponent.tsx b/src/equicordplugins/githubRepos/components/GitHubReposComponent.tsx index 67aa4029e..f8076f9ce 100644 --- a/src/equicordplugins/githubRepos/components/GitHubReposComponent.tsx +++ b/src/equicordplugins/githubRepos/components/GitHubReposComponent.tsx @@ -4,20 +4,17 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { classNameFactory } from "@api/Styles"; import { BaseText } from "@components/BaseText"; import { Button, TextButton } from "@components/Button"; import { openModal } from "@utils/modal"; import { React, useEffect, UserProfileStore, useState } from "@webpack/common"; -import { settings } from ".."; +import { cl, settings } from ".."; import { fetchReposByUserId, fetchReposByUsername, fetchUserInfo, GitHubUserInfo } from "../githubApi"; import { GitHubRepo } from "../types"; import { RepoCard } from "./RepoCard"; import { ReposModal } from "./ReposModal"; -export const cl = classNameFactory("vc-github-repos-"); - export function GitHubReposComponent({ id, theme }: { id: string, theme: string; }) { const [repos, setRepos] = useState([]); const [loading, setLoading] = useState(true); @@ -90,10 +87,10 @@ export function GitHubReposComponent({ id, theme }: { id: string, theme: string; fetchData(); }, [id]); - if (loading) return + if (loading) return Loading repositories...; - if (error) return + if (error) return Error: {error}; if (!repos.length) return null; @@ -115,10 +112,10 @@ export function GitHubReposComponent({ id, theme }: { id: string, theme: string; return (
- + GitHub Repositories {userInfo && ( - + {` (Showing only top ${topRepos.length}/${userInfo.totalRepos})`} )} diff --git a/src/equicordplugins/githubRepos/components/RepoCard.tsx b/src/equicordplugins/githubRepos/components/RepoCard.tsx index 043bf65d9..8d6ea6a77 100644 --- a/src/equicordplugins/githubRepos/components/RepoCard.tsx +++ b/src/equicordplugins/githubRepos/components/RepoCard.tsx @@ -4,10 +4,10 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { classNameFactory } from "@api/Styles"; import { BaseText } from "@components/BaseText"; import { React, Tooltip } from "@webpack/common"; +import { cl } from ".."; import { getLanguageColor } from "../colors"; import { RepoCardProps } from "../types"; import { Star } from "./Star"; @@ -15,15 +15,13 @@ import { Star } from "./Star"; export function RepoCard({ repo, showStars, showLanguage }: RepoCardProps) { const handleClick = () => window.open(repo.html_url, "_blank"); - const cl = classNameFactory("vc-github-repo-"); - const renderStars = () => { if (!showStars) return null; return (
- {repo.stargazers_count.toLocaleString()} + {repo.stargazers_count.toLocaleString()}
); }; @@ -40,9 +38,10 @@ export function RepoCard({ repo, showStars, showLanguage }: RepoCardProps) { height="16" fill="none" viewBox="0 0 24 24" - style={{ cursor: "pointer" }}> - - + > +
); @@ -57,7 +56,7 @@ export function RepoCard({ repo, showStars, showLanguage }: RepoCardProps) { className={cl("language-color")} style={{ backgroundColor: getLanguageColor(repo.language) }} /> - {repo.language} + {repo.language} {renderStars()} ); @@ -73,7 +72,7 @@ export function RepoCard({ repo, showStars, showLanguage }: RepoCardProps) { onMouseEnter={onMouseEnter} >
- + {repo.name} {renderLink()} @@ -85,7 +84,7 @@ export function RepoCard({ repo, showStars, showLanguage }: RepoCardProps) { ) : (
- + {repo.name} {renderLink()} diff --git a/src/equicordplugins/githubRepos/components/ReposModal.tsx b/src/equicordplugins/githubRepos/components/ReposModal.tsx index 55ca21b74..bf41cc3da 100644 --- a/src/equicordplugins/githubRepos/components/ReposModal.tsx +++ b/src/equicordplugins/githubRepos/components/ReposModal.tsx @@ -9,9 +9,9 @@ import { HeadingPrimary } from "@components/Heading"; import { ModalContent, ModalFooter, ModalHeader, ModalRoot } from "@utils/modal"; import { React } from "@webpack/common"; +import { cl } from ".."; import { getLanguageColor } from "../colors"; import { GitHubRepo } from "../types"; -import { cl } from "./GitHubReposComponent"; import { Star } from "./Star"; interface ReposModalProps { @@ -73,10 +73,10 @@ export function ReposModal({ repos, username, rootProps }: ReposModalProps) {
- - - - + + + + {renderTableHeader()} @@ -85,10 +85,10 @@ export function ReposModal({ repos, username, rootProps }: ReposModalProps) {
- +