Refactor code and improve usage of package dependencies
This commit updates the naming convention of icons from Lucide-React, moving some package dependencies to "peerDependencies" in 'team-accounts', 'admin' and 'auth'. Additionally, it includes tweaks to the development server command in apps/web package.json and adds a logger reference to the shared package. Furthermore, cleanup work has been performed within the features and UI packages, and new scripts to interact with Stripe have been added to the root package.json.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,16 +1,20 @@
|
||||
import { useRouter } from 'next/navigation';
|
||||
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
|
||||
import { useSupabase } from './use-supabase';
|
||||
|
||||
export function useUser() {
|
||||
const client = useSupabase();
|
||||
const router = useRouter();
|
||||
const queryKey = ['user'];
|
||||
|
||||
const queryFn = async () => {
|
||||
const response = await client.auth.getUser();
|
||||
|
||||
// this is most likely a session error or the user is not logged in
|
||||
if (response.error) {
|
||||
return Promise.reject(response.error);
|
||||
throw router.replace('/');
|
||||
}
|
||||
|
||||
if (response.data?.user) {
|
||||
|
||||
Reference in New Issue
Block a user