mirror of
https://github.com/plankanban/planka.git
synced 2025-12-21 17:25:39 +03:00
Project managers, board members, auto-update after reconnection, refactoring
This commit is contained in:
37
client/src/components/CoreWrapper/CoreWrapper.jsx
Executable file
37
client/src/components/CoreWrapper/CoreWrapper.jsx
Executable file
@@ -0,0 +1,37 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useTranslation, Trans } from 'react-i18next';
|
||||
import { Loader } from 'semantic-ui-react';
|
||||
|
||||
import CoreContainer from '../../containers/CoreContainer';
|
||||
|
||||
import styles from './CoreWrapper.module.scss';
|
||||
|
||||
const CoreWrapper = React.memo(({ isInitializing, isSocketDisconnected }) => {
|
||||
const [t] = useTranslation();
|
||||
|
||||
return (
|
||||
<>
|
||||
{isInitializing ? <Loader active size="massive" /> : <CoreContainer />}
|
||||
{isSocketDisconnected && (
|
||||
<div className={styles.message}>
|
||||
<div className={styles.messageHeader}>{t('common.noConnectionToServer')}</div>
|
||||
<div className={styles.messageContent}>
|
||||
<Trans i18nKey="common.allChangesWillBeAutomaticallySavedAfterConnectionRestored">
|
||||
All changes will be automatically saved
|
||||
<br />
|
||||
after connection restored
|
||||
</Trans>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
});
|
||||
|
||||
CoreWrapper.propTypes = {
|
||||
isInitializing: PropTypes.bool.isRequired,
|
||||
isSocketDisconnected: PropTypes.bool.isRequired,
|
||||
};
|
||||
|
||||
export default CoreWrapper;
|
||||
27
client/src/components/CoreWrapper/CoreWrapper.module.scss
Normal file
27
client/src/components/CoreWrapper/CoreWrapper.module.scss
Normal file
@@ -0,0 +1,27 @@
|
||||
:global(#app) {
|
||||
.message {
|
||||
background: #eb5a46;
|
||||
border-radius: 4px;
|
||||
bottom: 20px;
|
||||
box-shadow: #b04632 0 1px 0;
|
||||
padding: 12px 18px;
|
||||
position: fixed;
|
||||
right: 20px;
|
||||
width: 390px;
|
||||
z-index: 10001;
|
||||
}
|
||||
|
||||
.messageContent {
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.messageHeader {
|
||||
color: #fff;
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
line-height: 1.2;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
}
|
||||
3
client/src/components/CoreWrapper/index.js
Normal file
3
client/src/components/CoreWrapper/index.js
Normal file
@@ -0,0 +1,3 @@
|
||||
import CoreWrapper from './CoreWrapper';
|
||||
|
||||
export default CoreWrapper;
|
||||
Reference in New Issue
Block a user