Cleaned up some stuff. Messing with sign in button components.
This commit is contained in:
@@ -4,10 +4,8 @@ import { FetchDataSteps } from '@/components/default/tutorial';
|
||||
import { InfoIcon } from 'lucide-react';
|
||||
import { getUser } from '@/lib/actions';
|
||||
import type { User } from '@/utils/supabase';
|
||||
import Link from 'next/link';
|
||||
import { TestSentryCard } from '@/components/default/sentry';
|
||||
import {
|
||||
Button,
|
||||
Card,
|
||||
CardContent,
|
||||
CardDescription,
|
||||
@@ -15,6 +13,7 @@ import {
|
||||
CardTitle,
|
||||
Separator,
|
||||
} from '@/components/ui';
|
||||
import { SignInSignUp, SignInWithMicrosoft } from '@/components/default/auth';
|
||||
|
||||
const HomePage = async () => {
|
||||
const response = await getUser();
|
||||
@@ -29,16 +28,20 @@ const HomePage = async () => {
|
||||
</CardTitle>
|
||||
<CardDescription className='text-[1.0rem] mb-2'>
|
||||
A great place to start is by creating a new user account &
|
||||
ensuring you can sign in!
|
||||
ensuring you can sign up! If you already have an account, go
|
||||
ahead and sign in!
|
||||
</CardDescription>
|
||||
<Button
|
||||
asChild
|
||||
size='sm'
|
||||
variant={'default'}
|
||||
className='w-1/3 items-center'
|
||||
>
|
||||
<Link href='/sign-up'>Sign up</Link>
|
||||
</Button>
|
||||
<SignInSignUp
|
||||
className='flex gap-4 w-full justify-center'
|
||||
signInSize='xl'
|
||||
signUpSize='xl'
|
||||
/>
|
||||
<div className='flex items-center w-full gap-4'>
|
||||
<Separator className='flex-1 bg-accent py-0.5' />
|
||||
<span className='text-sm text-muted-foreground'>or</span>
|
||||
<Separator className='flex-1 bg-accent py-0.5' />
|
||||
</div>
|
||||
<SignInWithMicrosoft />
|
||||
</CardHeader>
|
||||
<Separator className='bg-accent' />
|
||||
<CardContent className='flex flex-col px-5 py-2 items-center justify-center'>
|
||||
|
33
src/components/default/auth/SignInSignUp.tsx
Normal file
33
src/components/default/auth/SignInSignUp.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
'use server';
|
||||
|
||||
import Link from 'next/link';
|
||||
import { Button, type buttonVariants } from '@/components/ui';
|
||||
import { type ComponentProps } from 'react';
|
||||
import { type VariantProps } from 'class-variance-authority';
|
||||
|
||||
type SignInSignUpProps = {
|
||||
className?: ComponentProps<'div'>['className'];
|
||||
signInSize?: VariantProps<typeof buttonVariants>['size'];
|
||||
signUpSize?: VariantProps<typeof buttonVariants>['size'];
|
||||
signInVariant?: VariantProps<typeof buttonVariants>['variant'];
|
||||
signUpVariant?: VariantProps<typeof buttonVariants>['variant'];
|
||||
};
|
||||
|
||||
export const SignInSignUp = async ({
|
||||
className = 'flex gap-2',
|
||||
signInSize = 'default',
|
||||
signUpSize = 'sm',
|
||||
signInVariant = 'outline',
|
||||
signUpVariant = 'default',
|
||||
}: SignInSignUpProps) => {
|
||||
return (
|
||||
<div className={className}>
|
||||
<Button asChild size={signInSize} variant={signInVariant}>
|
||||
<Link href='/sign-in'>Sign In</Link>
|
||||
</Button>
|
||||
<Button asChild size={signUpSize} variant={signUpVariant}>
|
||||
<Link href='/sign-up'>Sign Up</Link>
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
};
|
3
src/components/default/auth/index.ts
Normal file
3
src/components/default/auth/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from './SignInSignUp';
|
||||
export * from './SignInWithApple';
|
||||
export * from './SignInWithMicrosoft';
|
@@ -1,9 +1,8 @@
|
||||
'use server';
|
||||
|
||||
import Link from 'next/link';
|
||||
import { Button } from '@/components/ui';
|
||||
import { getProfile } from '@/lib/actions';
|
||||
import AvatarDropdown from './AvatarDropdown';
|
||||
import { SignInSignUp } from '@/components/default/auth';
|
||||
|
||||
const NavigationAuth = async () => {
|
||||
try {
|
||||
@@ -13,17 +12,11 @@ const NavigationAuth = async () => {
|
||||
<AvatarDropdown />
|
||||
</div>
|
||||
) : (
|
||||
<div className='flex gap-2'>
|
||||
<Button asChild size='default' variant={'outline'}>
|
||||
<Link href='/sign-in'>Sign in</Link>
|
||||
</Button>
|
||||
<Button asChild size='sm' variant={'default'}>
|
||||
<Link href='/sign-up'>Sign up</Link>
|
||||
</Button>
|
||||
</div>
|
||||
<SignInSignUp />
|
||||
);
|
||||
} catch (error) {
|
||||
console.error('Error getting profile:', error);
|
||||
console.error(`Error getting profile: ${error as string}`);
|
||||
return <SignInSignUp />;
|
||||
}
|
||||
};
|
||||
export default NavigationAuth;
|
||||
|
@@ -27,6 +27,7 @@ export const TestSentryCard = () => {
|
||||
|
||||
useEffect(() => {
|
||||
const checkConnectivity = async () => {
|
||||
console.log('Checking Sentry SDK connectivity...');
|
||||
const result = await Sentry.diagnoseSdkConnectivity();
|
||||
setIsConnected(result !== 'sentry-unreachable');
|
||||
};
|
||||
|
@@ -25,6 +25,8 @@ const buttonVariants = cva(
|
||||
default: 'h-9 px-4 py-2 has-[>svg]:px-3',
|
||||
sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',
|
||||
lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',
|
||||
xl: 'h-12 rounded-md px-8 has-[>svg]:px-6',
|
||||
xxl: 'h-14 rounded-md px-10 has-[>svg]:px-8',
|
||||
icon: 'size-9',
|
||||
smicon: 'size-6',
|
||||
},
|
||||
|
@@ -10,7 +10,6 @@ export const env = createEnv({
|
||||
NODE_ENV: z
|
||||
.enum(['development', 'test', 'production'])
|
||||
.default('development'),
|
||||
NEXT_RUNTIME: z.enum(['nodejs', 'edge']).default('nodejs'),
|
||||
SENTRY_AUTH_TOKEN: z.string().min(1),
|
||||
CI: z.enum(['true', 'false']).default('false'),
|
||||
},
|
||||
@@ -37,7 +36,6 @@ export const env = createEnv({
|
||||
*/
|
||||
runtimeEnv: {
|
||||
NODE_ENV: process.env.NODE_ENV,
|
||||
NEXT_RUNTIME: process.env.NEXT_RUNTIME,
|
||||
SENTRY_AUTH_TOKEN: process.env.SENTRY_AUTH_TOKEN,
|
||||
CI: process.env.CI,
|
||||
|
||||
|
@@ -2,9 +2,7 @@ import * as Sentry from '@sentry/nextjs';
|
||||
import type { Instrumentation } from 'next';
|
||||
|
||||
export const register = async () => {
|
||||
if (process.env.NEXT_RUNTIME === 'edge') {
|
||||
await import('../sentry.edge.config');
|
||||
} else await import('../sentry.server.config');
|
||||
await import('../sentry.server.config');
|
||||
};
|
||||
|
||||
export const onRequestError: Instrumentation.onRequestError = (...args) => {
|
||||
|
Reference in New Issue
Block a user