diff --git a/webapp/components/Spinner.js b/webapp/components/Spinner.js new file mode 100644 index 0000000000..943a785786 --- /dev/null +++ b/webapp/components/Spinner.js @@ -0,0 +1,17 @@ +import React from 'react' +import PropTypes from 'prop-types' +import { CircularProgress } from '@mui/material' + +export const Spinner = (props) => { + const { size } = props + + return +} + +Spinner.propTypes = { + size: PropTypes.number, +} + +Spinner.defaultProps = { + size: 40, +} diff --git a/webapp/components/index.js b/webapp/components/index.js index 0e35837ea7..9ba86a2542 100644 --- a/webapp/components/index.js +++ b/webapp/components/index.js @@ -36,3 +36,4 @@ export { RadioButtonGroup } from './RadioButtonGroup' export { ResizableModal } from './ResizableModal' export { Slider } from './Slider' export { Split } from './Split' +export { Spinner } from './Spinner' diff --git a/webapp/views/App/Header/Header.js b/webapp/views/App/Header/Header.js index 104ad4d4d9..0f6506849a 100644 --- a/webapp/views/App/Header/Header.js +++ b/webapp/views/App/Header/Header.js @@ -16,9 +16,9 @@ import { TestId } from '@webapp/utils/testId' import { appModuleUri, homeModules } from '@webapp/app/appModules' +import { Spinner } from '@webapp/components' import { usePrevious } from '@webapp/components/hooks' import ProfilePicture from '@webapp/components/profilePicture' -import ProgressBar from '@webapp/components/progressBar' import ButtonPublishSurvey from '@webapp/components/buttonPublishSurvey' import { LabelWithTooltip } from '@webapp/components/form/LabelWithTooltip' import { SurveyPreferredLanguageSelector } from '@webapp/components/survey/SurveyPreferredLanguageSelector' @@ -61,30 +61,28 @@ const Header = () => {
- {Survey.isValid(surveyInfo) && - (appSaving ? ( - - ) : ( - <> - - - - { - const surveyId = Survey.getIdSurveyInfo(surveyInfo) - const userUpdated = User.assocPrefSurveyCycle(surveyId, cycle)(user) - dispatch(UserActions.updateUserPrefs({ user: userUpdated })) - }} - /> - - {canEditSurvey && Survey.isDraft(surveyInfo) && } - - ))} + {Survey.isValid(surveyInfo) && ( + <> + + + + { + const surveyId = Survey.getIdSurveyInfo(surveyInfo) + const userUpdated = User.assocPrefSurveyCycle(surveyId, cycle)(user) + dispatch(UserActions.updateUserPrefs({ user: userUpdated })) + }} + /> + + {canEditSurvey && Survey.isDraft(surveyInfo) && } +
{appSaving && }
+ + )}
{/* Placeholder to make the header symmetric */} diff --git a/webapp/views/App/Header/Header.scss b/webapp/views/App/Header/Header.scss index 6f3b9e3275..e2af336d73 100644 --- a/webapp/views/App/Header/Header.scss +++ b/webapp/views/App/Header/Header.scss @@ -56,6 +56,13 @@ line-height: normal; } +.header__loader-wrapper { + display: flex; + align-items: center; + width: 3rem; + margin-left: 10px; +} + .header__btn-user { max-height: $headerHeight - 1px; margin-right: 20px;