aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/ErrorBoundary.tsx9
-rw-r--r--src/components/ErrorCard.css7
-rw-r--r--src/components/ErrorCard.tsx23
3 files changed, 18 insertions, 21 deletions
diff --git a/src/components/ErrorBoundary.tsx b/src/components/ErrorBoundary.tsx
index a13640e..1eb2eb8 100644
--- a/src/components/ErrorBoundary.tsx
+++ b/src/components/ErrorBoundary.tsx
@@ -17,8 +17,9 @@
*/
import Logger from "@utils/Logger";
+import { Margins } from "@utils/margins";
import { LazyComponent } from "@utils/misc";
-import { Margins, React } from "@webpack/common";
+import { React } from "@webpack/common";
import { ErrorCard } from "./ErrorCard";
@@ -84,15 +85,13 @@ const ErrorBoundary = LazyComponent(() => {
const msg = this.props.message || "An error occurred while rendering this Component. More info can be found below and in your console.";
return (
- <ErrorCard style={{
- overflow: "hidden",
- }}>
+ <ErrorCard style={{ overflow: "hidden" }}>
<h1>Oh no!</h1>
<p>{msg}</p>
<code>
{this.state.message}
{!!this.state.stack && (
- <pre className={Margins.marginTop8}>
+ <pre className={Margins.top8}>
{this.state.stack}
</pre>
)}
diff --git a/src/components/ErrorCard.css b/src/components/ErrorCard.css
new file mode 100644
index 0000000..5146aa0
--- /dev/null
+++ b/src/components/ErrorCard.css
@@ -0,0 +1,7 @@
+.vc-error-card {
+ padding: 2em;
+ background-color: #e7828430;
+ border: 1px solid #e78284;
+ border-radius: 5px;
+ color: var(--text-normal, white);
+}
diff --git a/src/components/ErrorCard.tsx b/src/components/ErrorCard.tsx
index e749ea4..7ce8cad 100644
--- a/src/components/ErrorCard.tsx
+++ b/src/components/ErrorCard.tsx
@@ -16,24 +16,15 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import { Card } from "@webpack/common";
+import "./ErrorCard.css";
-interface Props {
- style?: React.CSSProperties;
- className?: string;
-}
-export function ErrorCard(props: React.PropsWithChildren<Props>) {
+import { classes } from "@utils/misc";
+import type { HTMLProps } from "react";
+
+export function ErrorCard(props: React.PropsWithChildren<HTMLProps<HTMLDivElement>>) {
return (
- <Card className={props.className} style={
- {
- padding: "2em",
- backgroundColor: "#e7828430",
- borderColor: "#e78284",
- color: "var(--text-normal)",
- ...props.style
- }
- }>
+ <div {...props} className={classes(props.className, "vc-error-card")}>
{props.children}
- </Card>
+ </div>
);
}