-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ba6fe1c
commit 897f182
Showing
44 changed files
with
1,188 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import {FC, SVGProps } from 'react'; | ||
|
||
const AddPlusIcon: FC<SVGProps<SVGSVGElement>> = (props) => { | ||
return ( | ||
<svg | ||
width="24" | ||
height="24" | ||
viewBox="0 0 24 24" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
{...props} | ||
> | ||
<path | ||
d="M11 18H13C14.1046 18 15 17.1046 15 16C15 14.8954 14.1046 14 13 14H11C9.89543 14 9 14.8954 9 16C9 17.1046 9.89543 18 11 18Z" | ||
fill="#212121" | ||
/> | ||
</svg> | ||
); | ||
} | ||
|
||
export default AddPlusIcon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import ProjectCard from 'containers/projects/ui/Card'; | ||
import React from 'react'; | ||
import Icon from 'components/icon'; | ||
import eye from 'svgs/icons/eye.svg?sprite'; | ||
import upload from 'svgs/icons/upload.svg?sprite'; | ||
import CHEVRON_LEFT from 'svgs/icons/arrow-left.svg?sprite'; | ||
|
||
const FundingHome = () => { | ||
return ( | ||
<ProjectCard title=""> | ||
<div className="flex flex-col items-center justify-center font-display h-[50vh]"> | ||
<h2 className="md:text-2xl">You have no funding</h2> | ||
<h2 className="md:text-2xl">Reported for this project</h2> | ||
<div className="md:w-[406px] text-center font-sans my-5"> | ||
<p> | ||
Lorem ipsum dolor sit amet consectetur. Convallis fusce neque odio nunc elementum | ||
habitant sit sagittis. | ||
</p> | ||
</div> | ||
<button className="bg-green-10 text-black rounded-lg p-2"> Report Funding</button> | ||
</div> | ||
|
||
<div className="flex items-center justify-end"> | ||
<button className="flex items-center p-2 mt-6 text-black transition bg-transparent border rounded-lg hover:bg-blue-700"> | ||
<span className="pr-2"> | ||
<Icon icon={CHEVRON_LEFT} className="w-3 h-3" /> | ||
</span> | ||
Focus Area{' '} | ||
</button> | ||
</div> | ||
</ProjectCard> | ||
); | ||
}; | ||
|
||
export default FundingHome; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
client/src/containers/project/components/ProjectDetails/component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React from 'react' | ||
import { useDispatch, useSelector } from 'react-redux'; | ||
import { updateProjectDetails } from 'store/projects/projectFormSlice'; | ||
|
||
|
||
const ProjectDetails = () => { | ||
const dispatch = useDispatch(); | ||
const projectDetails = useSelector((state: RootState) => state.projectForm.projectDetails); | ||
|
||
const handleChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => { | ||
dispatch(updateProjectDetails({ [e.target.name]: e.target.value })); | ||
} | ||
return ( | ||
<div className="space-y-6"> | ||
<div> | ||
<label className="block text-sm font-medium text-gray-700 mb-1">Project Name</label> | ||
<input | ||
name="name" | ||
value={projectDetails.name} | ||
onChange={handleChange} | ||
className="w-full p-2 border rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500" | ||
/> | ||
</div> | ||
|
||
<div> | ||
<label className="block text-sm font-medium text-gray-700 mb-1">Description</label> | ||
<textarea | ||
name="description" | ||
value={projectDetails.description} | ||
onChange={handleChange} | ||
rows={4} | ||
className="w-full p-2 border rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500" | ||
/> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default ProjectDetails |
1 change: 1 addition & 0 deletions
1
client/src/containers/project/components/ProjectDetails/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {default} from './component'; |
48 changes: 48 additions & 0 deletions
48
client/src/containers/project/components/ProjectForm/component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { useMutation, useQuery } from '@tanstack/react-query'; | ||
import { useProject } from 'hooks/projects'; | ||
import React, {useEffect} from 'react' | ||
import { useDispatch, useSelector } from 'react-redux'; | ||
import { setFormData, resetForm } from 'store/projects/projectFormSlice'; | ||
|
||
const STEP_COMPONENTS = [ | ||
ProjectDetailsStep, | ||
ContactDetailsStep, | ||
FocusAreasStep, | ||
FundingStep | ||
]; | ||
|
||
interface ProjectFormProps { | ||
isEdit?: boolean; | ||
projectId?: string; | ||
} | ||
const ProjectForm = ({isEdit = false, projectId}: ProjectFormProps) => { | ||
|
||
const dispatch = useDispatch(); | ||
const currentStep = useSelector((state: RootState) => state.projectForm.currentStep); | ||
|
||
const {data: projectData, isLoading} = useProject(projectId, {enabled: isEdit && !!projectId}); | ||
|
||
useEffect(() => { | ||
if(isEdit && projectData){ | ||
dispatch(setFormData(projectData)); | ||
} | ||
|
||
return () => { if(!isEdit) dispatch(resetForm()) }; | ||
}, [dispatch, isEdit, projectData]); | ||
|
||
const mutationOptions = { | ||
onSuccess: () => dispatch(resetForm()), | ||
onError: (error: Error) => console.error('Submission error.', error) | ||
} | ||
|
||
const createMutation = useMutation(, mutationOptions); | ||
|
||
|
||
return ( | ||
<div> | ||
|
||
</div> | ||
) | ||
} | ||
|
||
export default ProjectForm |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React from 'react'; | ||
|
||
const ProjectBreadcumb = () => { | ||
return ( | ||
<div className="flex flex-col md:flex-row justify-between my-2"> | ||
<div className="my-3 text-center"> | ||
<h1 className="font-normal text-[32px] py-3 md:py-0 font-display tracking-normal">Add or update project details</h1> | ||
</div> | ||
<div className="md:flex md:flex-row grid grid-cols-2 place-content-center justify-center gap-2"> | ||
<div> | ||
<button className="rounded-md p-2 border">Preview Project Page</button> | ||
</div> | ||
<div> | ||
<button className="rounded-md p-2 border">Report Funding</button> | ||
</div> | ||
|
||
<div> | ||
<button className="rounded-md p-2 border bg-green-0">Save Changes</button> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ProjectBreadcumb; |
Oops, something went wrong.