Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: removed developer pack form from user settings page #4173

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 0 additions & 67 deletions components/organisms/UserSettingsPage/developer-pack-form.tsx

This file was deleted.

82 changes: 30 additions & 52 deletions components/organisms/UserSettingsPage/user-settings-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { validateTwitterUsername } from "lib/utils/validate-twitter-username";
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "components/molecules/Dialog/dialog";
import { LanguageSwitch } from "components/shared/LanguageSwitch/language-switch";
import useSupabaseAuth from "lib/hooks/useSupabaseAuth";
import DeveloperPackForm from "./developer-pack-form";

interface UserSettingsPageProps {
user: User | null;
Expand Down Expand Up @@ -435,59 +434,38 @@ const UserSettingsPage = ({ user }: UserSettingsPageProps) => {
</Button>
</div>
{userInfo && (
<>
<div>
{!coupon ? (
<div className="flex flex-col order-first gap-6 md:order-last">
<div className="flex flex-col gap-3">
<label className="text-2xl font-normal">Developer Pack</label>
<div className="w-full sm:max-w-80">
<Text>Verify your developer pack eligibilty to get an upgrade!</Text>
</div>
</div>
<DeveloperPackForm
providerToken={providerToken}
refreshUser={() => {
mutate();
setCoupon("verified");
}}
/>
</div>
) : null}
<form
name="delete-account"
action="/api/delete-account"
method="POST"
className="flex flex-col order-first gap-6 md:order-last p-6 rounded-2xl bg-light-slate-4"
ref={deleteFormRef}
onSubmit={(e) => {
setIsModalOpen(true);
e.preventDefault();
}}
>
<div className="flex flex-col gap-3">
<label className="text-2xl font-normal">Delete Account</label>
<div className="w-full md:w-96">
<Text>
Please note that account deletion is irreversible. Proceed only if you are certain about this
action.
</Text>
</div>
</div>
<form
name="delete-account"
action="/api/delete-account"
method="POST"
className="flex flex-col order-first gap-6 md:order-last p-6 rounded-2xl bg-light-slate-4"
ref={deleteFormRef}
onSubmit={(e) => {
setIsModalOpen(true);
e.preventDefault();
<Button type="submit" rel="noopener noreferrer" target="_blank" variant="destructive" className="w-max">
Delete Account
</Button>
<DeleteAccountModal
open={isModalOpen}
setOpen={setIsModalOpen}
onDelete={() => {
setIsModalOpen(false);
deleteFormRef.current?.submit();
}}
>
<div className="flex flex-col gap-3">
<label className="text-2xl font-normal">Delete Account</label>
<div className="w-full md:w-96">
<Text>
Please note that account deletion is irreversible. Proceed only if you are certain about this
action.
</Text>
</div>
</div>
<Button type="submit" rel="noopener noreferrer" target="_blank" variant="destructive" className="w-max">
Delete Account
</Button>
<DeleteAccountModal
open={isModalOpen}
setOpen={setIsModalOpen}
onDelete={() => {
setIsModalOpen(false);
deleteFormRef.current?.submit();
}}
/>
</form>
</>
/>
</form>
)}
</div>
</div>
Expand Down
Loading