Skip to content

Commit 8c9c124

Browse files
committed
Updated prod build to re-gen prisma client for correct architecture
1 parent db32bce commit 8c9c124

File tree

5 files changed

+20
-12
lines changed

5 files changed

+20
-12
lines changed

Dockerfile

+1-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ COPY . .
2727
# Uncomment the following line in case you want to disable telemetry during the build.
2828
# ENV NEXT_TELEMETRY_DISABLED 1
2929

30-
# RUN yarn build
31-
32-
# If using npm comment out above and use below instead
30+
RUN npx prisma generate
3331
RUN npm run build
3432

3533
# Production image, copy all the files and run next

Dockerfile.dev

+2
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@ COPY . .
2121
EXPOSE 3000
2222
ENV PORT 3000
2323

24+
RUN npx prisma generate
25+
2426
CMD ["npm", "run", "dev"]

app/(home)/home-yeet-form.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const HomeYeetForm = () => {
2727
};
2828

2929
return session ? (
30-
<div className="flex items-start space-x-4">
30+
<div className="flex items-start space-x-4 p-6">
3131
<div className="flex-shrink-0">
3232
<Avatar
3333
type="image"

app/(home)/page.tsx

+2-6
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,8 @@ const HomePage = () => {
1313
return (
1414
<>
1515
<PageHeader>Home</PageHeader>
16-
<div className="p-6 border-b border-gray-200">
17-
<HomeYeetForm />
18-
</div>
19-
<div>
20-
<YeetFeed />
21-
</div>
16+
<HomeYeetForm />
17+
<YeetFeed />
2218
</>
2319
);
2420
};

app/(home)/yeet-feed.tsx

+14-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
import React from 'react';
44
import { Button } from '../_components/button';
5-
import { getGravatarImageUrl } from '../_components/utils';
5+
import { classNames, getGravatarImageUrl } from '../_components/utils';
66
import { Identity } from '@ory/client';
77
import { Avatar } from '../_components/avatar';
88
import Link from 'next/link';
9+
import { TypedUseSelectorHook, useSelector } from 'react-redux';
10+
import { RootState } from '@/store';
911

1012
type Yeet = {
1113
id: string;
@@ -15,12 +17,16 @@ type Yeet = {
1517
user: Identity;
1618
};
1719

20+
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;
21+
1822
export const YeetFeed = () => {
1923
const [isLoading, setIsLoading] = React.useState(false);
2024
const [error, setError] = React.useState<Error | undefined>(undefined);
2125
const [rows, setRows] = React.useState<Yeet[]>([]);
2226
const [moreYeetsAvailable, setMoreYeetsAvailable] = React.useState(false);
2327

28+
const { session } = useAppSelector((state) => state.auth);
29+
2430
const loadMoreRows = async () => {
2531
setIsLoading(true);
2632

@@ -54,7 +60,13 @@ export const YeetFeed = () => {
5460

5561
return (
5662
<>
57-
<ul role="list" className="divide-y divide-gray-100">
63+
<ul
64+
role="list"
65+
className={classNames(
66+
'divide-y divide-gray-100',
67+
Boolean(session) ? 'border-t border-gray-200' : ''
68+
)}
69+
>
5870
{rows.map((yeet, yeetIndex) => (
5971
<li
6072
key={yeet.id}

0 commit comments

Comments
 (0)