Skip to content

Commit

Permalink
一度は/users/meを送るように
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-20 committed Jan 21, 2024
1 parent 48af745 commit d14f52d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 117 deletions.
3 changes: 3 additions & 0 deletions apps/web/src/client/LandingPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Image from 'next/image';
import { BottomNavigation } from '@/client/LandingPage/_components/BottomNavigation';
import { Description } from '@/shared/components/Description';
import ogImage from '~/public/icon.svg';
import { useUser } from '@supabase/auth-helpers-react';

const font = fontRaleway({
weight: ['600'],
Expand All @@ -14,7 +15,9 @@ const font = fontRaleway({
});

export const LandingPage: NextPage = () => {
useUser();
const theme = useMantineTheme();

return (
<>
<Description
Expand Down
12 changes: 12 additions & 0 deletions apps/web/src/client/_components/hooks/useUser.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { fetcher } from '@/features/swr/fetcher';
import type { getUserResponseSchema } from '@read-stack/openapi';
import useSWR from 'swr';
import type { z } from 'zod';

type GetMeResponse = z.infer<typeof getUserResponseSchema>;

export const useUser = () => {
const { data, error } = useSWR<GetMeResponse>('/api/v1/users/me', fetcher);

return { user: data?.user, error };
};
117 changes: 0 additions & 117 deletions apps/web/src/client/_components/hooks/useUserClips.ts

This file was deleted.

0 comments on commit d14f52d

Please sign in to comment.