Skip to content

Commit

Permalink
All feed elements same width
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesNakayama committed Dec 3, 2023
1 parent 27c696c commit 007f473
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
18 changes: 11 additions & 7 deletions app/components/ui/feed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@ import { type Post } from '#app/db/types.ts'

export function Feed({ posts }: Post[]) {

Check failure on line 4 in app/components/ui/feed.tsx

View workflow job for this annotation

GitHub Actions / ʦ TypeScript

Property 'posts' does not exist on type '{ id: number; createdAt: string; parentId: number | null; content: string; authorId: string; }[]'.
return (
<ul>
{posts.map((post) => (
<li>
<PostTeaser post={ post as Post} />
</li>
))}
</ul>
<div className='flex w-10/12 max-w-3/5'>
<ul>
{posts.map((post) => (

Check failure on line 8 in app/components/ui/feed.tsx

View workflow job for this annotation

GitHub Actions / ʦ TypeScript

Parameter 'post' implicitly has an 'any' type.
<li>

Check warning on line 9 in app/components/ui/feed.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint

Missing "key" prop for element in iterator
<div className='flex-1'>
<PostTeaser post={ post as Post} />

Check failure on line 11 in app/components/ui/feed.tsx

View workflow job for this annotation

GitHub Actions / ʦ TypeScript

Type '{ post: { id: number; createdAt: string; parentId: number | null; content: string; authorId: string; }; }' is not assignable to type 'IntrinsicAttributes & { id: number; createdAt: string; parentId: number | null; content: string; authorId: string; }'.
</div>
</li>
))}
</ul>
</div>
);
}

Expand Down
10 changes: 5 additions & 5 deletions app/components/ui/post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export function PostDetails({ post, note }: PostProps) {

export function PostTeaser({ post }: Post) {

Check failure on line 26 in app/components/ui/post.tsx

View workflow job for this annotation

GitHub Actions / ʦ TypeScript

Property 'post' does not exist on type '{ id: number; createdAt: string; parentId: number | null; content: string; authorId: string; }'.
return (
<div className='flex justify-center'>
<div className='justify-center'>
<Link to={`/posts/${post.id}`}>
<div className="bg-primary-foreground rounded-lg p-5 m-5 w-full">
<div className="bg-primary-foreground rounded-lg p-5 m-5">
<p className="mb-5">{post.content}</p>
</div>
</Link>
Expand All @@ -47,9 +47,9 @@ export function NoteAttachment({ note }: { note: Post }) {

export function VoteButtons() {
return (
<div className='flex justify-stretch'>
<Button className='mr-5'>Upvote</Button>
<Button>Downvote</Button>
<div>
<Button variant='destructive' size='lg'>Upvote</Button>
<Button variant='destructive' size='lg'>Downvote</Button>
</div>
)
}

0 comments on commit 007f473

Please sign in to comment.