From 0eba8eda8adaf6431ed265d98096d6a3ad4f65dc Mon Sep 17 00:00:00 2001 From: David Morales Date: Fri, 9 Dec 2022 00:05:55 -0500 Subject: [PATCH 1/2] app interview --- commons/Aside.jsx | 37 + commons/Nav.jsx | 33 + commons/index.js | 2 + components/Accordion.jsx | 31 + components/DatePicker.jsx | 21 + components/FormProfile.jsx | 108 ++ components/FormTask.jsx | 41 + components/OptionsMenu.jsx | 82 + components/Tables.jsx | 50 + components/index.js | 6 + db.json | 149 +- hooks/index.js | 2 + hooks/useFetch.js | 36 + hooks/useForm.js | 29 + layout/MainLayout.jsx | 15 + layout/index.js | 1 + package-lock.json | 2789 +++++++++++++++++++++++++++++- package.json | 12 +- pages/_app.js | 14 + pages/index.jsx | 38 +- pages/profile/[id]/edit.jsx | 134 ++ pages/profile/[id]/index.jsx | 140 ++ pages/profile/new.jsx | 117 ++ pages/tasks/[id]/edit.jsx | 134 ++ pages/tasks/new.jsx | 132 ++ services/People.js | 28 + services/Tasks.js | 40 + styles/app.scss | 511 ++++++ utils/columnsList.js | 147 ++ utils/handleDateCheckbox.js | 10 + utils/index.js | 3 + utils/load-abort-axios.helper.js | 4 + 32 files changed, 4776 insertions(+), 120 deletions(-) create mode 100644 commons/Aside.jsx create mode 100644 commons/Nav.jsx create mode 100644 commons/index.js create mode 100644 components/Accordion.jsx create mode 100644 components/DatePicker.jsx create mode 100644 components/FormProfile.jsx create mode 100644 components/FormTask.jsx create mode 100644 components/OptionsMenu.jsx create mode 100644 components/Tables.jsx create mode 100644 components/index.js create mode 100644 hooks/index.js create mode 100644 hooks/useFetch.js create mode 100644 hooks/useForm.js create mode 100644 layout/MainLayout.jsx create mode 100644 layout/index.js create mode 100644 pages/_app.js create mode 100644 pages/profile/[id]/edit.jsx create mode 100644 pages/profile/[id]/index.jsx create mode 100644 pages/profile/new.jsx create mode 100644 pages/tasks/[id]/edit.jsx create mode 100644 pages/tasks/new.jsx create mode 100644 services/People.js create mode 100644 services/Tasks.js create mode 100644 styles/app.scss create mode 100644 utils/columnsList.js create mode 100644 utils/handleDateCheckbox.js create mode 100644 utils/index.js create mode 100644 utils/load-abort-axios.helper.js diff --git a/commons/Aside.jsx b/commons/Aside.jsx new file mode 100644 index 0000000..b6a5090 --- /dev/null +++ b/commons/Aside.jsx @@ -0,0 +1,37 @@ +//import next functions +import Link from "next/link"; + +//import mui components +import { Avatar } from "@mui/material"; + +//import icons +import { FaUsers } from "react-icons/fa"; + +export const Aside = () => { + return ( + + ); +}; diff --git a/commons/Nav.jsx b/commons/Nav.jsx new file mode 100644 index 0000000..0553173 --- /dev/null +++ b/commons/Nav.jsx @@ -0,0 +1,33 @@ +// import mui components +import { Avatar, IconButton } from "@mui/material"; + +//import icons +import { FaUsers } from "react-icons/fa"; +import { IoMdNotifications } from "react-icons/io"; + +export const Nav = () => { + return ( + + ); +}; diff --git a/commons/index.js b/commons/index.js new file mode 100644 index 0000000..937be7f --- /dev/null +++ b/commons/index.js @@ -0,0 +1,2 @@ +export * from './Aside'; +export * from './Nav'; diff --git a/components/Accordion.jsx b/components/Accordion.jsx new file mode 100644 index 0000000..095a59a --- /dev/null +++ b/components/Accordion.jsx @@ -0,0 +1,31 @@ +//import mui component +import { DatePicker } from "./DatePicker"; + +//import icons +import { BsArrowDownCircleFill, BsArrowUpCircleFill } from "react-icons/bs"; + +export const Accordion = ({ + dateValue, + setDateValue, + setAccordion, + accordion, +}) => { + return ( +
+ {accordion ? ( + + ) : ( + + )} + {accordion && ( +
+ +
+ )} +
+ ); +}; diff --git a/components/DatePicker.jsx b/components/DatePicker.jsx new file mode 100644 index 0000000..061c907 --- /dev/null +++ b/components/DatePicker.jsx @@ -0,0 +1,21 @@ +//import mui components +import TextField from "@mui/material/TextField"; +import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs"; +import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider"; +import { StaticDatePicker } from "@mui/x-date-pickers/StaticDatePicker"; + +export const DatePicker = ({ date, setDate }) => { + return ( + + { + setDate(newValue); + }} + renderInput={(params) => } + /> + + ); +}; diff --git a/components/FormProfile.jsx b/components/FormProfile.jsx new file mode 100644 index 0000000..bd506ae --- /dev/null +++ b/components/FormProfile.jsx @@ -0,0 +1,108 @@ +export const FormProfile = ({ onChange, handleSubmit, fields }) => { + const { + fullName, + occupation, + email, + phone, + city, + picture, + age, + gender, + description, + } = fields; + + return ( +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+ +