From 8fb9a0a1d8358b6d0eca0618cc0643534349160b Mon Sep 17 00:00:00 2001 From: ttpl-rt-217 Date: Fri, 31 Jan 2025 15:10:52 +0530 Subject: [PATCH 1/2] Issue task PS-3327 :Youth UI figma match --- src/components/SimpleModal.tsx | 4 +- src/components/youthNet/GenericForm.tsx | 1 - src/pages/youthboard/surveys/index.tsx | 15 +--- src/pages/youthboard/villages/index.tsx | 69 +++++++++++++++++++ .../youthNet/Dashboard/UserServices.ts | 2 +- 5 files changed, 74 insertions(+), 17 deletions(-) diff --git a/src/components/SimpleModal.tsx b/src/components/SimpleModal.tsx index a4644836..2d465456 100644 --- a/src/components/SimpleModal.tsx +++ b/src/components/SimpleModal.tsx @@ -22,6 +22,7 @@ interface SimpleModalProps { open: boolean; onClose: () => void; modalTitle: string; + handleNext? : any } const SimpleModal: React.FC = ({ open, @@ -33,6 +34,7 @@ const SimpleModal: React.FC = ({ secondaryActionHandler, children, modalTitle, + handleNext }) => { const theme = useTheme(); const isMobile = useMediaQuery(theme.breakpoints.down('sm')); @@ -118,7 +120,7 @@ const SimpleModal: React.FC = ({ variant="contained" color="primary" sx={buttonStyle} - onClick={primaryActionHandler} + onClick={primaryActionHandler || handleNext} className='one-line-text' > {primaryText} diff --git a/src/components/youthNet/GenericForm.tsx b/src/components/youthNet/GenericForm.tsx index cc6de457..b6d3a4d0 100644 --- a/src/components/youthNet/GenericForm.tsx +++ b/src/components/youthNet/GenericForm.tsx @@ -27,7 +27,6 @@ const GenericForm: React.FC = ({ fields }) => { display: "flex", flexDirection: "column", gap: 2, - padding: 2, borderRadius: "8px", }} > diff --git a/src/pages/youthboard/surveys/index.tsx b/src/pages/youthboard/surveys/index.tsx index 8e594551..0d59b4d6 100644 --- a/src/pages/youthboard/surveys/index.tsx +++ b/src/pages/youthboard/surveys/index.tsx @@ -32,20 +32,7 @@ const Survey = () => { router.push('/youthboard/volunteerList'); }; - const formFields = [ - { type: "text", label: "Full Name" }, - { type: "number", label: "Contact Number" }, - { - type: "radio", - label: "Gender", - options: [ - { value: "female", label: "Female" }, - { value: "male", label: "Male" }, - ], - }, - { type: "number", label: "Age" }, - { type: "email", label: "Mentor's Email ID" }, - ]; + return ( <> diff --git a/src/pages/youthboard/villages/index.tsx b/src/pages/youthboard/villages/index.tsx index c00caf5d..ff9a8b42 100644 --- a/src/pages/youthboard/villages/index.tsx +++ b/src/pages/youthboard/villages/index.tsx @@ -46,6 +46,8 @@ import AddIcon from '@mui/icons-material/Add'; import SimpleModal from '@/components/SimpleModal'; import Surveys from '@/components/youthNet/Surveys'; import { useDirection } from '@/hooks/useDirection'; +import GenericForm from '@/components/youthNet/GenericForm'; +import ExamplePage from '@/components/youthNet/BlockItem'; const Index = () => { const { isRTL } = useDirection(); @@ -62,11 +64,15 @@ const Index = () => { const [openReassignDistrict, setOpenReassignDistrict] = useState(false); const [openReassignVillage, setOpenReassignVillage] = useState(false); + const [addNew, setAddNew] = useState(false); + const [count, setCount] = useState(0); + const [openDelete, setOpenDelete] = useState(false); const [selectedValue, setSelectedValue] = useState(''); const [districtData, setDistrictData] = useState(null); const [blockData, setBlockData] = useState(null); + useEffect(() => { const getData = async () => { const districtData = await fetchDistrictData(); @@ -107,6 +113,7 @@ const Index = () => { setOpenDelete(false); setOpenReassignDistrict(false); setOpenReassignVillage(false); + setAddNew(false) }; const handleButtonClick = (actionType: string) => { @@ -176,6 +183,29 @@ const Index = () => { setSelectedValue(value); }; + const formFields = [ + { type: "text", label: "Full Name" }, + { type: "number", label: "Contact Number" }, + { + type: "radio", + label: "Gender", + options: [ + { value: "female", label: "Female" }, + { value: "male", label: "Male" }, + ], + }, + { type: "number", label: "Age" }, + { type: "email", label: "Mentor's Email ID" }, + ]; + + const handleOpenNew = () => { + setAddNew(true) + } + + const handleNext= () => { + setCount(count + 1) + } + return ( @@ -286,6 +316,7 @@ const Index = () => { className="text-1E" // onClick={handleOpenAddFaciModal} endIcon={} + onClick={handleOpenNew} > {t('COMMON.ADD_NEW')} @@ -477,6 +508,44 @@ const Index = () => { + + + + { + count === 0 && ( + + + + + + ) + } + { + count === 1 && ( + + + + + + ) + } + + + + + )} diff --git a/src/services/youthNet/Dashboard/UserServices.ts b/src/services/youthNet/Dashboard/UserServices.ts index 14b14ebb..8e43a281 100644 --- a/src/services/youthNet/Dashboard/UserServices.ts +++ b/src/services/youthNet/Dashboard/UserServices.ts @@ -3,7 +3,7 @@ const API_BASE_URL = process.env.NEXT_PUBLIC_API_BASE_URL || ''; const MENTOR_DETAILS = { MENTOR_NAME: 'Mentor', - MENTOR_OPTIONS: ['Shivan Mathur', 'Mentor 2', 'Mentor 3', 'Mentor 4'], + MENTOR_OPTIONS: ['Shivan Mathur', 'Vivek kasture', 'Rohan Nene', 'Sanket Jadhav'], }; export const fetchUserData = async (): Promise => { From 40e580c883d7c3e9841cc227ca4bce1618bdf9ab Mon Sep 17 00:00:00 2001 From: ttpl-rt-217 Date: Fri, 31 Jan 2025 15:11:57 +0530 Subject: [PATCH 2/2] Issue task PS-3327 :Youth UI figma match --- src/pages/youthboard/campDetails/[surveyCamp].tsx | 2 +- .../youthboard/village-camp-survyey/[villageSurveyName].tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/youthboard/campDetails/[surveyCamp].tsx b/src/pages/youthboard/campDetails/[surveyCamp].tsx index ff07c726..5aeeada5 100644 --- a/src/pages/youthboard/campDetails/[surveyCamp].tsx +++ b/src/pages/youthboard/campDetails/[surveyCamp].tsx @@ -124,7 +124,7 @@ const SurveyClassDetails = () => { )} - {value === 2 && Tab 2} + {value === 2 && coming soon} ); }; diff --git a/src/pages/youthboard/village-camp-survyey/[villageSurveyName].tsx b/src/pages/youthboard/village-camp-survyey/[villageSurveyName].tsx index 4a7dfae5..ab3ef20d 100644 --- a/src/pages/youthboard/village-camp-survyey/[villageSurveyName].tsx +++ b/src/pages/youthboard/village-camp-survyey/[villageSurveyName].tsx @@ -125,7 +125,7 @@ const villageSurveyName = () => { )} - {value === 2 && Tab 2} + {value === 2 && coming soon} ) }