Minor fixes
This commit is contained in:
parent
3e9dc87100
commit
d64ec708a1
1 changed files with 12 additions and 4 deletions
|
@ -7,10 +7,10 @@ import BasicWindow from "../Components/BasicWindow";
|
||||||
export const ProjectNameContext = createContext("");
|
export const ProjectNameContext = createContext("");
|
||||||
|
|
||||||
function UserProjectPage(): JSX.Element {
|
function UserProjectPage(): JSX.Element {
|
||||||
const [projects, setProjects] = useState<Project[]>([]);
|
/* const [projects, setProjects] = useState<Project[]>([]);
|
||||||
const [selectedProject, setSelectedProject] = useState("");
|
*/ const [selectedProject, setSelectedProject] = useState("");
|
||||||
|
|
||||||
const getProjects = async (): Promise<void> => {
|
/* const getProjects = async (): Promise<void> => {
|
||||||
const username = localStorage.getItem("username") ?? ""; // replace with actual username
|
const username = localStorage.getItem("username") ?? ""; // replace with actual username
|
||||||
const token = localStorage.getItem("accessToken") ?? ""; // replace with actual token
|
const token = localStorage.getItem("accessToken") ?? ""; // replace with actual token
|
||||||
const response = await api.getUserProjects(username, token);
|
const response = await api.getUserProjects(username, token);
|
||||||
|
@ -24,7 +24,15 @@ function UserProjectPage(): JSX.Element {
|
||||||
// Call getProjects when the component mounts
|
// Call getProjects when the component mounts
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getProjects();
|
getProjects();
|
||||||
}, []);
|
}, []); */
|
||||||
|
|
||||||
|
// Mock data
|
||||||
|
const projects: Project[] = [
|
||||||
|
{ id: "1", name: "Project 1" },
|
||||||
|
{ id: "2", name: "Project 2" },
|
||||||
|
{ id: "3", name: "Project 3" },
|
||||||
|
// Add more mock projects as needed
|
||||||
|
];
|
||||||
|
|
||||||
const handleProjectClick = (projectName: string): void => {
|
const handleProjectClick = (projectName: string): void => {
|
||||||
setSelectedProject(projectName);
|
setSelectedProject(projectName);
|
||||||
|
|
Loading…
Reference in a new issue