Skip to content

Commit 9a80388

Browse files
committed
Fix add question page except for css
1 parent d59dd85 commit 9a80388

26 files changed

+3390
-479
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
**/.env
22
.idea
3-
*.log
3+
*.log
4+
main.exe

lc/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
.env
1+
.env
2+
content/

peerprep/app/actions/server_actions.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ export async function login(state: FormState, formData: FormData) {
6464

6565
export async function hydrateUid(): Promise<undefined | string> {
6666
if (!cookies().has("session")) {
67+
// TODO: this should not be required because of middleware
6768
console.log("No session found - triggering switch back to login page.");
68-
redirect("/auth/login");
69+
// redirect("/auth/login");
6970
}
7071
const json = await verifyUser();
7172
if (isError(json)) {
@@ -74,5 +75,7 @@ export async function hydrateUid(): Promise<undefined | string> {
7475
redirect("/api/internal/auth/expire");
7576
}
7677

77-
return json.data.id;
78+
// TODO: handle error handling
79+
const response = json as UserServiceResponse;
80+
return response.data.id;
7881
}

peerprep/app/globals.css

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,68 @@ h1,
1515
h2 {
1616
@apply text-text-2;
1717
}
18+
19+
@layer base {
20+
:root {
21+
--background: 0 0% 100%;
22+
--foreground: 0 0% 3.9%;
23+
--card: 0 0% 100%;
24+
--card-foreground: 0 0% 3.9%;
25+
--popover: 0 0% 100%;
26+
--popover-foreground: 0 0% 3.9%;
27+
--primary: 0 0% 9%;
28+
--primary-foreground: 0 0% 98%;
29+
--secondary: 0 0% 96.1%;
30+
--secondary-foreground: 0 0% 9%;
31+
--muted: 0 0% 96.1%;
32+
--muted-foreground: 0 0% 45.1%;
33+
--accent: 0 0% 96.1%;
34+
--accent-foreground: 0 0% 9%;
35+
--destructive: 0 84.2% 60.2%;
36+
--destructive-foreground: 0 0% 98%;
37+
--border: 0 0% 89.8%;
38+
--input: 0 0% 89.8%;
39+
--ring: 0 0% 3.9%;
40+
--chart-1: 12 76% 61%;
41+
--chart-2: 173 58% 39%;
42+
--chart-3: 197 37% 24%;
43+
--chart-4: 43 74% 66%;
44+
--chart-5: 27 87% 67%;
45+
--radius: 0.5rem;
46+
}
47+
.dark {
48+
--background: 0 0% 3.9%;
49+
--foreground: 0 0% 98%;
50+
--card: 0 0% 3.9%;
51+
--card-foreground: 0 0% 98%;
52+
--popover: 0 0% 3.9%;
53+
--popover-foreground: 0 0% 98%;
54+
--primary: 0 0% 98%;
55+
--primary-foreground: 0 0% 9%;
56+
--secondary: 0 0% 14.9%;
57+
--secondary-foreground: 0 0% 98%;
58+
--muted: 0 0% 14.9%;
59+
--muted-foreground: 0 0% 63.9%;
60+
--accent: 0 0% 14.9%;
61+
--accent-foreground: 0 0% 98%;
62+
--destructive: 0 62.8% 30.6%;
63+
--destructive-foreground: 0 0% 98%;
64+
--border: 0 0% 14.9%;
65+
--input: 0 0% 14.9%;
66+
--ring: 0 0% 83.1%;
67+
--chart-1: 220 70% 50%;
68+
--chart-2: 160 60% 45%;
69+
--chart-3: 30 80% 55%;
70+
--chart-4: 280 65% 60%;
71+
--chart-5: 340 75% 55%;
72+
}
73+
}
74+
75+
@layer base {
76+
* {
77+
@apply border-border;
78+
}
79+
body {
80+
@apply bg-background text-foreground;
81+
}
82+
}

peerprep/app/questions/[question]/question.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"use client";
2+
23
import React from "react";
34
import { Difficulty, Question } from "@/api/structs";
45
import Chip from "@/components/shared/Chip";
@@ -60,12 +61,6 @@ function QuestionBlock({ question }: Props) {
6061
</h1>
6162
<DifficultyChip diff={question.difficulty} />
6263
</div>
63-
<PeerprepButton
64-
className={` ${styles.button}`}
65-
onClick={handleDelete}
66-
>
67-
Delete
68-
</PeerprepButton>
6964
</div>
7065
<div className={styles.label_wrapper}>
7166
<p>Topics: </p>
File renamed without changes.

0 commit comments

Comments
 (0)