Updated Result component so that it has the text centered by default

This commit is contained in:
Alejandro Celaya
2020-12-21 17:58:46 +01:00
parent b211a29fc5
commit 344f5e9b0d
8 changed files with 10 additions and 12 deletions

View File

@@ -6,20 +6,18 @@ import { SimpleCard } from './SimpleCard';
interface ResultProps {
type: 'success' | 'error' | 'warning';
className?: string;
textCentered?: boolean;
small?: boolean;
}
export const Result: FC<ResultProps> = ({ children, type, className, textCentered = false, small = false }) => (
export const Result: FC<ResultProps> = ({ children, type, className, small = false }) => (
<Row className={className}>
<div className={classNames({ 'col-md-10 offset-md-1': !small, 'col-12': small })}>
<SimpleCard
className={classNames({
className={classNames('text-center', {
'bg-main': type === 'success',
'bg-danger': type === 'error',
'bg-warning': type === 'warning',
'text-white': type !== 'warning',
'text-center': textCentered,
})}
bodyClassName={classNames({ 'p-2': small })}
>