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 { Result, Button } from "antd"
export default (props) => {
import "./index.less"
export const CrashComponent = (props) => {
const { crash } = props
return <div className="app_crash_wrapper">
<Result
status="error"
title="Crash"
subTitle={crash.message}
extra={[
<Button type="primary" key="reload" onClick={() => window.location.reload()}>
Reload app
</Button>
]}
>
<div>
<code>{crash.error}</code>
</div>
</Result>
return <Result
status="error"
title="Crash"
subTitle={crash.message}
extra={[
<Button type="primary" key="reload" onClick={() => window.location.reload()}>
Reload app
</Button>
]}
>
<div>
<code>{crash.error}</code>
</div>
</Result>
}
export const CrashWrapper = (props) => {
const { crash } = props
return <div className="crashWrapper">
<CrashComponent crash={crash} />
</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 AddableSelectList } from "./AddableSelectList"
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 UserRegister } from "./UserRegister"
export { default as Skeleton } from "./Skeleton"