chore: de-bdify

This commit is contained in:
Lewis Crichton 2023-09-15 19:42:01 +01:00
parent 06f2239b1a
commit a79fb2718b
No known key found for this signature in database
2 changed files with 6 additions and 6 deletions

View file

@ -106,7 +106,7 @@ function Validators({ themeLinks }: { themeLinks: string[]; }) {
); );
} }
interface BDThemeCardProps { interface OtherThemeCardProps {
theme: UserThemeHeader; theme: UserThemeHeader;
enabled: boolean; enabled: boolean;
onChange: (enabled: boolean) => void; onChange: (enabled: boolean) => void;
@ -156,7 +156,7 @@ function UserCSSThemeCard({ theme, enabled, onChange, onDelete }: UserCSSCardPro
); );
} }
function BDThemeCard({ theme, enabled, onChange, onDelete }: BDThemeCardProps) { function OtherThemeCard({ theme, enabled, onChange, onDelete }: OtherThemeCardProps) {
return ( return (
<AddonCard <AddonCard
name={theme.name} name={theme.name}
@ -264,7 +264,7 @@ function ThemesTab() {
} else { } else {
// presumably BD but could also be plain css // presumably BD but could also be plain css
themeInfo.push({ themeInfo.push({
type: "bd", type: "other",
header: getThemeInfo(stripBOM(content), fileName) header: getThemeInfo(stripBOM(content), fileName)
}); });
} }
@ -365,8 +365,8 @@ function ThemesTab() {
<div className={cl("grid")}> <div className={cl("grid")}>
{userThemes?.map(({ type, header: theme }: ThemeHeader) => ( {userThemes?.map(({ type, header: theme }: ThemeHeader) => (
type === "bd" ? ( type === "other" ? (
<BDThemeCard <OtherThemeCard
key={theme.fileName} key={theme.fileName}
enabled={settings.enabledThemes.includes(theme.fileName)} enabled={settings.enabledThemes.includes(theme.fileName)}
onChange={enabled => onLocalThemeChange(theme.fileName, enabled)} onChange={enabled => onLocalThemeChange(theme.fileName, enabled)}

View file

@ -9,7 +9,7 @@ import type { UserstyleHeader } from "usercss-meta";
import type { UserThemeHeader } from "./bd"; import type { UserThemeHeader } from "./bd";
export type ThemeHeader = { export type ThemeHeader = {
type: "bd"; type: "other";
header: UserThemeHeader; header: UserThemeHeader;
} | { } | {
type: "usercss"; type: "usercss";