2019-10-20 16:59:02 +02:00
|
|
|
import React from "react";
|
|
|
|
|
import { translate } from "react-i18next";
|
|
|
|
|
import styled from "styled-components";
|
|
|
|
|
import Image from "./Image";
|
2018-09-03 16:17:36 +02:00
|
|
|
|
|
|
|
|
type Props = {
|
2019-10-19 16:38:07 +02:00
|
|
|
t: (p: string) => string;
|
|
|
|
|
message?: string;
|
2018-09-03 16:17:36 +02:00
|
|
|
};
|
|
|
|
|
|
2019-10-08 16:42:08 +02:00
|
|
|
const Wrapper = styled.div`
|
2019-10-10 14:31:55 +02:00
|
|
|
flex-direction: column;
|
2019-10-08 16:42:08 +02:00
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
min-height: 256px;
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
const FixedSizedImage = styled(Image)`
|
2019-10-10 14:31:55 +02:00
|
|
|
margin-bottom: 0.75rem;
|
2019-10-08 16:42:08 +02:00
|
|
|
width: 128px;
|
|
|
|
|
height: 128px;
|
|
|
|
|
`;
|
|
|
|
|
|
2018-09-03 16:17:36 +02:00
|
|
|
class Loading extends React.Component<Props> {
|
|
|
|
|
render() {
|
2019-10-08 16:42:08 +02:00
|
|
|
const { message, t } = this.props;
|
2018-09-03 16:17:36 +02:00
|
|
|
return (
|
2019-10-08 16:42:08 +02:00
|
|
|
<Wrapper className="is-flex">
|
2019-10-20 16:59:02 +02:00
|
|
|
<FixedSizedImage src="/images/loading.svg" alt={t("loading.alt")} />
|
2019-10-08 16:42:08 +02:00
|
|
|
<p className="has-text-centered">{message}</p>
|
|
|
|
|
</Wrapper>
|
2018-09-03 16:17:36 +02:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-20 16:59:02 +02:00
|
|
|
export default translate("commons")(Loading);
|