Skip to content

Commit

Permalink
feat(#156): Implement trainee application functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
robsdagreat committed Oct 23, 2024
1 parent fcb1866 commit 97fdb9f
Show file tree
Hide file tree
Showing 159 changed files with 17,038 additions and 6,187 deletions.
Binary file modified .DS_Store
Binary file not shown.
6 changes: 3 additions & 3 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ checks:
complex-logic:
enabled: true
config:
threshold: 4
threshold: 15
file-lines:
enabled: true
config:
threshold: 250
method-complexity:
enabled: true
config:
threshold: 5
threshold: 15
method-count:
enabled: true
config:
threshold: 20
method-lines:
enabled: true
config:
threshold: 90
threshold: 200
nested-control-flow:
enabled: true
config:
Expand Down
20 changes: 14 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@babel/preset-env": "^7.19.3",
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.18.6",
"@expo/webpack-config": "^0.17.2",
"@expo/webpack-config": "^19.0.1",
"@iconify/react": "^4.0.0",
"@testing-library/dom": "^8.19.0",
"@testing-library/jest-dom": "^5.16.5",
Expand All @@ -53,7 +53,7 @@
"html-webpack-plugin": "^5.6.0",
"i": "^0.3.7",
"node-polyfill-webpack-plugin": "^2.0.1",
"npm": "^8.19.2",
"npm": "^10.8.3",
"postcss": "^8.4.14",
"postcss-loader": "^7.0.0",
"process": "^0.11.10",
Expand All @@ -69,7 +69,7 @@
"webpack-dev-server": "^4.11.1"
},
"dependencies": {
"@apollo/client": "^3.8.1",
"@apollo/client": "^3.11.8",
"@emotion/react": "^11.10.4",
"@emotion/styled": "^11.10.4",
"@fortawesome/fontawesome-svg-core": "^6.4.2",
Expand All @@ -78,14 +78,16 @@
"@fortawesome/react-fontawesome": "^0.2.0",
"@heroicons/react": "^1.0.6",
"@hookform/resolvers": "^3.3.0",
"@mui/icons-material": "^6.1.1",
"@mui/material": "^5.10.11",
"@mui/x-date-pickers": "^5.0.6",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@tinymce/tinymce-react": "^4.2.0",
"@tinymce/tinymce-react": "^5.1.1",
"@types/react-i18next": "^8.1.0",
"@types/react-router": "^5.1.19",
"@types/react-router-dom": "^5.3.3",
"antd": "^5.21.2",
"axios": "^1.1.2",
"bootstrap": "^5.2.2",
"browser": "^0.2.6",
Expand Down Expand Up @@ -113,27 +115,33 @@
"patch-package": "^6.4.7",
"path": "^0.12.7",
"popper.js": "^1.16.1",
"pusher": "^5.2.0",
"pusher-js": "^8.4.0-rc2",
"react-datepicker": "^4.8.0",
"react-hook-form": "^7.45.4",
"react-hot-toast": "^2.4.1",
"react-i18next": "^11.18.6",
"react-icons": "^4.6.0",
"react-js-pagination": "^3.0.3",
"react-js-pagination": "^3.0.2",
"react-loader-spinner": "^6.1.6",
"react-modal": "^3.16.1",
"react-paginate": "^8.1.3",
"react-redux": "^8.0.4",
"react-render-html": "^0.6.0",
"react-router-dom": "^6.4.2",
"react-scripts": "^5.0.1",
"react-scripts": "^3.0.1",
"react-select": "^5.7.4",
"react-table": "^7.8.0",
"react-toastify": "^9.0.8",
"recharts": "^2.12.7",
"redux": "^4.2.0",
"redux-devtools-extension": "^2.13.9",
"redux-state-sync": "^3.1.4",
"redux-thunk": "^2.4.1",
"socket.io-client": "^4.8.0",
"stream": "^0.0.2",
"stream-http": "^3.2.0",
"subscriptions-transport-ws": "^0.11.0",
"ts-jest": "^29.0.3",
"with-click-outside": "^1.0.1",
"yup": "^1.2.0",
Expand Down
1 change: 0 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@
</head>
<body>
<div id="root"></div>

</body>
</html>
Binary file modified src/.DS_Store
Binary file not shown.
11 changes: 8 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import React from 'react';
import AppRoutes from './routes/index';
import React from "react";
import AppRoutes from "./routes/index";
import { NotificationProvider } from "./utils/Notifications";

function App() {
return <AppRoutes />;
return (
<NotificationProvider>
<AppRoutes />
</NotificationProvider>
);
}

export default App;
3 changes: 3 additions & 0 deletions src/assets/Group (1).svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/assets/Group.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/Vector.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/assets/assets/calendar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/assets/assets/collaborative-learning.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/assets/assets/performance.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/assets/assets/strategy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/material-symbols_manage-accounts.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 67 additions & 0 deletions src/components/Education.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import React from 'react';
import InputField from './form/InputField';

interface FormData {
gender: string;
birth_date: string;
Address: string;
phone: string;
field_of_study: string;
education_level: string;
province: string;
district: string;
sector: string;
isEmployed: string;
haveLaptop: string;
isStudent: string;
past_andela_programs: string;
understandTraining: string;
}

interface EducationSectionProps {
formData: FormData;
handleInputChange: (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement>) => void;
isDarkMode: boolean;
}

const EducationSection: React.FC<EducationSectionProps> = ({ formData, handleInputChange, isDarkMode }) => {
const inputClassName = `w-52 md:w-2/3 rounded-md px-2 py-2 border ${
isDarkMode
? 'border-white placeholder:text-gray-400 text-white bg-[#1F2A37]'
: 'border-gray-300 placeholder:text-gray-500 text-gray-900 bg-white'
} sm:text-[12px] outline-none`;
return (
<>
<div className='space-y-3'>
<div>
<label htmlFor="education_level" className={isDarkMode ? 'text-white' : 'text-gray-800'}>
What is your highest level of education?
</label>
<InputField
name="education_level"
placeholder="Education level"
type="text"
value={formData.education_level}
onChange={handleInputChange}
className={inputClassName}
/>
</div>
<div>
<label htmlFor="field_of_study" className={isDarkMode ? 'text-white' : 'text-gray-800'}>
What is your field of education?
</label>
<InputField
name="field_of_study"
placeholder="field of study"
type="text"
value={formData.field_of_study}
onChange={handleInputChange}
className={inputClassName}
/>
</div>
</div>
</>
);
};

export default EducationSection;
6 changes: 3 additions & 3 deletions src/components/GoogleForm/ApplicationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ const ApplicationForm = () => {
};

return (
<div>
<div className='flex justify-center'>
<div className='flex px-5 py-2 w-fit'>
<div className='flex justify-center'>
<div className='flex justify-between w-[62%]'>
<div className='flex py-4 w-fit'>
<button
onClick={() =>
window.open('https://docs.google.com/forms/u/0/', '_blank')
Expand Down
62 changes: 62 additions & 0 deletions src/components/GoogleForm/DeleteConfirmationModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import React from 'react';
import { AiOutlineExclamation } from 'react-icons/ai'; // Ensure you have the correct import for icons

interface DeleteConfirmationModalProps {
isOpen: boolean;
onClose: () => void;
onDelete: () => void;
}

const DeleteConfirmationModal: React.FC<DeleteConfirmationModalProps> = ({
isOpen,
onClose,
onDelete,
}) => {
if (!isOpen) return null; // Render nothing if modal is not open

return (
<div>
<div className='fixed inset-0 transition-opacity bg-gray-500 bg-opacity-75' />
<div className='fixed inset-0 z-10 overflow-y-auto'>
<div className='flex items-end justify-center min-h-full p-4 text-center sm:items-center sm:p-0'>
<div className='relative overflow-hidden text-left transition-all transform bg-white rounded-lg shadow-xl sm:my-8 sm:w-full sm:max-w-lg'>
<div className='px-4 pt-5 pb-4 bg-white sm:p-6 sm:pb-4'>
<div className='sm:flex sm:items-start'>
<div className='flex items-center justify-center flex-shrink-0 w-12 h-12 mx-auto bg-red-100 rounded-full sm:mx-0 sm:h-10 sm:w-10'>
<AiOutlineExclamation className='w-6 h-6 text-red-600' />
</div>
<div className='mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left'>
<div className='text-lg font-medium leading-6 text-gray-900'>
Delete the Form
</div>
<div className='mt-2'>
<p className='text-sm text-gray-500'>
Are you sure you want to delete this item? All of the
form data will be permanently removed. This action cannot be undone.
</p>
</div>
</div>
</div>
</div>
<div className='px-4 py-3 bg-gray-50 sm:flex sm:flex-row-reverse sm:px-6'>
<button
type='button'
className='inline-flex justify-center w-full px-4 py-2 text-base font-medium text-white bg-red-600 border border-transparent rounded-md shadow-sm hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 sm:ml-3 sm:w-auto sm:text-sm'
onClick={onDelete}>
Delete
</button>
<button
type='button'
className='inline-flex justify-center w-full px-4 py-2 mt-3 text-base font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm'
onClick={onClose}>
Cancel
</button>
</div>
</div>
</div>
</div>
</div>
);
};

export default DeleteConfirmationModal;
Loading

0 comments on commit 97fdb9f

Please sign in to comment.