Skip to content

Commit

Permalink
fix(#156): Have a user be able to apply in different cycles
Browse files Browse the repository at this point in the history
  • Loading branch information
robsdagreat committed Oct 19, 2024
2 parents dfe840e + 710bf6f commit e019aab
Show file tree
Hide file tree
Showing 43 changed files with 1,710 additions and 682 deletions.
Binary file modified .DS_Store
Binary file not shown.
38 changes: 19 additions & 19 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ checks:
file-lines:
enabled: true
config:
threshold: 25000
threshold: 250
method-complexity:
enabled: true
config:
threshold: 50
threshold: 5
method-count:
enabled: true
config:
threshold: 20
method-lines:
enabled: true
config:
threshold: 900
threshold: 90
nested-control-flow:
enabled: true
config:
Expand All @@ -41,20 +41,20 @@ checks:
config:
threshold: #language-specific defaults. overrides affect all languages.
plugins:
rubocop:
enabled: true
eslint:
enabled: false
channel: eslint-8
rubocop:
enabled: true
eslint:
enabled: false
channel: eslint-8
exclude_patterns:
- "config/"
- "db/"
- "dist/"
- "features/"
- "**/node_modules/"
- "script/"
- "**/spec/"
- "**/test/"
- "**/tests/"
- "**/vendor/"
- "**/*.d.ts"
- "config/"
- "db/"
- "dist/"
- "features/"
- "**/node_modules/"
- "script/"
- "**/spec/"
- "**/test/"
- "**/tests/"
- "**/vendor/"
- "**/*.d.ts"
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@ coverage
dist
buildcoverage
package-lock.json
yarn.lock
.DS_Store
build/
yarn.lock
build/
10 changes: 5 additions & 5 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 Down Expand Up @@ -83,7 +83,7 @@
"@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",
Expand Down Expand Up @@ -120,14 +120,14 @@
"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",
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>
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.
71 changes: 71 additions & 0 deletions src/components/Education.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import React from 'react';

interface FormData {
gender: string;
birth_date: string;
address: string;
phone: string;
study: string;
education_level: string;
currentEducationLevel: string;
nationality: string;
province: string;
district: string;
sector: string;
discipline: string;
isEmployed: string;
haveLaptop: string;
isStudent: string;
applicationPost: string;
andelaPrograms: string;
understandTraining: string;
otherApplication: string;
otherPrograms: string;
}

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

const EducationSection: React.FC<EducationSectionProps> = ({ formData, handleInputChange, isDarkMode }) => {
return (
<>
<div className='space-y-3'>
<label htmlFor="education_level" className={isDarkMode ? 'text-white' : 'text-gray-800'}>What's your highest level of education?</label>
{['Secondary school', 'Bachelor\'s Degree', 'Master\'s Degree', 'PhD'].map((level) => (
<div key={level}>
<input
type="radio"
name="education_level"
value={level.toLowerCase()}
checked={formData.education_level === level.toLowerCase()}
onChange={handleInputChange}
/> {level}
</div>
))}
</div>

<div className='flex flex-col w-52 space-y-3'>
<label htmlFor="Gender" className={isDarkMode ? 'text-white' : 'text-gray-800'}>What's your current education level?</label>
<select
name="currentEducationLevel"
value={formData.currentEducationLevel}
onChange={handleInputChange}
className={`rounded-md py-2 px-2 w-full ${
isDarkMode ? ' bg-[#56C870] text-black':'bg-blue-500 text-white'
}`}
>
<option value="">Education level</option>
<option value="highschool">Highschool</option>
<option value="university">University</option>
<option value="masters">Masters</option>
<option value="phd">PhD candidate</option>
</select>
</div>
</>
);
};

export default EducationSection;
149 changes: 149 additions & 0 deletions src/components/Location.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
import React from 'react';
import InputField from './form/InputField';

interface FormData {
gender: string;
birth_date: string;
address: string;
phone: string;
study: string;
education_level: string;
currentEducationLevel: string;
nationality: string;
province: string;
district: string;
sector: string;
discipline: string;
isEmployed: string;
haveLaptop: string;
isStudent: string;
applicationPost: string;
andelaPrograms: string;
understandTraining: string;
otherApplication: string;
otherPrograms: string;
}

export interface Country {
name: string;
code: string;
phone: string;
suffix: string;
}

interface LocationSectionProps {
formData: FormData;
handleInputChange: (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
selectedCountry: string;
handleCountryChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
filteredCountries: Country[];
isDarkMode: boolean;
}

const LocationSection: React.FC<LocationSectionProps> = ({
formData,
handleInputChange,
selectedCountry,
handleCountryChange,
filteredCountries,
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 (
<>
<InputField
name="nationality"
placeholder="Nationality"
label='Nationality'
list="countries"
value={selectedCountry}
onChange={handleCountryChange}
className={inputClassName}
/>
<datalist id="countries">
{filteredCountries.map((country) => (
<option key={country.code} value={country.name} />
))}
</datalist>

<InputField
name="province"
placeholder="Province"
label='Province'
type="text"
value={formData.province}
onChange={handleInputChange}
className={inputClassName}
/>

<InputField
name="district"
placeholder="District"
label='District'
type="text"
value={formData.district}
onChange={handleInputChange}
className={inputClassName}
/>

<InputField
name="sector"
placeholder="Sector"
label='Sector'
type="text"
value={formData.sector}
onChange={handleInputChange}
className={inputClassName}
/>

<InputField
name="birth_date"
placeholder="Date of birth"
label='Choose date'
type="date"
value={formData.birth_date}
onChange={handleInputChange}
className={inputClassName}
/>

<div className='space-y-3'>
<label htmlFor="Gender" className={isDarkMode ? 'text-white' : 'text-gray-800'}>Gender</label>
<div>
<input
type="radio"
name="gender"
value="male"
checked={formData.gender === "male"}
onChange={handleInputChange}
/> Male
</div>
<div>
<input
type="radio"
name="gender"
value="female"
checked={formData.gender === "female"}
onChange={handleInputChange}
/> Female
</div>
</div>

<div className='flex flex-col w-52 space-y-3'>
<label htmlFor="discipline" className={isDarkMode ? 'text-white' : 'text-gray-800'}>What's your discipline?(if applicable)</label>
<textarea
name="discipline"
value={formData.discipline}
onChange={handleInputChange}
className={`py-5 rounded-md ${isDarkMode ? 'bg-dark-bg text-white border border-white' : 'border border-gray-500 bg-white text-gray-900'}`}
></textarea>
</div>
</>
);
};

export default LocationSection;
Loading

0 comments on commit e019aab

Please sign in to comment.