diff --git a/frontend/src/views/Admin/Courses/Templates/index.jsx b/frontend/src/views/Admin/Courses/Templates/index.jsx index 9d047a5..e132c54 100644 --- a/frontend/src/views/Admin/Courses/Templates/index.jsx +++ b/frontend/src/views/Admin/Courses/Templates/index.jsx @@ -5,7 +5,7 @@ import axios from 'axios'; import Styles from './Templates.module.css'; const Templates = () => { - const [error, setError] = useState(''); + const [, setError] = useState(''); const [send, setSend] = useState(false); const [data, setData] = useState({ name: '', diff --git a/frontend/src/views/Dashboard/AvailableCourses/index.jsx b/frontend/src/views/Dashboard/AvailableCourses/index.jsx index 636fea2..fc39eeb 100644 --- a/frontend/src/views/Dashboard/AvailableCourses/index.jsx +++ b/frontend/src/views/Dashboard/AvailableCourses/index.jsx @@ -26,7 +26,7 @@ const AvailableCourses = () => { } }; getData(); - }, []); + }, [dispatch]); return ( <> diff --git a/frontend/src/views/Dashboard/CourseCard/CourseCard.module.css b/frontend/src/views/Dashboard/CourseCard/CourseCard.module.css deleted file mode 100644 index 09b3f38..0000000 --- a/frontend/src/views/Dashboard/CourseCard/CourseCard.module.css +++ /dev/null @@ -1,158 +0,0 @@ -.details { - width: calc(100% - 34px); - background-color: #f5f9fb; - border: 1px solid #d1e0e7; - border-bottom: 0px; - border-radius: 4px 4px 0px 0px; - padding: 24px 16px; -} -.bookings-0 { - width: calc(100% - 22px); - background-color: #ebf3f7; - border: 1px solid #d1e0e7; - border-top: 0px; - border-radius: 0px 0px 4px 4px; - padding: 10px; -} -.bookings-1 { - width: calc(100% - 22px); - background-color: #fee6da; - border: 1px solid #d1e0e7; - color: #d83341; - border-top: 0px; - border-radius: 0px 0px 4px 4px; - padding: 7px 10px; - display: flex; - align-items: center; -} -.title { - color: #0d1e38; - font-family: 'Rubik-Bold', serif; - font-size: 20px; -} -.title2 { - color: #0d1e38; - font-family: 'Rubik-Regular', serif; - font-size: 20px; - margin-bottom: 12px; -} -.items { - display: flex; - margin-bottom: 24px; -} -.items p { - background-color: #cadbe3; - margin-right: 4px; - border-radius: 100px; - padding: 6px 12px; - color: #335065; - font-family: 'SourceSansPro-Regular', serif; - font-size: 14px; -} -.texts { - display: flex; - flex-direction: column; - row-gap: 8px; - height: 90px; -} -.text { - color: #335065; - font-family: 'SourceSansPro-Regular', serif; - font-size: 14px; -} -.text strong { - font-family: 'SourceSansPro-Bold', serif; -} -.text2 { - font-family: 'SourceSansPro-Bold', serif; - font-size: 14px; -} -.icon-alert { - width: 20px; - height: 20px; - margin-right: 10px; - margin-top: 4px; -} -.buttons { - width: 100%; - display: flex; - flex-direction: row; - justify-content: flex-end; -} -.button-details { - margin-top: 16px; - border-radius: 4px; - border: 1px solid #6254ff; - color: #ffffff; - padding: 12px 24px; - background-color: #6254ff; - margin-left: 12px; - font-family: 'SourceSansPro-SemiBold', serif; - font-size: 18px; -} -.button-details:disabled { - margin-top: 16px; - border-radius: 4px; - border: 1px solid #9f98ee; - color: #ffffff; - padding: 12px 24px; - background-color: #9f98ee; - margin-left: 12px; - font-family: 'SourceSansPro-SemiBold', serif; - font-size: 18px; -} -.button-details:enabled:hover { - cursor: pointer; -} -.button-details2 { - margin-top: 16px; - border-radius: 4px; - border: 1px solid #6254ff; - color: #6254ff; - padding: 12px 24px; - background-color: #00000000; - margin-left: 12px; - font-family: 'SourceSansPro-SemiBold', serif; - font-size: 18px; -} -.button-details2:hover { - cursor: pointer; -} -@media only screen and (max-width: 1440px) and (min-width: 1281px) { - .texts { - display: flex; - flex-direction: column; - row-gap: 8px; - height: 90px; - } - .title { - font-size: 19px; - } - .title2 { - font-size: 19px; - } -} -@media only screen and (max-width: 1280px) and (min-width: 801px) { - .texts { - display: flex; - flex-direction: column; - row-gap: 8px; - height: 100px; - } - .title { - font-size: 18.4px; - } - .title2 { - font-size: 18.4px; - } - .details { - width: calc(100% - 30px); - background-color: #f5f9fb; - border: 1px solid #d1e0e7; - border-bottom: 0px; - border-radius: 4px 4px 0px 0px; - padding: 24px 14px; - } -} -@media only screen and (max-width: 800px) { -} diff --git a/frontend/src/views/Dashboard/CourseCard/index.jsx b/frontend/src/views/Dashboard/CourseCard/index.jsx index a916c51..5fc6e3a 100644 --- a/frontend/src/views/Dashboard/CourseCard/index.jsx +++ b/frontend/src/views/Dashboard/CourseCard/index.jsx @@ -1,39 +1,55 @@ import React from 'react'; -//styles -import Styles from './CourseCard.module.css'; import { useNavigate } from 'react-router-dom'; //icons import { TbAlertTriangle } from 'react-icons/tb'; const CourseCard = ({ data, text, url, text2, url2, subscribed = true }) => { const navigate = useNavigate(); + const bookingClassName = data.extra_alert + ? 'border-[#d1e0e7] bg-[#fee6da] py-[7px] text-[#d83341]' + : 'border-[#d1e0e7] bg-[#ebf3f7] py-2.5 text-[#335065]'; + return ( - <> -
-

{data.title}

-

{data.title_second}

-

{data.title_extra}

-
-

{data.type}

-

{data.duration}

-

Nivel {data.level}

+
+
+

+ {data.title} +

+

+ {data.title_second} +

+

+ {data.title_extra} +

+
+

+ {data.type} +

+

+ {data.duration} +

+

+ Nivel {data.level} +

-
-

- Dominarás: {data.technologies} +

+

+ Dominarás:{' '} + {data.technologies}

-

- Precio: {data.price} +

+ Precio: {data.price}

-

- Inicia: Al llegar a {data.minimum} aplicaciones daremos - fecha. +

+ Inicia: Al llegar a{' '} + {data.minimum} aplicaciones daremos fecha.

-
+
{text2 && url2 && (
-
- {data.extra_alert && } -

{`${ +

+ {data.extra_alert && } +

{`${ data.extra_alert ? '¡Aplica ahora! ' : '' }Reservas confirmadas: ${data.bookings}`}

- +
); }; diff --git a/frontend/src/views/Dashboard/MyCourses/index.jsx b/frontend/src/views/Dashboard/MyCourses/index.jsx index f32c4af..8d13d98 100644 --- a/frontend/src/views/Dashboard/MyCourses/index.jsx +++ b/frontend/src/views/Dashboard/MyCourses/index.jsx @@ -1,8 +1,6 @@ import React, { useState, useEffect } from 'react'; import axios from 'axios'; import { useDispatch } from 'react-redux'; -//styles -import Styles from './../Grid.module.css'; //actions import { logOut } from './../../../redux/actions/auth'; //components @@ -23,12 +21,12 @@ const MyCourses = () => { } }; getData(); - }, []); + }, [dispatch]); return ( -
+
{listCourses.map((course) => { return ( -
+
{ address: '', linkedin_url: '' }); - const [phone, setPhone] = useState(user.phone); - const [editPhone, setEditPhone] = useState(false); const handleChangeAccount = (e) => { setAccount({ ...account, [e.target.name]: e.target.value }); }; @@ -74,29 +71,8 @@ const Setting = () => { enqueueSnackbar('500 server error', { variant: 'error' }); } }; - const handlePhone = (e) => { - setPhone(e.target.value); - }; - const handleAddPhone = async () => { - try { - const data = { - phone: phone - }; - const response = await axios.post('/api/user/add-phone', data); - if (response.data.successful) { - dispatch(updatePhone(response.data.user)); - setEditPhone(false); - enqueueSnackbar(response.data.message, { variant: 'success' }); - } else { - enqueueSnackbar(response.data.message, { variant: 'error' }); - } - } catch (error) { - enqueueSnackbar('500 server error', { variant: 'error' }); - } - }; const handleOpenPhone = () => { - setPhone(''); - setEditPhone(true); + setModalPhone(true); }; const handleOpenProfile = () => { setProfile({