diff --git a/src/equicordplugins/githubRepos/components/ProfilePopoutComponent.tsx b/src/equicordplugins/githubRepos/components/ProfilePopoutComponent.tsx index c49535aab..1f7feec48 100644 --- a/src/equicordplugins/githubRepos/components/ProfilePopoutComponent.tsx +++ b/src/equicordplugins/githubRepos/components/ProfilePopoutComponent.tsx @@ -35,10 +35,10 @@ const LANGUAGE_MAP: Record = { }; function getLanguageIconUrl(language: string | null): string { - if (!language) return "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/github/github-original.svg"; + if (!language) return "https://cdn.jsdelivr.net/gh/devicons/devicon@develop/icons/github/github-original.svg"; const normalized = LANGUAGE_MAP[language.toLowerCase()] ?? language.toLowerCase().replace(/\s+/g, ""); - return `https://cdn.jsdelivr.net/gh/devicons/devicon/icons/${normalized}/${normalized}-original.svg`; + return `https://cdn.jsdelivr.net/gh/devicons/devicon@develop/icons/${normalized}/${normalized}-original.svg`; } export function ProfilePopoutComponent({ id, theme }: { id: string, theme: string; }) { @@ -112,10 +112,6 @@ export function ProfilePopoutComponent({ id, theme }: { id: string, theme: strin src={getLanguageIconUrl(repo.language)} alt={repo.language ?? "Unknown"} className={showCount ? ProfileCardContainerClasses.displayCount : undefined} - style={!repo.language && theme !== "light" ? { filter: "invert(1)" } : undefined} - onError={e => { - (e.target as HTMLImageElement).src = "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/github/github-original.svg"; - }} /> {showCount && (
diff --git a/src/plugins/reviewDB/index.tsx b/src/plugins/reviewDB/index.tsx index bcb62dda1..b06468e2a 100644 --- a/src/plugins/reviewDB/index.tsx +++ b/src/plugins/reviewDB/index.tsx @@ -36,7 +36,7 @@ import { openReviewsModal } from "./components/ReviewModal"; import { NotificationType, ReviewType } from "./entities"; import { getCurrentUserInfo, getReviews, readNotification } from "./reviewDbApi"; import { settings } from "./settings"; -import { showToast } from "./utils"; +import { cl, showToast } from "./utils"; const DMSideBarClasses = findCssClassesLazy("widgetPreviews"); const ProfileCardClasses = findCssClassesLazy("cardsList", "firstCardContainer", "card", "container"); @@ -165,10 +165,17 @@ export default definePlugin({
  • - openReviewsModal(user.id, user.username, ReviewType.User)}> + !reviewData?.hasOptedOut && openReviewsModal(user.id, user.username, ReviewType.User)} + >
    User Reviews - {!!reviewData?.reviewCount && ( + {reviewData?.hasOptedOut ? ( + User disabled reviews + ) : !reviewData?.reviewCount ? ( + No reviews yet + ) : !!reviewData?.reviewCount && (
    {reviewData.reviews .filter(review => review.id !== 0) diff --git a/src/plugins/reviewDB/reviewDbApi.ts b/src/plugins/reviewDB/reviewDbApi.ts index e724adac7..29c1918b4 100644 --- a/src/plugins/reviewDB/reviewDbApi.ts +++ b/src/plugins/reviewDB/reviewDbApi.ts @@ -29,10 +29,11 @@ export const REVIEWS_PER_PAGE = 50; export interface UserReviewsData { message: string; - reviews: Review[]; - updated: boolean; hasNextPage: boolean; reviewCount: number; + reviews: Review[]; + updated: boolean; + hasOptedOut: boolean; } const WarningFlag = 0b00000010; @@ -65,7 +66,8 @@ export async function getReviews(id: string, offset = 0, isProfileComponent = fa reviews: [], updated: false, hasNextPage: false, - reviewCount: 0 + reviewCount: 0, + hasOptedOut: false, }; if (!req.ok) { diff --git a/src/plugins/reviewDB/style.css b/src/plugins/reviewDB/style.css index 83fa6cf27..a15bb2320 100644 --- a/src/plugins/reviewDB/style.css +++ b/src/plugins/reviewDB/style.css @@ -131,3 +131,8 @@ .vc-rdb-block-modal-unblock { cursor: pointer; } + +.vc-rdb-profile-popout-disabled { + opacity: 0.4; + cursor: not-allowed; +} \ No newline at end of file