Skip to content

Commit

Permalink
Merge pull request #2367 from target/use-typescript-Errors
Browse files Browse the repository at this point in the history
ui/error-pages: convert Error files to typescript
  • Loading branch information
tony-tvu authored May 11, 2022
2 parents 55c8d91 + 958db3a commit dae55df
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
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.

0 comments on commit dae55df

Please sign in to comment.