Skip to content

Commit

Permalink
Revert "fix: Header buttons"
Browse files Browse the repository at this point in the history
  • Loading branch information
rayokamoto authored Feb 18, 2024
1 parent 0298480 commit cb1a517
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
4 changes: 0 additions & 4 deletions src/app/(account)/signin/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import FancyRectangle from '@/components/FancyRectangle';
import { useSignIn } from '@clerk/clerk-react';
import { zodResolver } from '@hookform/resolvers/zod';
import Link from 'next/link';
import { useRouter } from 'next/navigation';
import { useForm } from 'react-hook-form';
import { FcGoogle } from 'react-icons/fc';
import { z } from 'zod';
Expand All @@ -26,8 +25,6 @@ export default function SignInPage() {
resolver: zodResolver(signInSchema),
});

const router = useRouter();

const handleSignIn = form.handleSubmit(async ({ email, password }) => {
if (!isLoaded) return;
try {
Expand All @@ -38,7 +35,6 @@ export default function SignInPage() {

if (result.status === 'complete') {
await setActive({ session: result.createdSessionId });
router.push('/');
} else {
console.log(result);
}
Expand Down
26 changes: 10 additions & 16 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@ export default function Header() {
});

const checkUserPaid = useSWR<{ paid: boolean }>(['payment'], fetcher.get.query, {
isPaused: () => {
if (clerkUser.isLoaded && !clerkUser.isSignedIn) {
return true;
}
return !checkUserExists.data?.exists;
},
isPaused: () => clerkUser.isLoaded && !clerkUser.isSignedIn,
});

const [isScrolled, setIsScrolled] = useState(false);
Expand Down Expand Up @@ -161,16 +156,15 @@ export default function Header() {
Continue Signing Up
</Button>
)}
{checkUserExists.data?.exists &&
!checkUserPaid.data?.paid && (
<Button
colour="orange"
href="/settings"
onClick={closeMenu}
>
Continue to payment
</Button>
)}
{!checkUserPaid.data?.paid && (
<Button
colour="orange"
href="/settings"
onClick={closeMenu}
>
Continue to payment
</Button>
)}
<UserButton
userExists={Boolean(checkUserExists.data?.exists)}
userPaid={Boolean(checkUserPaid.data?.paid)}
Expand Down

0 comments on commit cb1a517

Please sign in to comment.