Refactor Views by cleaning the code, relying on apolloCache and improving performances (#4516)
* Wip refactoring view * Post merge conflicts * Fix review * Add create view capability * Fix create object missing view * Fix tests
This commit is contained in:
@ -9,7 +9,7 @@ import { useEmailPasswordResetLinkMutation } from '~/generated/graphql';
|
||||
export const ChangePassword = () => {
|
||||
const { enqueueSnackBar } = useSnackBar();
|
||||
|
||||
const currentUser = useRecoilValue(currentUserState());
|
||||
const currentUser = useRecoilValue(currentUserState);
|
||||
|
||||
const [emailPasswordResetLink] = useEmailPasswordResetLinkMutation();
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ export const DeleteAccount = () => {
|
||||
useState(false);
|
||||
|
||||
const [deleteUserAccount] = useDeleteUserAccountMutation();
|
||||
const currentUser = useRecoilValue(currentUserState());
|
||||
const currentUser = useRecoilValue(currentUserState);
|
||||
const userEmail = currentUser?.email;
|
||||
const { signOut } = useAuth();
|
||||
const navigate = useNavigate();
|
||||
|
||||
@ -17,7 +17,7 @@ export const DeleteWorkspace = () => {
|
||||
useState(false);
|
||||
|
||||
const [deleteCurrentWorkspace] = useDeleteCurrentWorkspaceMutation();
|
||||
const currentUser = useRecoilValue(currentUserState());
|
||||
const currentUser = useRecoilValue(currentUserState);
|
||||
const userEmail = currentUser?.email;
|
||||
const { signOut } = useAuth();
|
||||
const navigate = useNavigate();
|
||||
|
||||
@ -4,7 +4,7 @@ import { currentUserState } from '@/auth/states/currentUserState';
|
||||
import { TextInput } from '@/ui/input/components/TextInput';
|
||||
|
||||
export const EmailField = () => {
|
||||
const currentUser = useRecoilValue(currentUserState());
|
||||
const currentUser = useRecoilValue(currentUserState);
|
||||
|
||||
return (
|
||||
<TextInput
|
||||
|
||||
@ -29,9 +29,9 @@ export const NameFields = ({
|
||||
onFirstNameUpdate,
|
||||
onLastNameUpdate,
|
||||
}: NameFieldsProps) => {
|
||||
const currentUser = useRecoilValue(currentUserState());
|
||||
const currentUser = useRecoilValue(currentUserState);
|
||||
const [currentWorkspaceMember, setCurrentWorkspaceMember] = useRecoilState(
|
||||
currentWorkspaceMemberState(),
|
||||
currentWorkspaceMemberState,
|
||||
);
|
||||
|
||||
const [firstName, setFirstName] = useState(
|
||||
|
||||
@ -15,7 +15,7 @@ export const ProfilePictureUploader = () => {
|
||||
useUploadProfilePictureMutation();
|
||||
|
||||
const [currentWorkspaceMember, setCurrentWorkspaceMember] = useRecoilState(
|
||||
currentWorkspaceMemberState(),
|
||||
currentWorkspaceMemberState,
|
||||
);
|
||||
|
||||
const [uploadController, setUploadController] =
|
||||
|
||||
Reference in New Issue
Block a user