mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-12-22 00:09:47 +01:00
use reflow to migrate from flow to typescript
This commit is contained in:
36
scm-ui/ui-components/src/Loading.tsx
Normal file
36
scm-ui/ui-components/src/Loading.tsx
Normal file
@@ -0,0 +1,36 @@
|
||||
import React from 'react';
|
||||
import { translate } from 'react-i18next';
|
||||
import styled from 'styled-components';
|
||||
import Image from './Image';
|
||||
|
||||
type Props = {
|
||||
t: (p: string) => string;
|
||||
message?: string;
|
||||
};
|
||||
|
||||
const Wrapper = styled.div`
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 256px;
|
||||
`;
|
||||
|
||||
const FixedSizedImage = styled(Image)`
|
||||
margin-bottom: 0.75rem;
|
||||
width: 128px;
|
||||
height: 128px;
|
||||
`;
|
||||
|
||||
class Loading extends React.Component<Props> {
|
||||
render() {
|
||||
const { message, t } = this.props;
|
||||
return (
|
||||
<Wrapper className="is-flex">
|
||||
<FixedSizedImage src="/images/loading.svg" alt={t('loading.alt')} />
|
||||
<p className="has-text-centered">{message}</p>
|
||||
</Wrapper>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default translate('commons')(Loading);
|
||||
Reference in New Issue
Block a user