|
@@ -20,13 +20,18 @@ export function Error ({ error }: ErrorProps) {
|
|
|
|
|
|
type LoadingProps = {
|
|
|
text: string;
|
|
|
+ inline?: boolean;
|
|
|
};
|
|
|
|
|
|
-export function Loading ({ text }: LoadingProps) {
|
|
|
+export function Loading ({ text, inline }: LoadingProps) {
|
|
|
return (
|
|
|
- <Container style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
- <Loader active inline>{text}</Loader>
|
|
|
- </Container>
|
|
|
+ inline
|
|
|
+ ? <Loader active inline size='small'>{text}</Loader>
|
|
|
+ : (
|
|
|
+ <Container style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
+ <Loader active inline>{text}</Loader>
|
|
|
+ </Container>
|
|
|
+ )
|
|
|
);
|
|
|
}
|
|
|
|
|
@@ -34,11 +39,12 @@ type PromiseComponentProps = {
|
|
|
loading: boolean;
|
|
|
error: string | null;
|
|
|
message: string;
|
|
|
+ inline?: boolean;
|
|
|
}
|
|
|
|
|
|
-const PromiseComponent: React.FunctionComponent<PromiseComponentProps> = ({ loading, error, message, children }) => {
|
|
|
+const PromiseComponent: React.FunctionComponent<PromiseComponentProps> = ({ loading, error, message, children, inline }) => {
|
|
|
if (loading && !error) {
|
|
|
- return <Loading text={ message }/>;
|
|
|
+ return <Loading text={ message } inline={inline}/>;
|
|
|
} else if (error) {
|
|
|
return <Error error={error} />;
|
|
|
}
|