Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui/error-pages: convert Error files to typescript #2367

Merged
merged 3 commits into from
May 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ import {
SentimentVeryDissatisfied,
} from '@mui/icons-material'
import { useTheme } from '@mui/material'
import p from 'prop-types'

export function PageNotFound() {
interface ErrorsProps {
error?: string
type?: string
}

export function PageNotFound(): JSX.Element {
const theme = useTheme()
return (
<div style={{ textAlign: 'center', color: theme.palette.text.primary }}>
Expand All @@ -19,7 +23,7 @@ export function PageNotFound() {
)
}

export function ObjectNotFound(props) {
export function ObjectNotFound(props: ErrorsProps): JSX.Element {
const theme = useTheme()
return (
<div style={{ textAlign: 'center', color: theme.palette.text.primary }}>
Expand All @@ -34,11 +38,8 @@ export function ObjectNotFound(props) {
</div>
)
}
ObjectNotFound.propTypes = {
type: p.string,
}

export function GenericError(props) {
export function GenericError(props: ErrorsProps): JSX.Element {
const theme = useTheme()
let errorText
if (props.error) {
Expand All @@ -52,7 +53,3 @@ export function GenericError(props) {
</div>
)
}

GenericError.propTypes = {
error: p.string,
}
File renamed without changes.