diff --git a/cv-project/.eslintrc.cjs b/cv-project/.eslintrc.cjs index 3e212e1..d5a5d48 100644 --- a/cv-project/.eslintrc.cjs +++ b/cv-project/.eslintrc.cjs @@ -2,20 +2,21 @@ module.exports = { root: true, env: { browser: true, es2020: true }, extends: [ - 'eslint:recommended', - 'plugin:react/recommended', - 'plugin:react/jsx-runtime', - 'plugin:react-hooks/recommended', + "eslint:recommended", + "plugin:react/recommended", + "plugin:react/jsx-runtime", + "plugin:react-hooks/recommended", ], - ignorePatterns: ['dist', '.eslintrc.cjs'], - parserOptions: { ecmaVersion: 'latest', sourceType: 'module' }, - settings: { react: { version: '18.2' } }, - plugins: ['react-refresh'], + ignorePatterns: ["dist", ".eslintrc.cjs"], + parserOptions: { ecmaVersion: "latest", sourceType: "module" }, + settings: { react: { version: "18.2" } }, + plugins: ["react-refresh"], rules: { - 'react/jsx-no-target-blank': 'off', - 'react-refresh/only-export-components': [ - 'warn', + "react/prop-types": "off", + "react/jsx-no-target-blank": "off", + "react-refresh/only-export-components": [ + "warn", { allowConstantExport: true }, ], }, -} +}; diff --git a/cv-project/src/components/educationInfo.jsx b/cv-project/src/components/educationInfo.jsx index 53fee41..7741ba1 100644 --- a/cv-project/src/components/educationInfo.jsx +++ b/cv-project/src/components/educationInfo.jsx @@ -1,42 +1,102 @@ import { useState } from "react"; export default function EducationInfo() { + const [education, setEducation] = useState([]); + const [educationItemActive, setEducationItemActive] = useState(false); + + return ( +
+ {education.length <= 0 ? ( + <> +

Add your Education info

+ + ) : ( + + )} + + +
+ ); +} + +function EducationDisplay(props) { + return ( +
+ {props.schools.map((item) => { + return ( +
+

School: {item.school}

+

+ Graduation Date: {item.graduation + " "} + Field of Study: {item.concentration} + + +

+
+ ); + })} +
+ ); +} + +function EducationItem({ isActive, schools, setSchools }) { const [graduationDate, setGraduationDate] = useState(""); const [schoolName, setSchoolName] = useState(""); const [fieldOfStudy, setFieldOfStudy] = useState(""); return (
-
- setSchoolName(e.target.value)} - /> - setGraduationDate(e.target.value)} - /> - setFieldOfStudy(e.target.value)} - /> - -
-
-

School: {schoolName}

-

- Graduation Date: {graduationDate} -
Field of Study: {fieldOfStudy} -

- - -
+ {isActive ? ( +
+ setSchoolName(e.target.value)} + /> + setGraduationDate(e.target.value)} + /> + setFieldOfStudy(e.target.value)} + /> + +
+ ) : null}
); }