feat: make missing plugins prevent enabling the theme

This commit is contained in:
Lewis Crichton 2023-12-28 13:59:36 +00:00
parent 9b89ef58be
commit 2cafedc7e7
No known key found for this signature in database

View file

@ -129,13 +129,14 @@ function UserCSSThemeCard({ theme, enabled, onChange, onDelete }: UserCSSCardPro
author={theme.author ?? "Unknown"} author={theme.author ?? "Unknown"}
enabled={enabled} enabled={enabled}
setEnabled={onChange} setEnabled={onChange}
disabled={missingPlugins && missingPlugins.length > 0}
infoButton={ infoButton={
<> <>
{missingPlugins && missingPlugins.length > 0 && ( {missingPlugins && missingPlugins.length > 0 && (
<Tooltip text={"The following plugins are required, but aren't enabled: " + missingPlugins.join(", ")}> <Tooltip text={"The following plugins are required, but aren't enabled: " + missingPlugins.join(", ")}>
{({ onMouseLeave, onMouseEnter }) => ( {({ onMouseLeave, onMouseEnter }) => (
<div <div
style={{ color: "var(--status-warning" }} style={{ color: "var(--status-danger" }}
onMouseEnter={onMouseEnter} onMouseEnter={onMouseEnter}
onMouseLeave={onMouseLeave} onMouseLeave={onMouseLeave}
> >