Skip to content

Commit 91981a6

Browse files
committed
Refactor file structure: Move chat component to Chat folder
1 parent a2fa77b commit 91981a6

File tree

5 files changed

+43
-37
lines changed

5 files changed

+43
-37
lines changed

client/src/components/chat.tsx renamed to client/src/components/Chat/chat.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

3-
import { PlaceholdersAndVanishInput } from "./ui/placeholders-and-vanish-input";
4-
import { useState, useEffect } from "react";
3+
import { PlaceholdersAndVanishInput } from "../ui/placeholders-and-vanish-input";
4+
import { useState } from "react";
55
import axios from "axios";
66

77
export function PlaceholdersAndVanishInputDemo() {
@@ -19,7 +19,7 @@ export function PlaceholdersAndVanishInputDemo() {
1919
"How to assemble your own PC?",
2020
];
2121

22-
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
22+
const handleChange = () => {
2323
// You can add any additional logic here if needed
2424
};
2525

client/src/components/Navbar/navbar.tsx

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,47 +7,54 @@ import {
77
IconNewSection,
88
IconTerminal2,
99
} from "@tabler/icons-react";
10+
import React from "react";
11+
12+
interface Link {
13+
title: string;
14+
icon: React.ReactNode;
15+
to: string;
16+
}
1017

1118
export function Navbar() {
12-
const links = [
19+
const links: Link[] = [
1320
{
1421
title: "Home",
1522
icon: <IconHome className="h-full w-full text-neutral-500 dark:text-neutral-300" />,
16-
to: "#top", // Scroll to top
23+
to: "#top",
1724
},
1825
{
1926
title: "Features",
2027
icon: <IconTerminal2 className="h-full w-full text-neutral-500 dark:text-neutral-300" />,
21-
to: "#features", // Scroll to features section
28+
to: "#features",
2229
},
2330
{
2431
title: "FAQs",
2532
icon: <IconNewSection className="h-full w-full text-neutral-500 dark:text-neutral-300" />,
26-
to: "#help", // Scroll to help section
33+
to: "#help",
2734
},
2835
{
2936
title: "DevHub",
3037
icon: <img src="../../../public/logo.png" width={20} height={20} alt="DevHub" />,
31-
to: "#", // No scrolling
38+
to: "#",
3239
},
3340
{
3441
title: "DevMap",
3542
icon: <IconExchange className="h-full w-full text-neutral-500 dark:text-neutral-300" />,
36-
to: "#", // No scrolling
43+
to: "#",
3744
},
3845
{
3946
title: "Discord",
4047
icon: <IconBrandDiscord className="h-full w-full text-neutral-500 dark:text-neutral-300" />,
41-
to: "https://discord.gg/he8QHEC8WP", // Discord link
48+
to: "https://discord.gg/he8QHEC8WP",
4249
},
4350
{
4451
title: "GitHub",
4552
icon: <IconBrandGithub className="h-full w-full text-neutral-500 dark:text-neutral-300" />,
46-
to: "https://github.com/devhub-ai/devhub", // GitHub link
53+
to: "https://github.com/devhub-ai/devhub",
4754
},
4855
];
4956

50-
const handleClick = (event, link) => {
57+
const handleClick = (event: React.MouseEvent<HTMLAnchorElement>, link: Link) => {
5158
if (link.to.startsWith("#")) {
5259
event.preventDefault();
5360
const targetElement = document.querySelector(link.to);
@@ -62,9 +69,9 @@ export function Navbar() {
6269
<FloatingDock
6370
items={links.map(link => ({
6471
...link,
65-
onClick: (event) => handleClick(event, link),
72+
onClick: (event: React.MouseEvent<HTMLAnchorElement>) => handleClick(event, link),
6673
}))}
6774
/>
6875
</div>
6976
);
70-
}
77+
}

client/src/pages/Home.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { cn } from "@/lib/utils";
2-
import { PlaceholdersAndVanishInputDemo } from "@/components/chat";
2+
import { PlaceholdersAndVanishInputDemo } from "@/components/Chat/chat";
33
import HomeSidebar from "@/components/Sidebar/HomeSidebar";
44

55
interface HomeProps {

client/src/pages/Profile.tsx

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -417,27 +417,25 @@ const Dashboard: React.FC<DashboardProps> = ({ loggedInUsername }) => {
417417
</div>
418418

419419
<div className="space-y-6 lg:space-y-10">
420-
<div className="flex flex-col space-y-2 lg:space-y-4">
421-
<h2 className="text-xl font-bold">Friends</h2>
422-
{friends.length > 0 ? (
423-
friends.map((friend: string) => (
424-
<div key={friend} className="flex items-center space-x-2">
425-
<img
426-
src="/placeholder.svg"
427-
width="30"
428-
height="30"
429-
className="rounded-full"
430-
alt="Friend Avatar"
431-
/>
432-
<p className="text-sm font-semibold">{friend}</p>
433-
</div>
434-
))
435-
) : (
436-
<p className="text-sm text-gray-500 dark:text-gray-400">
437-
No friends yet
438-
</p>
439-
)}
440-
</div>
420+
<div className="flex flex-col space-y-2 lg:space-y-4">
421+
<h2 className="text-xl font-bold">Friends</h2>
422+
{friends.length > 0 ? (
423+
friends.map((friend: string) => (
424+
<div key={friend} className="flex items-center space-x-2">
425+
<a
426+
href={`${backendUrl}/u/${friend}`}
427+
className="text-sm font-semibold"
428+
>
429+
{friend}
430+
</a>
431+
</div>
432+
))
433+
) : (
434+
<p className="text-sm text-gray-500 dark:text-gray-400">
435+
No friends yet
436+
</p>
437+
)}
438+
</div>
441439

442440
<div className="space-y-6 lg:space-y-10">
443441
{leetcodeSvg ? (

server/server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from app import create_app
2+
import gunicorn
23

34
app = create_app()
45

56
if __name__ == '__main__':
6-
app.run(debug=True)
7+
app.run(host='0.0.0.0', debug=True)

0 commit comments

Comments
 (0)