Skip to content

Commit 272fa7b

Browse files
committed
feat: links
1 parent d098979 commit 272fa7b

File tree

7 files changed

+33
-17
lines changed

7 files changed

+33
-17
lines changed

app/(protected)/books/[id]/page.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,26 +55,25 @@ export default async function BookDetailsPage({
5555
</BreadcrumbItem>
5656
</BreadcrumbList>
5757
</Breadcrumb>
58-
<div className="place-self-center flex">
59-
<div className="bg-accent shadow-xl [transform:perspective(400px)_rotateY(314deg)] -mr-1 w-10">
60-
<h2 className="my-2 text-nowrap text-sm font-bold text-accent-foreground/50 [transform:rotate(90deg)_translateY(-30px)] origin-top-left">
58+
<div className="place-self-center flex my-12">
59+
<div className="bg-accent [transform:perspective(400px)_rotateY(314deg)] -mr-1 w-10">
60+
<span className="my-2 inline-block text-nowrap text-xs font-bold text-accent-foreground/50 [transform:rotate(90deg)_translateY(-30px)] origin-top-left">
6161
{bookRes.data.title}
62-
</h2>
62+
</span>
6363
</div>
6464
<Image
6565
src={bookRes.data?.cover ?? '/book-placeholder.svg'}
6666
alt={bookRes.data.title + "'s cover"}
6767
width={256}
6868
height={256}
6969
className={clsx(
70-
'shadow-xl rounded-r-lg w-56 h-auto',
70+
'shadow-xl rounded-r-md w-56 h-auto',
7171
'[transform:perspective(800px)_rotateY(14deg)]'
7272
)}
7373
priority
7474
/>
7575
</div>
76-
<div className="place-self-center text-center">
77-
{/* <h2 className="text-xl font-semibold">{bookRes.data.title}</h2> */}
76+
<div className="place-self-center text-center border-t">
7877
<p className="text-gray-600">{bookRes.data.author}</p>
7978
<p className="text-sm text-gray-500">{bookRes.data.code}</p>
8079
</div>

app/(protected)/borrows/[id]/page.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,15 @@ export default async function BorrowDetailsPage({
132132
alt={borrowRes.data.book.title + "'s cover"}
133133
width={256}
134134
height={256}
135-
className="shadow-md rounded-lg w-56 h-auto place-self-center row-span-2"
135+
className="shadow-md rounded-md w-56 h-auto hover:shadow-md hover:scale-105 transition-transform"
136136
/>
137137
</Link>
138138
<div>
139-
<h2 className="text-xl font-semibold">
140-
{borrowRes.data.book.title}
141-
</h2>
139+
<Link href={`/books/${borrowRes.data.book.id}`} className="link">
140+
<h2 className="text-xl font-semibold">
141+
{borrowRes.data.book.title}
142+
</h2>
143+
</Link>
142144
<p className="text-gray-600">{borrowRes.data.book.author}</p>
143145
<p className="text-sm text-gray-500">
144146
{borrowRes.data.book.code}

app/(protected)/libraries/[id]/page.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,11 @@ export default async function LibraryDetail({
118118
{bookRes.data.map((book) => (
119119
<TableRow key={book.id}>
120120
<TableCell className="font-medium">{book.code}</TableCell>
121-
<TableCell>{book.title}</TableCell>
121+
<TableCell>
122+
<Link href={`/books/${book.id}`} className="link">
123+
{book.title}
124+
</Link>
125+
</TableCell>
122126
<TableCell>{book.year}</TableCell>
123127
<TableCell className="text-right">{book.author}</TableCell>
124128
</TableRow>

app/(protected)/libraries/page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ export default async function Libraries({
112112
)}
113113
</TableCell>
114114
<TableCell>
115-
<Link href={`libraries/${lib.id}`}>{lib.name}</Link>
115+
<Link href={`libraries/${lib.id}`} className="link">
116+
{lib.name}
117+
</Link>
116118
</TableCell>
117119
<TableCell>{formatDate(lib.created_at)}</TableCell>
118120
<TableCell>{formatDate(lib.updated_at)}</TableCell>

app/(protected)/subscriptions/page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ export default async function Subscriptions({
119119
{res.data.map((s) => (
120120
<TableRow key={s.id}>
121121
<TableCell>
122-
<Link href={`subscriptions/${s.id}`}>{s.user?.name}</Link>
122+
<Link href={`subscriptions/${s.id}`} className="link">
123+
{s.user?.name}
124+
</Link>
123125
</TableCell>
124126
<TableCell>{s.membership?.name}</TableCell>
125127
<TableCell>{s.membership?.library?.name}</TableCell>

app/globals.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
color utility to any element that depends on these defaults.
5454
*/
5555
@layer base {
56-
5756
*,
5857
::after,
5958
::before,
@@ -147,4 +146,4 @@
147146
body {
148147
@apply bg-background text-foreground;
149148
}
150-
}
149+
}

components/memberships/CardMembership.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Membership } from '@/lib/types/membership'
22
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
3+
import Link from 'next/link'
34
import { formatDate } from '@/lib/utils'
45

56
export const CardMembership: React.FC<{ membership: Membership }> = ({
@@ -30,7 +31,14 @@ export const CardMembership: React.FC<{ membership: Membership }> = ({
3031
</div>
3132
<div className="grid grid-cols-3">
3233
<dt className="font-medium">Library:</dt>
33-
<dd className="col-span-2">{membership.library.name}</dd>
34+
<dd className="col-span-2">
35+
<Link
36+
href={`/libraries/${membership.library_id}`}
37+
className="link"
38+
>
39+
{membership.library.name}
40+
</Link>
41+
</dd>
3442
</div>
3543
</dl>
3644
</CardContent>

0 commit comments

Comments
 (0)