chore(dashboard-v2): cleanup AvatarUploader (user avatars are not available yet)

This commit is contained in:
Michał Leszczyk 2022-03-24 10:46:02 +01:00
parent 93809d5428
commit 07112383d3
No known key found for this signature in database
GPG Key ID: FA123CA8BAA2FBF4
1 changed files with 0 additions and 12 deletions

View File

@ -1,11 +1,8 @@
import { useState } from "react"; import { useState } from "react";
import { useMedia } from "react-use";
import { navigate } from "gatsby"; import { navigate } from "gatsby";
import { useUser } from "../../contexts/user"; import { useUser } from "../../contexts/user";
import theme from "../../lib/theme";
import UserSettingsLayout from "../../layouts/UserSettingsLayout"; import UserSettingsLayout from "../../layouts/UserSettingsLayout";
import { AvatarUploader } from "../../components/AvatarUploader";
import { AccountSettingsForm } from "../../components/forms/AccountSettingsForm"; import { AccountSettingsForm } from "../../components/forms/AccountSettingsForm";
import { Modal } from "../../components/Modal/Modal"; import { Modal } from "../../components/Modal/Modal";
import { AccountRemovalForm } from "../../components/forms/AccountRemovalForm"; import { AccountRemovalForm } from "../../components/forms/AccountRemovalForm";
@ -18,7 +15,6 @@ const State = {
}; };
const AccountPage = () => { const AccountPage = () => {
const isLargeScreen = useMedia(`(min-width: ${theme.screens.xl})`);
const { user, mutate: reloadUser } = useUser(); const { user, mutate: reloadUser } = useUser();
const [state, setState] = useState(State.Pure); const [state, setState] = useState(State.Pure);
const [removalInitiated, setRemovalInitiated] = useState(false); const [removalInitiated, setRemovalInitiated] = useState(false);
@ -38,11 +34,6 @@ const AccountPage = () => {
</p> </p>
</section> </section>
<hr /> <hr />
{!isLargeScreen && (
<section>
<AvatarUploader className="flex flex-col sm:flex-row gap-8 items-center" />
</section>
)}
<section className="flex flex-col gap-8"> <section className="flex flex-col gap-8">
{state === State.Failure && ( {state === State.Failure && (
<Alert $variant="error">There was an error processing your request. Please try again later.</Alert> <Alert $variant="error">There was an error processing your request. Please try again later.</Alert>
@ -70,9 +61,6 @@ const AccountPage = () => {
</button> </button>
</section> </section>
</div> </div>
<div className="flex w-full justify-start xl:justify-end">
{isLargeScreen && <AvatarUploader className="flex flex-col gap-4" />}
</div>
{removalInitiated && ( {removalInitiated && (
<Modal onClose={abort} className="text-center"> <Modal onClose={abort} className="text-center">
<AccountRemovalForm abort={abort} onSuccess={() => navigate("/auth/login")} /> <AccountRemovalForm abort={abort} onSuccess={() => navigate("/auth/login")} />