Skip to content

Commit

Permalink
fix(build): build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
imbhargav5 committed Jul 31, 2023
1 parent 2f2eaa4 commit 7bdeaeb
Show file tree
Hide file tree
Showing 16 changed files with 39 additions and 142 deletions.
1 change: 1 addition & 0 deletions src/app/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@ export async function updateItemAction(payload: {
export const deleteItemAction = async (id: string) => {
const supabaseClient = createSupabaseServerActionClient();
await deleteItem(supabaseClient, id);

revalidatePath('/');
};
7 changes: 4 additions & 3 deletions src/app/item/[itemId]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import Link from 'next/link';
import { notFound } from 'next/navigation';
import { getItem } from '@/utils/supabase-queries';
import { createSupabaseServerComponentClient } from '@/supabase-clients/createSupabaseServerComponentClient';
import { ConfirmDeleteItemDialog } from './ConfirmDeleteItemDialog';
import { deleteItemAction } from '@/app/actions';
import { T } from '@/components/ui/Typography';
import ArrowLeft from 'lucide-react/dist/esm/icons/arrow-left';
import { createSupabaseServerComponentClient } from '@/supabase-clients/createSupabaseServerComponentClient';

export default async function Item({
params,
Expand All @@ -14,10 +14,11 @@ export default async function Item({
itemId: string;
};
}) {
const supabase = createSupabaseServerComponentClient();
const supabaseClient = createSupabaseServerComponentClient();

const { itemId } = params;
try {
const item = await getItem(supabase, itemId);
const item = await getItem(supabaseClient, itemId);
return (
<div className="space-y-2">
<div className="space-y-4">
Expand Down
3 changes: 3 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { ClientLayout } from './ClientLayout';
import { Inter, Roboto_Mono } from 'next/font/google';
import './globals.css';

export const revalidate = 0;
export const dynamic = 'force-dynamic';

const inter = Inter({
subsets: ['latin'],
display: 'swap',
Expand Down
2 changes: 2 additions & 0 deletions src/app/new/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { ClientPage } from './ClientPage';
import { insertItemAction } from '../actions';

export const dynamic = 'force-dynamic';

export default function NewItem() {
return <ClientPage insertItemAction={insertItemAction} />;
}
26 changes: 0 additions & 26 deletions src/components/ui/ChangeLog/ChangeLogListCard.tsx

This file was deleted.

1 change: 0 additions & 1 deletion src/components/ui/ChangeLog/index.ts

This file was deleted.

31 changes: 0 additions & 31 deletions src/components/ui/FeedbackComponent/FeedbackComponent.tsx

This file was deleted.

1 change: 0 additions & 1 deletion src/components/ui/FeedbackComponent/index.ts

This file was deleted.

18 changes: 0 additions & 18 deletions src/components/ui/Headings/BasicPageHeading.tsx

This file was deleted.

26 changes: 0 additions & 26 deletions src/components/ui/Headings/LargeSectionHeading.tsx

This file was deleted.

25 changes: 0 additions & 25 deletions src/components/ui/Headings/PageHeadingWithActions.tsx

This file was deleted.

1 change: 0 additions & 1 deletion src/components/ui/Headings/index.ts

This file was deleted.

9 changes: 0 additions & 9 deletions src/components/ui/Search/Search.tsx

This file was deleted.

1 change: 0 additions & 1 deletion src/components/ui/Search/index.ts

This file was deleted.

13 changes: 13 additions & 0 deletions src/environment.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
declare global {
namespace NodeJS {
interface ProcessEnv {
NEXT_PUBLIC_SUPABASE_URL: string;
NEXT_PUBLIC_SUPABASE_ANON_KEY: string;
NODE_ENV: 'development' | 'production';
SUPABASE_PROJECT_REF: string;
}
}
}

// eslint-disable-next-line prettier/prettier
export { };
16 changes: 16 additions & 0 deletions src/supabase-clients/createSupabaseStaticClient.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Database } from '@/lib/database.types';
import { createClient } from '@supabase/supabase-js';

export const createSupabaseStaticClient = () =>
createClient<Database>(
process.env.NEXT_PUBLIC_SUPABASE_URL,
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY,
{
global: {
fetch,
},
auth: {
persistSession: false,
},
}
);

0 comments on commit 7bdeaeb

Please sign in to comment.