added CrashWrapper

This commit is contained in:
srgooglo 2022-05-30 16:48:31 +02:00
parent 26d7e1bc03
commit dfcd9829e8
3 changed files with 40 additions and 18 deletions

View File

@ -1,23 +1,34 @@
import React from "react" import React from "react"
import { Result, Button } from "antd" import { Result, Button } from "antd"
export default (props) => { import "./index.less"
export const CrashComponent = (props) => {
const { crash } = props const { crash } = props
return <div className="app_crash_wrapper"> return <Result
<Result status="error"
status="error" title="Crash"
title="Crash" subTitle={crash.message}
subTitle={crash.message} extra={[
extra={[ <Button type="primary" key="reload" onClick={() => window.location.reload()}>
<Button type="primary" key="reload" onClick={() => window.location.reload()}> Reload app
Reload app </Button>
</Button> ]}
]} >
> <div>
<div> <code>{crash.error}</code>
<code>{crash.error}</code> </div>
</div> </Result>
</Result> }
export const CrashWrapper = (props) => {
const { crash } = props
return <div className="crashWrapper">
<CrashComponent crash={crash} />
</div> </div>
} }
export default CrashComponent

View File

@ -0,0 +1,11 @@
.crashWrapper {
position: absolute;
width: 100vw;
height: 100vh;
z-index: 10000;
background: rgba(0, 0, 0, 0.5);
backdrop-filter: blur(10px);
}

View File

@ -15,7 +15,7 @@ export { default as StepsForm } from "./StepsForm"
export { default as DraggableDrawer } from "./DraggableDrawer" export { default as DraggableDrawer } from "./DraggableDrawer"
export { default as AddableSelectList } from "./AddableSelectList" export { default as AddableSelectList } from "./AddableSelectList"
export { default as SwipeItem } from "./SwipeItem" export { default as SwipeItem } from "./SwipeItem"
export { default as Crash } from "./Crash" export * as Crash from "./Crash"
export { default as SearchButton } from "./SearchButton" export { default as SearchButton } from "./SearchButton"
export { default as UserRegister } from "./UserRegister" export { default as UserRegister } from "./UserRegister"
export { default as Skeleton } from "./Skeleton" export { default as Skeleton } from "./Skeleton"