Skip to content

Commit a6156d6

Browse files
changes
1 parent d4ad8b1 commit a6156d6

File tree

3 files changed

+28
-27
lines changed

3 files changed

+28
-27
lines changed

src/app/papersadminlogin/page.tsx

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import {
99
import { handleAPIError } from "@/util/error";
1010
import toast from "react-hot-toast";
1111
import { ApiError } from "next/dist/server/api-utils";
12+
import { Input } from "@/components/ui/input";
13+
import { Button } from "@/components/ui/button";
1214

1315
const LoginPage = () => {
1416
const router = useRouter();
@@ -52,8 +54,8 @@ const LoginPage = () => {
5254
};
5355

5456
return (
55-
<div className="flex min-h-screen items-center justify-center bg-gray-50">
56-
<div className="w-full max-w-md rounded-md bg-white p-8 shadow-md">
57+
<div className="flex min-h-screen items-center justify-center ">
58+
<div className="w-full max-w-md rounded-md bg-blue-800 p-8 shadow-md">
5759
<h1 className="mb-4 text-2xl font-bold">Login</h1>
5860
{error && <p className="mb-4 text-red-500">{error}</p>}
5961
<form
@@ -65,41 +67,42 @@ const LoginPage = () => {
6567
<div className="mb-4">
6668
<label
6769
htmlFor="email"
68-
className="block text-sm font-medium text-gray-700"
70+
className="block text-sm font-medium"
6971
>
7072
Email:
7173
</label>
72-
<input
74+
<Input
7375
id="email"
7476
type="email"
7577
value={email}
7678
onChange={(e) => setEmail(e.target.value)}
7779
required
78-
className="mt-1 block w-full rounded-md border border-gray-300 px-3 py-2 shadow-sm focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm"
80+
className="mt-1 block w-full rounded-md border px-3 py-2 shadow-sm sm:text-sm"
7981
/>
8082
</div>
8183
<div className="mb-4">
8284
<label
8385
htmlFor="password"
84-
className="block text-sm font-medium text-gray-700"
86+
className="block text-sm font-medium"
8587
>
8688
Password:
8789
</label>
88-
<input
90+
<Input
8991
id="password"
9092
type="password"
9193
value={password}
9294
onChange={(e) => setPassword(e.target.value)}
9395
required
94-
className="mt-1 block w-full rounded-md border border-gray-300 px-3 py-2 shadow-sm focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm"
96+
className="mt-1 block w-full rounded-md border px-3 py-2 shadow-sm sm:text-sm"
9597
/>
9698
</div>
97-
<button
99+
<Button
98100
type="submit"
99-
className="w-full rounded-md bg-indigo-500 px-4 py-2 text-white hover:bg-indigo-600 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-opacity-50"
101+
variant="outline"
102+
className="w-full"
100103
>
101104
Login
102-
</button>
105+
</Button>
103106
</form>
104107
</div>
105108
</div>

src/components/Card.tsx

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
import { capsule } from "@/util/utils";
1010
import axios from "axios";
1111
import { useRouter } from "next/navigation";
12+
import Link from "next/link";
1213

1314
const Card = ({
1415
paper,
@@ -63,27 +64,24 @@ const Card = ({
6364
const lastThreePapers = updatedPapers.slice(0, 4);
6465
localStorage.setItem("clickedPapers", JSON.stringify(lastThreePapers));
6566
}
66-
const isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
67-
if (isMobile) {
68-
router.push(paper.finalUrl);
69-
} else {
70-
window.open(paper.finalUrl, "_blank");
71-
}
67+
window.open(paper.finalUrl, "_blank");
7268
}
7369

7470
return (
7571
<div
7672
key={paper._id}
7773
className={`w-56 space-y-1 rounded-xl border border-black dark:border-[#7480FF]/25 ${checked ? "bg-[#EEF2FF] dark:bg-[#050b1f]" : ""} p-4 `}
7874
>
79-
<Image
80-
src={paper.thumbnailUrl}
81-
alt={paper.subject}
82-
width={320}
83-
height={180}
84-
onClick={handleOpen}
85-
className="mb-2 h-[180px] w-full cursor-pointer object-cover"
86-
/>
75+
<Link href={paper.finalUrl}>
76+
<Image
77+
src={paper.thumbnailUrl}
78+
alt={paper.subject}
79+
width={320}
80+
height={180}
81+
onClick={handleOpen}
82+
className="mb-2 h-[180px] w-full cursor-pointer object-cover"
83+
/>
84+
</Link>
8785

8886
<div className="text-sm font-medium">
8987
{extractBracketContent(paper.subject)}
@@ -96,7 +94,7 @@ const Card = ({
9694
{capsule(paper.slot)}
9795
{capsule(paper.year)}
9896
</div>
99-
<div className="flex items-center justify-between gap-2">
97+
<div className="hidden md:flex items-center justify-between gap-2">
10098
<div className="flex items-center gap-1">
10199
<input
102100
checked={checked}

src/components/CatalogueContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ const CatalogueContent = () => {
181181
<Loader />
182182
) : papers.length > 0 ? (
183183
<>
184-
<div className="mb-4 flex justify-center gap-2 md:justify-end 2xl:mr-4">
184+
<div className="mb-4 hidden md:flex justify-center gap-2 md:justify-end 2xl:mr-4">
185185
<Button variant="outline" onClick={handleSelectAll}>
186186
Select All
187187
</Button>

0 commit comments

Comments
 (0)