Switching to tabs over spaces!
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
{
|
||||
"singleQuote": true,
|
||||
"jsxSingleQuote": true,
|
||||
"trailingComma": "all"
|
||||
"trailingComma": "all",
|
||||
"useTabs": true,
|
||||
"tabWidth": 2
|
||||
}
|
||||
|
@ -17,7 +17,9 @@ export const GET = async (request: NextRequest) => {
|
||||
const { error } = await supabase.auth.exchangeCodeForSession(code);
|
||||
if (error) {
|
||||
console.error('OAuth error:', error);
|
||||
return redirect(`/sign-in?error=${encodeURIComponent(error.message)}`);
|
||||
return redirect(
|
||||
`/sign-in?error=${encodeURIComponent(error.message)}`,
|
||||
);
|
||||
}
|
||||
return redirect(redirectTo);
|
||||
}
|
||||
|
@ -21,7 +21,9 @@ const AuthSuccessPage = () => {
|
||||
};
|
||||
|
||||
handleAuthSuccess().catch((error) => {
|
||||
console.error(`Error: ${error instanceof Error ? error.message : error}`);
|
||||
console.error(
|
||||
`Error: ${error instanceof Error ? error.message : error}`,
|
||||
);
|
||||
});
|
||||
}, [refreshUserData, router]);
|
||||
|
||||
|
@ -57,7 +57,8 @@ const ForgotPassword = () => {
|
||||
if (result?.success) {
|
||||
await refreshUserData();
|
||||
setStatusMessage(
|
||||
result?.data ?? 'Check your email for a link to reset your password.',
|
||||
result?.data ??
|
||||
'Check your email for a link to reset your password.',
|
||||
);
|
||||
form.reset();
|
||||
router.push('');
|
||||
@ -74,7 +75,9 @@ const ForgotPassword = () => {
|
||||
return (
|
||||
<Card className='min-w-xs md:min-w-sm'>
|
||||
<CardHeader>
|
||||
<CardTitle className='text-2xl font-medium'>Reset Password</CardTitle>
|
||||
<CardTitle className='text-2xl font-medium'>
|
||||
Reset Password
|
||||
</CardTitle>
|
||||
<CardDescription className='text-sm text-foreground'>
|
||||
Don't have an account?{' '}
|
||||
<Link className='font-medium underline' href='/sign-up'>
|
||||
@ -116,9 +119,13 @@ const ForgotPassword = () => {
|
||||
statusMessage.includes('error') ||
|
||||
statusMessage.includes('failed') ||
|
||||
statusMessage.includes('invalid') ? (
|
||||
<StatusMessage message={{ error: statusMessage }} />
|
||||
<StatusMessage
|
||||
message={{ error: statusMessage }}
|
||||
/>
|
||||
) : (
|
||||
<StatusMessage message={{ success: statusMessage }} />
|
||||
<StatusMessage
|
||||
message={{ success: statusMessage }}
|
||||
/>
|
||||
))}
|
||||
</form>
|
||||
</Form>
|
||||
|
@ -97,7 +97,8 @@ const ProfilePage = () => {
|
||||
<CardHeader className='pb-2'>
|
||||
<CardTitle className='text-2xl'>Your Profile</CardTitle>
|
||||
<CardDescription>
|
||||
Manage your personal information and how it appears to others
|
||||
Manage your personal information and how it appears to
|
||||
others
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
{isLoading && !profile ? (
|
||||
@ -110,7 +111,9 @@ const ProfilePage = () => {
|
||||
<Separator />
|
||||
<ProfileForm onSubmit={handleProfileSubmit} />
|
||||
<Separator />
|
||||
<ResetPasswordForm onSubmit={handleResetPasswordSubmit} />
|
||||
<ResetPasswordForm
|
||||
onSubmit={handleResetPasswordSubmit}
|
||||
/>
|
||||
<Separator />
|
||||
<SignOut />
|
||||
</div>
|
||||
|
@ -99,7 +99,9 @@ const Login = () => {
|
||||
name='email'
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel className='text-lg'>Email</FormLabel>
|
||||
<FormLabel className='text-lg'>
|
||||
Email
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
type='email'
|
||||
@ -118,7 +120,9 @@ const Login = () => {
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<div className='flex justify-between'>
|
||||
<FormLabel className='text-lg'>Password</FormLabel>
|
||||
<FormLabel className='text-lg'>
|
||||
Password
|
||||
</FormLabel>
|
||||
<Link
|
||||
className='text-xs text-foreground underline text-right'
|
||||
href='/forgot-password'
|
||||
@ -142,9 +146,13 @@ const Login = () => {
|
||||
statusMessage.includes('error') ||
|
||||
statusMessage.includes('failed') ||
|
||||
statusMessage.includes('invalid') ? (
|
||||
<StatusMessage message={{ error: statusMessage }} />
|
||||
<StatusMessage
|
||||
message={{ error: statusMessage }}
|
||||
/>
|
||||
) : (
|
||||
<StatusMessage message={{ message: statusMessage }} />
|
||||
<StatusMessage
|
||||
message={{ message: statusMessage }}
|
||||
/>
|
||||
))}
|
||||
<SubmitButton
|
||||
disabled={isLoading}
|
||||
|
@ -104,7 +104,10 @@ const SignUp = () => {
|
||||
<CardTitle className='text-3xl font-medium'>Sign Up</CardTitle>
|
||||
<CardDescription className='text-foreground'>
|
||||
Already have an account?{' '}
|
||||
<Link className='text-primary font-medium underline' href='/sign-in'>
|
||||
<Link
|
||||
className='text-primary font-medium underline'
|
||||
href='/sign-in'
|
||||
>
|
||||
Sign in
|
||||
</Link>
|
||||
</CardDescription>
|
||||
@ -120,9 +123,15 @@ const SignUp = () => {
|
||||
name='name'
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel className='text-lg'>Name</FormLabel>
|
||||
<FormLabel className='text-lg'>
|
||||
Name
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
<Input type='text' placeholder='Full Name' {...field} />
|
||||
<Input
|
||||
type='text'
|
||||
placeholder='Full Name'
|
||||
{...field}
|
||||
/>
|
||||
</FormControl>
|
||||
</FormItem>
|
||||
)}
|
||||
@ -132,7 +141,9 @@ const SignUp = () => {
|
||||
name='email'
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel className='text-lg'>Email</FormLabel>
|
||||
<FormLabel className='text-lg'>
|
||||
Email
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
type='email'
|
||||
@ -149,7 +160,9 @@ const SignUp = () => {
|
||||
name='password'
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel className='text-lg'>Password</FormLabel>
|
||||
<FormLabel className='text-lg'>
|
||||
Password
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
type='password'
|
||||
@ -166,7 +179,9 @@ const SignUp = () => {
|
||||
name='confirmPassword'
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel className='text-lg'>Confirm Password</FormLabel>
|
||||
<FormLabel className='text-lg'>
|
||||
Confirm Password
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
type='password'
|
||||
@ -183,9 +198,13 @@ const SignUp = () => {
|
||||
statusMessage.includes('error') ||
|
||||
statusMessage.includes('failed') ||
|
||||
statusMessage.includes('invalid') ? (
|
||||
<StatusMessage message={{ error: statusMessage }} />
|
||||
<StatusMessage
|
||||
message={{ error: statusMessage }}
|
||||
/>
|
||||
) : (
|
||||
<StatusMessage message={{ success: statusMessage }} />
|
||||
<StatusMessage
|
||||
message={{ success: statusMessage }}
|
||||
/>
|
||||
))}
|
||||
<SubmitButton
|
||||
className='text-[1.0rem] cursor-pointer'
|
||||
|
@ -27,9 +27,15 @@ const GlobalError = ({ error, reset = undefined }: GlobalErrorProps) => {
|
||||
}, [error]);
|
||||
|
||||
return (
|
||||
<html lang='en' className={`${geist.variable}`} suppressHydrationWarning>
|
||||
<html
|
||||
lang='en'
|
||||
className={`${geist.variable}`}
|
||||
suppressHydrationWarning
|
||||
>
|
||||
<body
|
||||
className={cn('bg-background text-foreground font-sans antialiased')}
|
||||
className={cn(
|
||||
'bg-background text-foreground font-sans antialiased',
|
||||
)}
|
||||
>
|
||||
<ThemeProvider
|
||||
attribute='class'
|
||||
@ -47,7 +53,9 @@ const GlobalError = ({ error, reset = undefined }: GlobalErrorProps) => {
|
||||
>
|
||||
<NextError statusCode={0} />
|
||||
{reset !== undefined && (
|
||||
<Button onClick={() => reset()}>Try again</Button>
|
||||
<Button onClick={() => reset()}>
|
||||
Try again
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -46,8 +46,16 @@ export const generateMetadata = (): Metadata => {
|
||||
icons: {
|
||||
icon: [
|
||||
{ url: '/favicon.ico', type: 'image/x-icon', sizes: 'any' },
|
||||
{ url: '/favicon-16x16.png', type: 'image/png', sizes: '16x16' },
|
||||
{ url: '/favicon-32x32.png', type: 'image/png', sizes: '32x32' },
|
||||
{
|
||||
url: '/favicon-16x16.png',
|
||||
type: 'image/png',
|
||||
sizes: '16x16',
|
||||
},
|
||||
{
|
||||
url: '/favicon-32x32.png',
|
||||
type: 'image/png',
|
||||
sizes: '32x32',
|
||||
},
|
||||
{ url: '/favicon.png', type: 'image/png', sizes: '96x96' },
|
||||
{
|
||||
url: '/favicon.ico',
|
||||
@ -74,16 +82,36 @@ export const generateMetadata = (): Metadata => {
|
||||
media: '(prefers-color-scheme: dark)',
|
||||
},
|
||||
|
||||
{ url: '/appicon/icon-36x36.png', type: 'image/png', sizes: '36x36' },
|
||||
{ url: '/appicon/icon-48x48.png', type: 'image/png', sizes: '48x48' },
|
||||
{ url: '/appicon/icon-72x72.png', type: 'image/png', sizes: '72x72' },
|
||||
{ url: '/appicon/icon-96x96.png', type: 'image/png', sizes: '96x96' },
|
||||
{
|
||||
url: '/appicon/icon-36x36.png',
|
||||
type: 'image/png',
|
||||
sizes: '36x36',
|
||||
},
|
||||
{
|
||||
url: '/appicon/icon-48x48.png',
|
||||
type: 'image/png',
|
||||
sizes: '48x48',
|
||||
},
|
||||
{
|
||||
url: '/appicon/icon-72x72.png',
|
||||
type: 'image/png',
|
||||
sizes: '72x72',
|
||||
},
|
||||
{
|
||||
url: '/appicon/icon-96x96.png',
|
||||
type: 'image/png',
|
||||
sizes: '96x96',
|
||||
},
|
||||
{
|
||||
url: '/appicon/icon-144x144.png',
|
||||
type: 'image/png',
|
||||
sizes: '144x144',
|
||||
},
|
||||
{ url: '/appicon/icon.png', type: 'image/png', sizes: '192x192' },
|
||||
{
|
||||
url: '/appicon/icon.png',
|
||||
type: 'image/png',
|
||||
sizes: '192x192',
|
||||
},
|
||||
{
|
||||
url: '/appicon/icon-36x36.png',
|
||||
type: 'image/png',
|
||||
@ -122,16 +150,36 @@ export const generateMetadata = (): Metadata => {
|
||||
},
|
||||
],
|
||||
shortcut: [
|
||||
{ url: '/appicon/icon-36x36.png', type: 'image/png', sizes: '36x36' },
|
||||
{ url: '/appicon/icon-48x48.png', type: 'image/png', sizes: '48x48' },
|
||||
{ url: '/appicon/icon-72x72.png', type: 'image/png', sizes: '72x72' },
|
||||
{ url: '/appicon/icon-96x96.png', type: 'image/png', sizes: '96x96' },
|
||||
{
|
||||
url: '/appicon/icon-36x36.png',
|
||||
type: 'image/png',
|
||||
sizes: '36x36',
|
||||
},
|
||||
{
|
||||
url: '/appicon/icon-48x48.png',
|
||||
type: 'image/png',
|
||||
sizes: '48x48',
|
||||
},
|
||||
{
|
||||
url: '/appicon/icon-72x72.png',
|
||||
type: 'image/png',
|
||||
sizes: '72x72',
|
||||
},
|
||||
{
|
||||
url: '/appicon/icon-96x96.png',
|
||||
type: 'image/png',
|
||||
sizes: '96x96',
|
||||
},
|
||||
{
|
||||
url: '/appicon/icon-144x144.png',
|
||||
type: 'image/png',
|
||||
sizes: '144x144',
|
||||
},
|
||||
{ url: '/appicon/icon.png', type: 'image/png', sizes: '192x192' },
|
||||
{
|
||||
url: '/appicon/icon.png',
|
||||
type: 'image/png',
|
||||
sizes: '192x192',
|
||||
},
|
||||
{
|
||||
url: '/appicon/icon-36x36.png',
|
||||
type: 'image/png',
|
||||
@ -170,10 +218,26 @@ export const generateMetadata = (): Metadata => {
|
||||
},
|
||||
],
|
||||
apple: [
|
||||
{ url: 'appicon/icon-57x57.png', type: 'image/png', sizes: '57x57' },
|
||||
{ url: 'appicon/icon-60x60.png', type: 'image/png', sizes: '60x60' },
|
||||
{ url: 'appicon/icon-72x72.png', type: 'image/png', sizes: '72x72' },
|
||||
{ url: 'appicon/icon-76x76.png', type: 'image/png', sizes: '76x76' },
|
||||
{
|
||||
url: 'appicon/icon-57x57.png',
|
||||
type: 'image/png',
|
||||
sizes: '57x57',
|
||||
},
|
||||
{
|
||||
url: 'appicon/icon-60x60.png',
|
||||
type: 'image/png',
|
||||
sizes: '60x60',
|
||||
},
|
||||
{
|
||||
url: 'appicon/icon-72x72.png',
|
||||
type: 'image/png',
|
||||
sizes: '72x72',
|
||||
},
|
||||
{
|
||||
url: 'appicon/icon-76x76.png',
|
||||
type: 'image/png',
|
||||
sizes: '76x76',
|
||||
},
|
||||
{
|
||||
url: 'appicon/icon-114x114.png',
|
||||
type: 'image/png',
|
||||
@ -199,7 +263,11 @@ export const generateMetadata = (): Metadata => {
|
||||
type: 'image/png',
|
||||
sizes: '180x180',
|
||||
},
|
||||
{ url: 'appicon/icon.png', type: 'image/png', sizes: '192x192' },
|
||||
{
|
||||
url: 'appicon/icon.png',
|
||||
type: 'image/png',
|
||||
sizes: '192x192',
|
||||
},
|
||||
{
|
||||
url: 'appicon/icon-57x57.png',
|
||||
type: 'image/png',
|
||||
@ -349,9 +417,15 @@ const geist = Geist({
|
||||
|
||||
const RootLayout = ({ children }: Readonly<{ children: React.ReactNode }>) => {
|
||||
return (
|
||||
<html lang='en' className={`${geist.variable}`} suppressHydrationWarning>
|
||||
<html
|
||||
lang='en'
|
||||
className={`${geist.variable}`}
|
||||
suppressHydrationWarning
|
||||
>
|
||||
<body
|
||||
className={cn('bg-background text-foreground font-sans antialiased')}
|
||||
className={cn(
|
||||
'bg-background text-foreground font-sans antialiased',
|
||||
)}
|
||||
>
|
||||
<ThemeProvider
|
||||
attribute='class'
|
||||
|
@ -31,9 +31,9 @@ const HomePage = async () => {
|
||||
Welcome to the T3 Supabase Template!
|
||||
</CardTitle>
|
||||
<CardDescription className='text-[1.0rem] mb-2'>
|
||||
A great place to start is by creating a new user account &
|
||||
ensuring you can sign up! If you already have an account, go
|
||||
ahead and sign in!
|
||||
A great place to start is by creating a new user
|
||||
account & ensuring you can sign up! If you
|
||||
already have an account, go ahead and sign in!
|
||||
</CardDescription>
|
||||
<SignInSignUp
|
||||
className='flex gap-4 w-full justify-center'
|
||||
@ -42,7 +42,9 @@ const HomePage = async () => {
|
||||
/>
|
||||
<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>
|
||||
<span className='text-sm text-muted-foreground'>
|
||||
or
|
||||
</span>
|
||||
<Separator className='flex-1 bg-accent py-0.5' />
|
||||
</div>
|
||||
<div className='flex gap-4'>
|
||||
@ -53,8 +55,8 @@ const HomePage = async () => {
|
||||
<Separator className='bg-accent' />
|
||||
<CardContent className='flex flex-col px-5 py-2 items-center justify-center'>
|
||||
<CardTitle className='text-lg mb-6 w-2/3 text-center'>
|
||||
You can also test out your connection to Sentry if you want to
|
||||
start there!
|
||||
You can also test out your connection to Sentry
|
||||
if you want to start there!
|
||||
</CardTitle>
|
||||
<TestSentryCard />
|
||||
</CardContent>
|
||||
|
@ -161,7 +161,9 @@ export const AuthProvider = ({ children }: { children: ReactNode }) => {
|
||||
} catch (error) {
|
||||
console.error('Error updating profile:', error);
|
||||
toast.error(
|
||||
error instanceof Error ? error.message : 'Failed to update profile',
|
||||
error instanceof Error
|
||||
? error.message
|
||||
: 'Failed to update profile',
|
||||
);
|
||||
return { success: false, error };
|
||||
}
|
||||
@ -183,7 +185,9 @@ export const AuthProvider = ({ children }: { children: ReactNode }) => {
|
||||
refreshUserData,
|
||||
};
|
||||
|
||||
return <AuthContext.Provider value={value}>{children}</AuthContext.Provider>;
|
||||
return (
|
||||
<AuthContext.Provider value={value}>{children}</AuthContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
export const useAuth = () => {
|
||||
|
@ -71,7 +71,9 @@ export const SignInWithApple = ({
|
||||
<p className='text-[1.0rem]'>Sign In with Apple</p>
|
||||
</div>
|
||||
</SubmitButton>
|
||||
{statusMessage && <StatusMessage message={{ error: statusMessage }} />}
|
||||
{statusMessage && (
|
||||
<StatusMessage message={{ error: statusMessage }} />
|
||||
)}
|
||||
</form>
|
||||
);
|
||||
};
|
||||
|
@ -64,7 +64,9 @@ export const SignInWithMicrosoft = ({
|
||||
<p className='text-[1.0rem]'>Sign In with Microsoft</p>
|
||||
</div>
|
||||
</SubmitButton>
|
||||
{statusMessage && <StatusMessage message={{ error: statusMessage }} />}
|
||||
{statusMessage && (
|
||||
<StatusMessage message={{ error: statusMessage }} />
|
||||
)}
|
||||
</form>
|
||||
);
|
||||
};
|
||||
|
@ -18,8 +18,15 @@ const Navigation = () => {
|
||||
>
|
||||
<div className='flex gap-5 items-center font-semibold'>
|
||||
<Link className='flex flex-row my-auto gap-2' href='/'>
|
||||
<Image src='/favicon.png' alt='T3 Logo' width={50} height={50} />
|
||||
<h1 className='my-auto text-2xl'>T3 Supabase Template</h1>
|
||||
<Image
|
||||
src='/favicon.png'
|
||||
alt='T3 Logo'
|
||||
width={50}
|
||||
height={50}
|
||||
/>
|
||||
<h1 className='my-auto text-2xl'>
|
||||
T3 Supabase Template
|
||||
</h1>
|
||||
</Link>
|
||||
<div className='flex items-center gap-2'>
|
||||
<Button asChild>
|
||||
|
@ -55,7 +55,10 @@ export const ProfileForm = ({ onSubmit }: ProfileFormProps) => {
|
||||
return (
|
||||
<CardContent>
|
||||
<Form {...form}>
|
||||
<form onSubmit={form.handleSubmit(handleSubmit)} className='space-y-6'>
|
||||
<form
|
||||
onSubmit={form.handleSubmit(handleSubmit)}
|
||||
className='space-y-6'
|
||||
>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name='full_name'
|
||||
@ -65,7 +68,9 @@ export const ProfileForm = ({ onSubmit }: ProfileFormProps) => {
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
<FormDescription>Your public display name.</FormDescription>
|
||||
<FormDescription>
|
||||
Your public display name.
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
@ -81,7 +86,8 @@ export const ProfileForm = ({ onSubmit }: ProfileFormProps) => {
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
Your email address associated with your account.
|
||||
Your email address associated with your
|
||||
account.
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@ -89,7 +95,10 @@ export const ProfileForm = ({ onSubmit }: ProfileFormProps) => {
|
||||
/>
|
||||
|
||||
<div className='flex justify-center'>
|
||||
<SubmitButton disabled={isLoading} pendingText='Saving...'>
|
||||
<SubmitButton
|
||||
disabled={isLoading}
|
||||
pendingText='Saving...'
|
||||
>
|
||||
Save Changes
|
||||
</SubmitButton>
|
||||
</div>
|
||||
|
@ -69,7 +69,9 @@ export const ResetPasswordForm = ({
|
||||
}
|
||||
} catch (error) {
|
||||
setStatusMessage(
|
||||
error instanceof Error ? error.message : 'Password was not updated!',
|
||||
error instanceof Error
|
||||
? error.message
|
||||
: 'Password was not updated!',
|
||||
);
|
||||
} finally {
|
||||
setIsLoading(false);
|
||||
@ -100,7 +102,8 @@ export const ResetPasswordForm = ({
|
||||
<Input type='password' {...field} />
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
Enter your new password. Must be at least 8 characters.
|
||||
Enter your new password. Must be at
|
||||
least 8 characters.
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@ -116,7 +119,8 @@ export const ResetPasswordForm = ({
|
||||
<Input type='password' {...field} />
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
Please re-enter your new password to confirm.
|
||||
Please re-enter your new password to
|
||||
confirm.
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@ -127,9 +131,13 @@ export const ResetPasswordForm = ({
|
||||
statusMessage.includes('error') ||
|
||||
statusMessage.includes('failed') ||
|
||||
statusMessage.includes('invalid') ? (
|
||||
<StatusMessage message={{ error: statusMessage }} />
|
||||
<StatusMessage
|
||||
message={{ error: statusMessage }}
|
||||
/>
|
||||
) : (
|
||||
<StatusMessage message={{ message: statusMessage }} />
|
||||
<StatusMessage
|
||||
message={{ message: statusMessage }}
|
||||
/>
|
||||
))}
|
||||
<div className='flex justify-center'>
|
||||
<SubmitButton
|
||||
|
@ -69,7 +69,9 @@ export const TestSentryCard = () => {
|
||||
fill='currentcolor'
|
||||
/>
|
||||
</svg>
|
||||
<CardTitle className='text-3xl my-auto'>Test Sentry</CardTitle>
|
||||
<CardTitle className='text-3xl my-auto'>
|
||||
Test Sentry
|
||||
</CardTitle>
|
||||
</div>
|
||||
<CardDescription className='text-[1.0rem]'>
|
||||
Click the button below & view the sample error on{' '}
|
||||
@ -79,8 +81,8 @@ export const TestSentryCard = () => {
|
||||
>
|
||||
the Sentry website
|
||||
</Link>
|
||||
. Navigate to the {"'"}Issues{"'"} page & you should see the sample
|
||||
error!
|
||||
. Navigate to the {"'"}Issues{"'"} page & you should see the
|
||||
sample error!
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
@ -95,14 +97,20 @@ export const TestSentryCard = () => {
|
||||
{hasSentError ? (
|
||||
<div className='rounded-md bg-green-500/80 dark:bg-green-500/50 py-2 px-4 flex flex-row gap-2 my-auto'>
|
||||
<CheckCircle size={30} className='my-auto' />
|
||||
<p className='text-lg'>Sample error was sent to Sentry!</p>
|
||||
<p className='text-lg'>
|
||||
Sample error was sent to Sentry!
|
||||
</p>
|
||||
</div>
|
||||
) : !isConnected ? (
|
||||
<div className='rounded-md bg-red-600/50 dark:bg-red-500/50 py-2 px-4 flex flex-row gap-2 my-auto'>
|
||||
<MessageCircleWarning size={40} className='my-auto' />
|
||||
<MessageCircleWarning
|
||||
size={40}
|
||||
className='my-auto'
|
||||
/>
|
||||
<p>
|
||||
Wait! The Sentry SDK is not able to reach Sentry right now -
|
||||
this may be due to an adblocker. For more information, see{' '}
|
||||
Wait! The Sentry SDK is not able to reach Sentry
|
||||
right now - this may be due to an adblocker. For
|
||||
more information, see{' '}
|
||||
<Link
|
||||
href='https://docs.sentry.io/platforms/javascript/guides/nextjs/troubleshooting/#the-sdk-is-not-sending-any-data'
|
||||
className='text-accent-foreground underline hover:text-primary'
|
||||
@ -117,8 +125,8 @@ export const TestSentryCard = () => {
|
||||
</div>
|
||||
<Separator className='my-4 bg-accent' />
|
||||
<p className='description'>
|
||||
Warning! Sometimes Adblockers will prevent errors from being sent to
|
||||
Sentry.
|
||||
Warning! Sometimes Adblockers will prevent errors from being
|
||||
sent to Sentry.
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
@ -57,9 +57,9 @@ export const FetchDataSteps = () => {
|
||||
>
|
||||
Table Editor
|
||||
</a>{' '}
|
||||
for your Supabase project to create a table and insert some example
|
||||
data. If you're stuck for creativity, you can copy and paste the
|
||||
following into the{' '}
|
||||
for your Supabase project to create a table and insert some
|
||||
example data. If you're stuck for creativity, you can
|
||||
copy and paste the following into the{' '}
|
||||
<a
|
||||
href='https://supabase.com/dashboard/project/_/sql/new'
|
||||
className='font-bold hover:underline text-foreground/80'
|
||||
@ -75,8 +75,8 @@ export const FetchDataSteps = () => {
|
||||
|
||||
<TutorialStep title='Query Supabase data from Next.js'>
|
||||
<p>
|
||||
To create a Supabase client and query data from an Async Server
|
||||
Component, create a new page.tsx file at{' '}
|
||||
To create a Supabase client and query data from an Async
|
||||
Server Component, create a new page.tsx file at{' '}
|
||||
<span className='relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-xs font-medium text-secondary-foreground border'>
|
||||
/app/notes/page.tsx
|
||||
</span>{' '}
|
||||
|
@ -17,8 +17,7 @@ const buttonVariants = cva(
|
||||
'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',
|
||||
secondary:
|
||||
'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80',
|
||||
ghost:
|
||||
'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
|
||||
ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
|
||||
link: 'text-primary underline-offset-4 hover:underline',
|
||||
},
|
||||
size: {
|
||||
|
@ -16,7 +16,10 @@ function DropdownMenuPortal({
|
||||
...props
|
||||
}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {
|
||||
return (
|
||||
<DropdownMenuPrimitive.Portal data-slot='dropdown-menu-portal' {...props} />
|
||||
<DropdownMenuPrimitive.Portal
|
||||
data-slot='dropdown-menu-portal'
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@ -55,7 +58,10 @@ function DropdownMenuGroup({
|
||||
...props
|
||||
}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
|
||||
return (
|
||||
<DropdownMenuPrimitive.Group data-slot='dropdown-menu-group' {...props} />
|
||||
<DropdownMenuPrimitive.Group
|
||||
data-slot='dropdown-menu-group'
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@ -195,7 +201,9 @@ function DropdownMenuShortcut({
|
||||
function DropdownMenuSub({
|
||||
...props
|
||||
}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
|
||||
return <DropdownMenuPrimitive.Sub data-slot='dropdown-menu-sub' {...props} />;
|
||||
return (
|
||||
<DropdownMenuPrimitive.Sub data-slot='dropdown-menu-sub' {...props} />
|
||||
);
|
||||
}
|
||||
|
||||
function DropdownMenuSubTrigger({
|
||||
|
@ -40,7 +40,8 @@ export const env = createEnv({
|
||||
CI: process.env.CI,
|
||||
|
||||
NEXT_PUBLIC_SUPABASE_URL: process.env.NEXT_PUBLIC_SUPABASE_URL,
|
||||
NEXT_PUBLIC_SUPABASE_ANON_KEY: process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY,
|
||||
NEXT_PUBLIC_SUPABASE_ANON_KEY:
|
||||
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY,
|
||||
NEXT_PUBLIC_SITE_URL: process.env.NEXT_PUBLIC_SITE_URL,
|
||||
NEXT_PUBLIC_SENTRY_DSN: process.env.NEXT_PUBLIC_SENTRY_DSN,
|
||||
NEXT_PUBLIC_SENTRY_URL: process.env.NEXT_PUBLIC_SENTRY_URL,
|
||||
|
@ -124,7 +124,9 @@ export const uploadFile = async ({
|
||||
return {
|
||||
success: false,
|
||||
error:
|
||||
error instanceof Error ? error.message : 'Unknown error uploading file',
|
||||
error instanceof Error
|
||||
? error.message
|
||||
: 'Unknown error uploading file',
|
||||
};
|
||||
}
|
||||
};
|
||||
@ -147,7 +149,9 @@ export const replaceFile = async ({
|
||||
return {
|
||||
success: false,
|
||||
error:
|
||||
error instanceof Error ? error.message : 'Unknown error replacing file',
|
||||
error instanceof Error
|
||||
? error.message
|
||||
: 'Unknown error replacing file',
|
||||
};
|
||||
}
|
||||
};
|
||||
@ -171,7 +175,9 @@ export const deleteFile = async ({
|
||||
return {
|
||||
success: false,
|
||||
error:
|
||||
error instanceof Error ? error.message : 'Unknown error deleting file',
|
||||
error instanceof Error
|
||||
? error.message
|
||||
: 'Unknown error deleting file',
|
||||
};
|
||||
}
|
||||
};
|
||||
@ -205,7 +211,9 @@ export const listFiles = async ({
|
||||
return {
|
||||
success: false,
|
||||
error:
|
||||
error instanceof Error ? error.message : 'Unknown error listing files',
|
||||
error instanceof Error
|
||||
? error.message
|
||||
: 'Unknown error listing files',
|
||||
};
|
||||
}
|
||||
};
|
||||
|
@ -124,7 +124,9 @@ export const uploadFile = async ({
|
||||
return {
|
||||
success: false,
|
||||
error:
|
||||
error instanceof Error ? error.message : 'Unknown error uploading file',
|
||||
error instanceof Error
|
||||
? error.message
|
||||
: 'Unknown error uploading file',
|
||||
};
|
||||
}
|
||||
};
|
||||
@ -150,7 +152,9 @@ export const replaceFile = async ({
|
||||
return {
|
||||
success: false,
|
||||
error:
|
||||
error instanceof Error ? error.message : 'Unknown error replacing file',
|
||||
error instanceof Error
|
||||
? error.message
|
||||
: 'Unknown error replacing file',
|
||||
};
|
||||
}
|
||||
};
|
||||
@ -174,7 +178,9 @@ export const deleteFile = async ({
|
||||
return {
|
||||
success: false,
|
||||
error:
|
||||
error instanceof Error ? error.message : 'Unknown error deleting file',
|
||||
error instanceof Error
|
||||
? error.message
|
||||
: 'Unknown error deleting file',
|
||||
};
|
||||
}
|
||||
};
|
||||
@ -208,7 +214,9 @@ export const listFiles = async ({
|
||||
return {
|
||||
success: false,
|
||||
error:
|
||||
error instanceof Error ? error.message : 'Unknown error listing files',
|
||||
error instanceof Error
|
||||
? error.message
|
||||
: 'Unknown error listing files',
|
||||
};
|
||||
}
|
||||
};
|
||||
|
@ -72,7 +72,9 @@ export const useFileUpload = () => {
|
||||
});
|
||||
|
||||
if (!uploadResult.success) {
|
||||
throw new Error(uploadResult.error || `Failed to upload to ${bucket}`);
|
||||
throw new Error(
|
||||
uploadResult.error || `Failed to upload to ${bucket}`,
|
||||
);
|
||||
}
|
||||
|
||||
return { success: true, data: uploadResult.data };
|
||||
|
@ -41,7 +41,10 @@ export const updateSession = async (
|
||||
const user = await supabase.auth.getUser();
|
||||
|
||||
// protected routes
|
||||
if (request.nextUrl.pathname.startsWith('/reset-password') && user.error) {
|
||||
if (
|
||||
request.nextUrl.pathname.startsWith('/reset-password') &&
|
||||
user.error
|
||||
) {
|
||||
return NextResponse.redirect(new URL('/sign-in', request.url));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user