-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: bbehnke <bradleybehnke@yahoo.com>
- Loading branch information
Showing
74 changed files
with
3,930 additions
and
908 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import React from "react"; | ||
import Box from "@mui/material/Box"; | ||
import ErrorIcon from "../../../images/warning-triangle.png"; | ||
|
||
import "./style.css"; | ||
|
||
export interface ErrorDisplayProps { | ||
title: string; | ||
message: string; | ||
} | ||
|
||
export function ErrorDisplay({ title, message }: ErrorDisplayProps) { | ||
return ( | ||
<Box | ||
sx={{ | ||
display: "flex", | ||
flexDirection: "column", | ||
height: "100%", | ||
width: "100%", | ||
alignItems: "center", | ||
justifyContent: "center", | ||
maxWidth: "37.5rem", | ||
}} | ||
> | ||
<Box | ||
sx={{ | ||
display: "flex", | ||
flexDirection: "row", | ||
alignItems: "center", | ||
}} | ||
> | ||
<img src={ErrorIcon} alt="Error" className="error-display-icon" /> | ||
<Box | ||
sx={{ | ||
display: "flex", | ||
flexDirection: "column", | ||
marginLeft: "0.5rem", | ||
}} | ||
> | ||
<span className="error-display-title">{title}</span> | ||
<span className="error-display-message">{message}</span> | ||
</Box> | ||
</Box> | ||
</Box> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.error-display-title { | ||
font-size: 1.25rem; | ||
font-style: normal; | ||
font-weight: 400; | ||
} | ||
|
||
.error-display-icon { | ||
width: 5.625rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import React, { useContext, useCallback } from "react"; | ||
import Box from "@mui/material/Box"; | ||
import Paper from "@mui/material/Paper"; | ||
import { AppContextProps } from "../../../types/declarations/app"; | ||
import { AppContext } from "../../../App"; | ||
import { SidebarType } from "../SlidingSidebar"; | ||
import ErrorOutlineIcon from "@mui/icons-material/ErrorOutline"; | ||
import ErrorIcon from "@mui/icons-material/Error"; | ||
|
||
import "./style.css"; | ||
|
||
export function ErrorIndicator() { | ||
const { errors, setSidebarProps } = useContext<AppContextProps>(AppContext); | ||
|
||
const onErrorClick = useCallback(() => { | ||
setSidebarProps({ | ||
type: SidebarType.ERRORS, | ||
slide: false, | ||
}); | ||
}, []); | ||
|
||
return ( | ||
<Paper | ||
elevation={1} | ||
sx={{ | ||
cursor: "pointer", | ||
padding: "0.25rem 0.5rem", | ||
}} | ||
onClick={onErrorClick} | ||
> | ||
<Box sx={{ display: "flex", flexDirection: "row", alignItems: "center" }}> | ||
{errors && errors.length ? ( | ||
<ErrorIcon sx={{ color: "#D52B1E" }} /> | ||
) : ( | ||
<ErrorOutlineIcon sx={{ color: "#6B6C72" }} /> | ||
)} | ||
{errors.length ? ( | ||
<span className="error-indicator-text">Error occurred</span> | ||
) : undefined} | ||
</Box> | ||
</Paper> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.error-indicator-text { | ||
margin-left: 0.5rem; | ||
min-width: 6.5625rem; | ||
} |
Oops, something went wrong.