Remove MockMode mocking apollo queries + Add profile picture image upload during onboarding (#539)
* Remove MockMode mocking apollo queries + Add profile picture image upload * lower line code coverage until we have tests on hotkyes
This commit is contained in:
@ -2,11 +2,14 @@ import { useCallback, useEffect, useState } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { getOperationName } from '@apollo/client/utilities';
|
||||
import styled from '@emotion/styled';
|
||||
import { useRecoilState } from 'recoil';
|
||||
|
||||
import { SubTitle } from '@/auth/components/ui/SubTitle';
|
||||
import { Title } from '@/auth/components/ui/Title';
|
||||
import { useOnboardingStatus } from '@/auth/hooks/useOnboardingStatus';
|
||||
import { isMockModeState } from '@/auth/states/isMockModeState';
|
||||
import { OnboardingStatus } from '@/auth/utils/getOnboardingStatus';
|
||||
import { useHotkeysScopeOnMountOnly } from '@/hotkeys/hooks/useHotkeysScopeOnMountOnly';
|
||||
import { useScopedHotkeys } from '@/hotkeys/hooks/useScopedHotkeys';
|
||||
import { InternalHotkeysScope } from '@/hotkeys/types/internal/InternalHotkeysScope';
|
||||
import { MainButton } from '@/ui/components/buttons/MainButton';
|
||||
@ -34,6 +37,11 @@ const StyledButtonContainer = styled.div`
|
||||
`;
|
||||
|
||||
export function CreateWorkspace() {
|
||||
useHotkeysScopeOnMountOnly({
|
||||
scope: InternalHotkeysScope.CreateWokspace,
|
||||
customScopes: { 'command-menu': false, goto: false },
|
||||
});
|
||||
const [, setMockMode] = useRecoilState(isMockModeState);
|
||||
const navigate = useNavigate();
|
||||
const onboardingStatus = useOnboardingStatus();
|
||||
|
||||
@ -74,15 +82,16 @@ export function CreateWorkspace() {
|
||||
() => {
|
||||
handleCreate();
|
||||
},
|
||||
InternalHotkeysScope.Modal,
|
||||
InternalHotkeysScope.CreateWokspace,
|
||||
[handleCreate],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
setMockMode(true);
|
||||
if (onboardingStatus !== OnboardingStatus.OngoingWorkspaceCreation) {
|
||||
navigate('/auth/create/profile');
|
||||
}
|
||||
}, [onboardingStatus, navigate]);
|
||||
}, [onboardingStatus, navigate, setMockMode]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user