Updated InvalidComponents with Custom, InvalidIndex classes

This commit is contained in:
srgooglo 2020-10-08 15:14:58 +02:00
parent 2123ae6edd
commit c56cebb812
2 changed files with 31 additions and 5 deletions

View File

@ -19,15 +19,32 @@ const InvalidSkeleton = (props) => {
) )
} }
const InvalidIndex = (props) => {
export default class Invalid extends React.Component{ return(
constructor(props){ <div className={styles.floatCardWrapper} bordered="false">
super(props) <antd.Result>
Sorry but, We could not index this <antd.Tag style={{ marginLeft: "12px", lineHeight: "24px"}}>{props.messageProp1}</antd.Tag>
</antd.Result>
</div>
)
} }
const Custom = (props) => {
return(
<div className={styles.floatCardWrapper} style={props.style ?? null} >
<antd.Result status={props.status ?? "info"} title={props.title ?? ""}>
{props.message}
</antd.Result>
</div>
)
}
export default class Invalid extends React.Component{
render(){ render(){
const Components = { const Components = {
skeleton: <InvalidSkeleton /> skeleton: <InvalidSkeleton {...this.props} />,
index: <InvalidIndex {...this.props} />,
custom: <Custom {...this.props} />
} }
const type = this.props.type const type = this.props.type
if (!type) { if (!type) {

View File

@ -12,3 +12,12 @@
} }
} }
} }
.floatCardWrapper{
display: flex;
justify-content: center;
align-content: center;
align-items: center;
height: 100%;
}