Skip to content

Commit e2c3b67

Browse files
ready for deployment
1 parent 78fde79 commit e2c3b67

File tree

14 files changed

+27
-38
lines changed

14 files changed

+27
-38
lines changed

src/app/(auth)/login/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export default function Loginpage() {
6060
setIsLoading(false);
6161
}
6262
return (
63-
<div className="mx-auto w-full max-w-md rounded-none border border-solid border-white/30 bg-white p-4 shadow-input dark:bg-black md:rounded-2xl md:p-8">
63+
<div className="mt-20 mx-auto w-full max-w-md rounded-none border border-solid border-white/30 bg-white p-4 shadow-input dark:bg-black md:rounded-2xl md:p-8">
6464
<h2 className="text-xl font-bold text-neutral-800 dark:text-neutral-200">
6565
Login to Riverflow
6666
</h2>

src/app/(auth)/register/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export default function Registerpage() {
6565
setIsLoading(false);
6666
}
6767
return (
68-
<div className="mx-auto w-full max-w-md rounded-none border border-solid border-white/30 bg-white p-4 shadow-input dark:bg-black md:rounded-2xl md:p-8">
68+
<div className="mt-20 mx-auto w-full max-w-md rounded-none border border-solid border-white/30 bg-white p-4 shadow-input dark:bg-black md:rounded-2xl md:p-8">
6969
<h2 className="text-xl font-bold text-neutral-800 dark:text-neutral-200">
7070
Welcome to Riverflow
7171
</h2>

src/app/components/HeroSectionHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const HeroSectionHeader = () => {
5959
<div className="flex items-center justify-center">
6060
<div className="space-y-4 text-center">
6161
<h1 className="pointer-events-none z-10 whitespace-pre-wrap bg-gradient-to-b from-[#ffd319] via-[#ff2975] to-[#8c1eff] bg-clip-text text-center text-7xl font-bold leading-none tracking-tighter text-transparent">
62-
RiverFlow
62+
OutOfBound
6363
</h1>
6464
<p className="text-center text-xl font-bold leading-none tracking-tighter">
6565
Ask questions, share knowledge, and collaborate with developers

src/app/components/TopContributors.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export default async function TopContributers() {
5151
const topUsers = await users.list<UserPrefs>([Query.limit(10)]);
5252

5353
return (
54-
<div className="bg-background relative flex max-h-[400px] min-h-[400px] w-full max-w-[32rem] flex-col overflow-hidden rounded-lg bg-white/10 p-6 shadow-lg">
54+
<div className="bg-white/10 relative flex max-h-[400px] min-h-[400px] w-full max-w-[32rem] flex-col overflow-hidden rounded-lg bg-white/10 p-6 shadow-lg">
5555
<AnimatedList>
5656
{topUsers.users.map(user => (
5757
<Notification user={user} key={user.$id} />

src/app/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ export default function Home() {
1010
const {user} = useAuthStore()
1111
const ref = React.useRef<HTMLDivElement>(null);
1212
const [height, setHeight] = React.useState(0);
13+
1314
React.useEffect(() => {
1415
if (ref.current) {
1516
setHeight(ref.current.clientHeight);
1617
}
18+
1719
}, [ref]);
1820
return (
1921
<div className="bg-black text-white min-h-screen py-20 mt-20">

src/app/questions/[quesId]/[quesName]/page.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const Page = async ({ params }: { params: { quesId: string; quesName: string } }
5050
Query.orderDesc("$createdAt"),
5151
]),
5252
]);
53+
5354

5455
// since it is dependent on the question, we fetch it here outside of the Promise.all
5556
const author = await users.get<UserPrefs>(question.authorId);
@@ -167,18 +168,20 @@ const Page = async ({ params }: { params: { quesId: string; quesName: string } }
167168
</div>
168169
<div className="w-full overflow-auto">
169170
<MarkdownPreview className="rounded-xl p-4" source={question.content} />
170-
<picture>
171+
{question.attachmentId && (<picture>
171172
<img
172173
src={
173-
storage.getFilePreview(
174+
storage.getFileView(
174175
questionAttachmentbucket,
175176
question.attachmentId
176-
)
177+
).toString()
177178
}
178179
alt={question.title}
179180
className="mt-3 rounded-lg"
180181
/>
181-
</picture>
182+
</picture>)}
183+
184+
182185
<div className="mt-3 flex flex-wrap items-center gap-3 text-sm">
183186
{question.tags.map((tag: string) => (
184187
<Link

src/app/questions/ask/AddQues.tsx

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,9 @@
11
"use client";
22

33
import QuestionForm from "@/components/QuestionForm";
4-
import { useAuthStore } from "@/store/Auth";
5-
import slugify from "@/utils/slugify";
6-
import { Models } from "appwrite";
7-
import { useRouter } from "next/navigation";
84
import React from "react";
95

10-
const AddQues = ({ question }: { question: Models.Document }) => {
11-
const { user } = useAuthStore();
12-
const router = useRouter();
13-
14-
React.useEffect(() => {
15-
if (question.authorId !== user?.$id) {
16-
router.push(`/questions/${question.$id}/${slugify(question.title)}`);
17-
}
18-
}, []);
19-
20-
if (user?.$id !== question.authorId) return null;
21-
6+
const AddQues = () => {
227
return (
238
<div className="pb-20 pt-32">
249
<div className="container mx-auto px-4">
@@ -27,7 +12,7 @@ const AddQues = ({ question }: { question: Models.Document }) => {
2712
<div className="flex flex-wrap md:flex-row-reverse">
2813
<div className="w-full"></div>
2914
<div className="w-full">
30-
<QuestionForm question={question} />
15+
<QuestionForm />
3116
</div>
3217
</div>
3318
</div>

src/app/questions/ask/page.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
import { db, questionCollection } from "@/models/name";
2-
import { databases } from "@/models/server/config";
31
import React from "react";
42
import AddQues from "./AddQues";
53
import { Particles } from "@/components/magicui/particles";
64

7-
const Page = async ({ params }: { params: { quesId: string; quesName: string } }) => {
8-
const question = await databases.getDocument(db, questionCollection, params.quesId);
9-
5+
const Page = async () => {
106
return (
117
<div>
128
<Particles
@@ -17,10 +13,9 @@ const Page = async ({ params }: { params: { quesId: string; quesName: string } }
1713
refresh
1814
/>
1915
<div className="flex justify-center items-center">
20-
<AddQues question={question} />
16+
<AddQues/>
2117
</div>
2218
</div>
23-
2419
);
2520
};
2621

src/app/questions/page.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ const Page = async ({
3434
);
3535

3636
const questions = await databases.listDocuments(db, questionCollection, queries);
37-
console.log("Questions", questions)
3837

3938
questions.documents = await Promise.all(
4039
questions.documents.map(async ques => {

src/app/users/[userId]/[userSlug]/edit/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ const Page = () => {
1313
refresh
1414
/>
1515
<div className="container mx-auto space-y-4 px-4 pb-20 pt-32">
16-
<h1>Edit</h1>
17-
<h2>Homework</h2>
16+
{/* <h1>Edit</h1>
17+
<h2>Homework</h2> */}
1818
</div>
1919
</div>
2020

src/middleware.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export async function middleware(){
1414
return NextResponse.next();
1515
}
1616

17-
//wherever the matches matches the path our code will not run there
17+
//wherever the matcher matches the path our code will not run there
1818
export const config = {
1919
/*
2020
match all req path except for the ones start with

src/models/server/storageSetup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default async function getOrCreateStorage(){
2121
false,
2222
undefined,
2323
undefined,
24-
["jpeg", "png", "gif", "jpeg", "webp", "heic"]
24+
["jpeg", "png", "gif", "webp", "heic"]
2525
)
2626
console.log("Bucket is created")
2727
console.log("Storage connected")

src/store/Auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { persist } from "zustand/middleware";
55
import {AppwriteException, ID, Models} from "appwrite";
66
import { account } from "@/models/client/config";
77

8-
//create a reputation for user based on thier votes
8+
//create a reputation for user based on their votes
99
export interface UserPrefs {
1010
reputation: number,
1111
}

vercel.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"rewrites": [
3+
{ "source": "/(.*)", "destination": "/index.html" }
4+
]
5+
}

0 commit comments

Comments
 (0)