Skip to content

Commit

Permalink
Change BackgroundCurved zIndex so migration link is clickable on dash…
Browse files Browse the repository at this point in the history
…board

Add migration data functionality
  • Loading branch information
mikozet committed Jul 3, 2024
1 parent b2a010c commit 740db18
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/store/app/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ export function initializeApp() {

dispatch(showSpinnerOverlay());

// Check for migration status
dispatch(initializeUser());

// Initialize and gather important app states (auth etc.)
try {
await dispatch(initializeTutorials());
Expand All @@ -53,9 +56,6 @@ export function initializeApp() {
// Check for additional states ...
await dispatch(checkAppState());

// Check for migration status
await dispatch(initializeUser());

dispatch({
type: ActionTypes.APP_INITIALIZE_SUCCESS,
});
Expand Down
2 changes: 1 addition & 1 deletion src/store/user/reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import update from 'immutability-helper';
import ActionTypes from '~/store/user/types';

const initialState = {
isMigrationAccepted: false,
isMigrationAccepted: null,
};

const userReducer = (state = initialState, action) => {
Expand Down
2 changes: 1 addition & 1 deletion src/styles/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ export default createTheme({
scrollShadow: 30,
layer2: 20,
layer1: 10,
backgroundCurvedWrapper: 0,
backgroundCurvedWrapper: -1, // previously 0, changing so migration link is clickable
},
custom: {
colors,
Expand Down
15 changes: 11 additions & 4 deletions src/views/MigrateYourProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import Footer from '~/components/Footer';
import Header from '~/components/Header';
import View from '~/components/View';
import translate from '~/services/locale';
import { updateUserMigration } from '~/store/user/actions';
import { initializeUser, updateUserMigration } from '~/store/user/actions';

const useStyles = makeStyles(() => ({
migrationContainer: {
Expand All @@ -36,6 +36,9 @@ const useStyles = makeStyles(() => ({
flexDirection: 'column',
alignItems: 'center',
},
loaderContainer: {
marginTop: '15px',
},
}));

const MigrateYourProfile = () => {
Expand All @@ -47,10 +50,12 @@ const MigrateYourProfile = () => {
const user = useSelector((state) => state.user);
const isMigrationAccepted = user?.isMigrationAccepted;

useEffect(() => {
if (isMigrationAccepted !== undefined) {
useEffect(async () => {
if (isMigrationAccepted !== undefined && isMigrationAccepted !== null) {
setIsMigrateData(isMigrationAccepted);
setIsLoading(false);
} else {
dispatch(initializeUser());
}
}, [isMigrationAccepted]);

Expand Down Expand Up @@ -93,7 +98,9 @@ const MigrateYourProfile = () => {
</FormLabel>
<Box>
{isLoading ? (
<CircularProgress />
<Box className={classes.loaderContainer}>
<CircularProgress />
</Box>
) : (
<RadioGroup
aria-labelledby="migration-radio-buttons-group"
Expand Down

0 comments on commit 740db18

Please sign in to comment.