Refactor billing imports, reorganize package scripts and improve action structure
Deleted unnecessary schema files and reorganized their imports into more logical order. Modified the package script structure to align more accurately with standard conventions. Also refactored the team-billing.service file to improve action structure, making it easier to understand and edit. Furthermore, upgraded various dependencies, reflecting their new versions in the lockfile.
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
'use client';
|
||||
|
||||
import { createContext, useState } from 'react';
|
||||
|
||||
export const Captcha = createContext<{
|
||||
token: string;
|
||||
setToken: (token: string) => void;
|
||||
}>({
|
||||
token: '',
|
||||
setToken: (_: string) => {
|
||||
// do nothing
|
||||
return '';
|
||||
},
|
||||
});
|
||||
|
||||
export function CaptchaProvider(props: { children: React.ReactNode }) {
|
||||
const [token, setToken] = useState<string>('');
|
||||
|
||||
return (
|
||||
<Captcha.Provider value={{ token, setToken }}>
|
||||
{props.children}
|
||||
</Captcha.Provider>
|
||||
);
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
'use client';
|
||||
|
||||
import { useContext } from 'react';
|
||||
|
||||
import { Turnstile } from '@marsidev/react-turnstile';
|
||||
|
||||
import { Captcha } from './captcha-provider';
|
||||
|
||||
export function CaptchaTokenSetter(props: { siteKey: string | undefined }) {
|
||||
const { setToken } = useContext(Captcha);
|
||||
|
||||
if (!props.siteKey) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return <Turnstile siteKey={props.siteKey} onSuccess={setToken} />;
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
export * from './captchaTokenSetter';
|
||||
export * from './use-captcha-token';
|
||||
export * from './captcha-provider';
|
||||
@@ -1,13 +0,0 @@
|
||||
import { useContext } from 'react';
|
||||
|
||||
import { Captcha } from './captcha-provider';
|
||||
|
||||
export function useCaptchaToken() {
|
||||
const context = useContext(Captcha);
|
||||
|
||||
if (!context) {
|
||||
throw new Error(`useCaptchaToken must be used within a CaptchaProvider`);
|
||||
}
|
||||
|
||||
return context.token;
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import { If } from '@kit/ui/if';
|
||||
import { Separator } from '@kit/ui/separator';
|
||||
import { Trans } from '@kit/ui/trans';
|
||||
|
||||
import { useCaptchaToken } from './captcha';
|
||||
import { useCaptchaToken } from '../captcha/client';
|
||||
import { MagicLinkAuthContainer } from './magic-link-auth-container';
|
||||
import { OauthProviders } from './oauth-providers';
|
||||
import { EmailPasswordSignUpContainer } from './password-sign-up-container';
|
||||
|
||||
Reference in New Issue
Block a user