Update theme & stuff
This commit is contained in:
@@ -4,27 +4,17 @@ import { StatusMessage, SubmitButton } from '@/components/default/forms';
|
||||
import { useAuth } from '@/lib/hooks/context';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { useState } from 'react';
|
||||
import Image from 'next/image';
|
||||
import { useSupabaseClient } from '@/utils/supabase';
|
||||
import { FaApple } from 'react-icons/fa';
|
||||
import { type buttonVariants } from '@/components/ui';
|
||||
import { type ComponentProps } from 'react';
|
||||
import { type VariantProps } from 'class-variance-authority';
|
||||
import { useSupabaseClient } from '@/utils/supabase';
|
||||
|
||||
type ButtonProps = ComponentProps<'button'> & VariantProps<typeof buttonVariants>;
|
||||
type ImageProps = {
|
||||
src: string;
|
||||
alt: string;
|
||||
className?: string;
|
||||
width?: number;
|
||||
height?: number;
|
||||
}
|
||||
type FormProps = ComponentProps<'form'>;
|
||||
type TextProps = ComponentProps<'p'>;
|
||||
type SignInWithAppleProps = {
|
||||
buttonProps?: ButtonProps;
|
||||
imageProps?: ImageProps;
|
||||
formProps?: FormProps;
|
||||
textProps?: TextProps;
|
||||
buttonProps?: ComponentProps<'button'> & VariantProps<typeof buttonVariants>;
|
||||
formProps?: ComponentProps<'form'>;
|
||||
textProps?: ComponentProps<'p'>;
|
||||
iconProps?: ComponentProps<'svg'>;
|
||||
};
|
||||
|
||||
export const SignInWithApple = ({
|
||||
@@ -32,19 +22,15 @@ export const SignInWithApple = ({
|
||||
className: 'w-full cursor-pointer',
|
||||
type: 'submit',
|
||||
},
|
||||
imageProps = {
|
||||
src: '/icons/auth/apple.svg',
|
||||
alt: 'Apple',
|
||||
className: 'invert-75 dark:invert-25',
|
||||
width: 24,
|
||||
height: 24,
|
||||
},
|
||||
formProps = {
|
||||
className: 'my-4',
|
||||
},
|
||||
textProps = {
|
||||
className: 'text-[1.0rem]',
|
||||
},
|
||||
iconProps = {
|
||||
className: 'size-5',
|
||||
}
|
||||
} : SignInWithAppleProps) => {
|
||||
const router = useRouter();
|
||||
const { loading, refreshUser } = useAuth();
|
||||
@@ -78,13 +64,7 @@ export const SignInWithApple = ({
|
||||
{...buttonProps}
|
||||
>
|
||||
<div className='flex items-center gap-2'>
|
||||
<Image
|
||||
src={imageProps.src}
|
||||
alt={imageProps.alt}
|
||||
className={imageProps.className}
|
||||
width={imageProps.width}
|
||||
height={imageProps.height}
|
||||
/>
|
||||
<FaApple {...iconProps} />
|
||||
<p className={textProps.className} {...textProps}>Sign In with Apple</p>
|
||||
</div>
|
||||
</SubmitButton>
|
||||
|
Reference in New Issue
Block a user