Skip to content

Commit 9ef35b5

Browse files
committed
fix: updating types and interface
1 parent 91981a6 commit 9ef35b5

File tree

4 files changed

+35
-32
lines changed

4 files changed

+35
-32
lines changed

client/src/components/MultiSelect/TagInput.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const TAGS = [
2222
{ value: "fintech", label: "Fintech" },
2323
];
2424

25-
export default function TagInput({ selectedTags, onTagsChange }) {
25+
export function TagInput({ selectedTags, onTagsChange }) {
2626
const inputRef = React.useRef(null);
2727
const [open, setOpen] = React.useState(false);
2828
const [inputValue, setInputValue] = React.useState("");

client/src/components/ui/sidebar.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"use client";
22
import { cn } from "@/lib/utils";
3-
import { Link, LinkProps } from 'react-router-dom';
43
import React, { useState, createContext, useContext } from "react";
54
import { AnimatePresence, motion } from "framer-motion";
65
import { IconMenu2, IconX } from "@tabler/icons-react";

client/src/pages/EditForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export function ProfileForm() {
7474
control: form.control,
7575
})
7676

77-
function onSubmit(data: ProfileFormValues) {
77+
function onSubmit() {
7878
toast.success("Signup successful", {
7979
description: "You can now log in with your new account."
8080

client/src/pages/Profile.tsx

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,13 @@ interface ProfileProps {
2121
interface Project {
2222
description: string;
2323
repoLink: string;
24-
tags: string;
24+
tags: string[];
2525
title: string;
26+
repo?: string;
27+
link?: string;
28+
language?: string;
29+
stars?: number;
30+
forks?: number;
2631
}
2732

2833
interface UserResponse {
@@ -50,28 +55,28 @@ interface Language {
5055
percentage: string;
5156
}
5257

53-
interface LeetCodeData {
54-
totalSolved: number;
55-
totalSubmissions: number;
56-
totalQuestions: number;
57-
easySolved: number;
58-
totalEasy: number;
59-
mediumSolved: number;
60-
totalMedium: number;
61-
hardSolved: number;
62-
totalHard: number;
63-
ranking: number;
64-
contributionPoint: number;
65-
reputation: number;
66-
submissionCalendar: string;
67-
recentSubmissions: {
68-
title: string;
69-
titleSlug: string;
70-
timestamp: string;
71-
statusDisplay: string;
72-
lang: string;
73-
}[];
74-
}
58+
// interface LeetCodeData {
59+
// totalSolved: number;
60+
// totalSubmissions: number;
61+
// totalQuestions: number;
62+
// easySolved: number;
63+
// totalEasy: number;
64+
// mediumSolved: number;
65+
// totalMedium: number;
66+
// hardSolved: number;
67+
// totalHard: number;
68+
// ranking: number;
69+
// contributionPoint: number;
70+
// reputation: number;
71+
// submissionCalendar: string;
72+
// recentSubmissions: {
73+
// title: string;
74+
// titleSlug: string;
75+
// timestamp: string;
76+
// statusDisplay: string;
77+
// lang: string;
78+
// }[];
79+
// }
7580

7681
const Profile: React.FC<ProfileProps> = ({ onLogout, username }) => {
7782
return (
@@ -94,16 +99,15 @@ const Dashboard: React.FC<DashboardProps> = ({ loggedInUsername }) => {
9499
const { username } = useParams<{ username: string }>();
95100
const dispatch = useDispatch<AppDispatch>();
96101
const friends = useSelector((state: RootState) => state.user.friends);
97-
const friendStatus = useSelector(
98-
(state: RootState) => state.user.friendStatus
99-
);
102+
// const friendStatus = useSelector(
103+
// (state: RootState) => state.user.friendStatus
104+
// );
100105
const [profileData, setProfileData] = useState<UserResponse>();
101106
const [editing, setEditing] = useState(false);
102107
const [githubData, setGithubData] = useState<GitHubData | null>(null);
103108
const [languages, setLanguages] = useState<Language[]>([]);
104109
const [streakStats, setStreakStats] = useState<string | null>(null);
105110
const [pinnedRepos, setPinnedRepos] = useState<Project[]>([]);
106-
const [leetcodeData, setLeetcodeData] = useState<LeetCodeData | null>(null);
107111
const [leetcodeSvg, setLeetcodeSvg] = useState(null);
108112
const [githubStreakSvg, setGithubStreakSvg] = useState(null);
109113

@@ -248,13 +252,13 @@ const Dashboard: React.FC<DashboardProps> = ({ loggedInUsername }) => {
248252
data: { friend_username: loggedInUsername },
249253
});
250254
setProfileData((prev) => (prev ? { ...prev, isFriend: false } : prev));
251-
dispatch(setFriendStatus(false)); // Update Redux state
255+
dispatch(setFriendStatus({ username: loggedInUsername, isFriend: false })); // Updated to pass an object
252256
} else {
253257
await axios.post(`${backendUrl}/profile/${username}/friends`, {
254258
friend_username: loggedInUsername,
255259
});
256260
setProfileData((prev) => (prev ? { ...prev, isFriend: true } : prev));
257-
dispatch(setFriendStatus(true)); // Update Redux state
261+
dispatch(setFriendStatus({ username: loggedInUsername, isFriend: true })); // Updated to pass an object
258262
}
259263
} catch (error) {
260264
console.error("Failed to update friend status:", error);

0 commit comments

Comments
 (0)