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