diff --git a/uniEmpleos/Dockerfile b/uniEmpleos/Dockerfile new file mode 100644 index 00000000..e1387050 --- /dev/null +++ b/uniEmpleos/Dockerfile @@ -0,0 +1,14 @@ +# Fase de construcción +FROM node:16 AS build +WORKDIR /app +COPY package.json yarn.lock ./ +RUN yarn install +COPY . ./ +RUN yarn build + +# Fase de servicio +FROM nginx:alpine +COPY --from=build /app/dist /usr/share/nginx/html +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] + diff --git a/uniEmpleos/index.html b/uniEmpleos/index.html index 27eb4f38..70d9825b 100644 --- a/uniEmpleos/index.html +++ b/uniEmpleos/index.html @@ -5,6 +5,17 @@ UniEmpleos + +
diff --git a/uniEmpleos/load-test.js b/uniEmpleos/load-test.js new file mode 100644 index 00000000..afe3073e --- /dev/null +++ b/uniEmpleos/load-test.js @@ -0,0 +1,64 @@ +import http from "k6/http" +import { sleep, check } from "k6" + +export const options = { + scenarios: { + low_load: { + executor: "constant-vus", + vus: 100, + duration: "1m", // por ejemplo, 1 minuto + gracefulStop: "30s", + }, + medium_load: { + executor: "constant-vus", + vus: 200, + duration: "1m", // por ejemplo, 1 minuto + startTime: "2m", // inicia después de que el primer escenario ha terminado + gracefulStop: "30s", + }, + high_load: { + executor: "constant-vus", + vus: 400, + duration: "1m", // por ejemplo, 1 minuto + startTime: "3m", // inicia después de que el segundo escenario ha terminado + gracefulStop: "30s", + }, + }, +} + +function login() { + const res = http.get("https://sage-palmier-936be2.netlify.app/login") + check(res, { "status was 200": (r) => r.status === 200 }) +} + +function signup() { + const res = http.get("https://sage-palmier-936be2.netlify.app/signup") + check(res, { "status was 200": (r) => r.status === 200 }) +} + +function homepage() { + const res = http.get("https://sage-palmier-936be2.netlify.app/") + check(res, { "status was 200": (r) => r.status === 200 }) +} + +export default function () { + // Genera un número aleatorio entre 1 y 3 + const randomPage = Math.floor(Math.random() * 3) + 1 + + switch (randomPage) { + case 1: + login() + break + case 2: + signup() + break + case 3: + homepage() + break + default: + homepage() + break + } + + sleep(1) +} diff --git a/uniEmpleos/package.json b/uniEmpleos/package.json index 5a8d0385..4c7b901a 100644 --- a/uniEmpleos/package.json +++ b/uniEmpleos/package.json @@ -40,7 +40,7 @@ "@storybook/addon-interactions": "^7.0.7", "@storybook/addon-links": "^7.0.7", "@storybook/blocks": "^7.0.7", - "@storybook/react": "^7.0.7", + "@storybook/react": "6.3.12", "@storybook/react-vite": "^7.0.7", "@storybook/testing-library": "^0.0.14-next.2", "@testing-library/react": "^14.0.0", diff --git a/uniEmpleos/src/App.css b/uniEmpleos/src/App.css index 81f5722d..eadae3fd 100644 --- a/uniEmpleos/src/App.css +++ b/uniEmpleos/src/App.css @@ -4,37 +4,6 @@ text-align: center; } -.logo { - height: 6em; - padding: 1.5em; - will-change: filter; - transition: filter 300ms; -} -.logo:hover { - filter: drop-shadow(0 0 2em #646cffaa); -} -.logo.react:hover { - filter: drop-shadow(0 0 2em #61dafbaa); -} - -.svg.css-tj5bde-Svg { - display: none; -} - -@keyframes logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} - -@media (prefers-reduced-motion: no-preference) { - a:nth-of-type(2) .logo { - animation: logo-spin infinite 20s linear; - } -} .card { padding: 2em; @@ -48,5 +17,5 @@ height: 100vh; width: 100vw; overflow-x: hidden; - background-color: #f1f1f1; + background-color: #fff; } diff --git a/uniEmpleos/src/Hooks/useApi.js b/uniEmpleos/src/Hooks/useApi.js index 6aea5995..b676ad98 100644 --- a/uniEmpleos/src/Hooks/useApi.js +++ b/uniEmpleos/src/Hooks/useApi.js @@ -27,7 +27,7 @@ const useApi = () => { setLoading(true) const response = await fetch(`${API_URL}/api${path}`, options) const datos = await response.json() // Recibidos - // console.log("API RESPONSE:", datos.message) + console.log("API RESPONSE:", datos) setLoading(false) setData(datos.data) diff --git a/uniEmpleos/src/components/Button/Button.jsx b/uniEmpleos/src/components/Button/Button.jsx index f1017dea..54e104ff 100644 --- a/uniEmpleos/src/components/Button/Button.jsx +++ b/uniEmpleos/src/components/Button/Button.jsx @@ -2,7 +2,13 @@ import React from "react" import PropTypes from "prop-types" import style from "./Button.module.css" -const Button = ({ label, backgroundColor, textColor, onClick, noborder }) => ( +const Button = ({ + label, + backgroundColor, + textColor, + onClick, + noborder, +}) => (
) @@ -56,13 +55,13 @@ export const Header = () => { return (
- Añadir Empleo + Perfil + Crear Empleo Mis Ofertas - Profile Chat
- +
) @@ -70,12 +69,11 @@ export const Header = () => { return (
- Vacantes - Postulantes - Perfil + Empresas + Estudiantes
- +
) diff --git a/uniEmpleos/src/components/Header/header.css b/uniEmpleos/src/components/Header/header.css index 9119e244..21ceb006 100644 --- a/uniEmpleos/src/components/Header/header.css +++ b/uniEmpleos/src/components/Header/header.css @@ -21,8 +21,6 @@ display: flex; gap: 20px; align-items: center; - position: relative; - right: 60%; } .actions a { @@ -82,7 +80,6 @@ button.buttonlogo:focus{ } .container { - max-width: 1100px; margin: 0 auto; padding: 0 15px; display: flex; @@ -180,6 +177,7 @@ button.buttonlogo:focus{ .nav-elements.active { width: 100%; + z-index: 999; } .nav-elements ul { diff --git a/uniEmpleos/src/components/HeaderHome/HeaderHome.jsx b/uniEmpleos/src/components/HeaderHome/HeaderHome.jsx new file mode 100644 index 00000000..59ea2118 --- /dev/null +++ b/uniEmpleos/src/components/HeaderHome/HeaderHome.jsx @@ -0,0 +1,54 @@ +import React, { useState } from "react" +import { FaBars, FaTimes } from "react-icons/fa" +import { LuLogOut } from "react-icons/lu" +import styles from "./HeaderHome.module.css" +import { navigate } from "../../store" + +const HeaderHome = () => { + const [showNavbar, setShowNavbar] = useState(false) + + const handleShowNavbar = () => { + setShowNavbar(!showNavbar) + } + + const renderActions = () => { + return ( +
+
+ + Iniciar Sesión + + Registrarse +
+
+ ) + } + + const handleHome = () => { + navigate("/") + } + + return ( + + ) +} + +export default HeaderHome diff --git a/uniEmpleos/src/components/HeaderHome/HeaderHome.module.css b/uniEmpleos/src/components/HeaderHome/HeaderHome.module.css new file mode 100644 index 00000000..d4b2a4e2 --- /dev/null +++ b/uniEmpleos/src/components/HeaderHome/HeaderHome.module.css @@ -0,0 +1,118 @@ +.container{ + display: flex; + align-items: center; + width: 100%; +} + +.navbar { + width: 100%; + height: 100px; + background-color: #ffffff; + position: relative; +} + +.buttonlogin { + color: #a08ae5; + border: 2px solid #a08ae5; + padding: 10px 20px; + border-radius: 10px; +} + +a.buttonlogin { + color: #a08ae5 !important; +} + +.navelements{ + margin-left: auto; + margin-right: 20px; +} + +.menuicon { + display: none; + } + +.actionlinks { + display: flex; + gap: 40px; + align-items: center; +} + + +@media (max-width: 600px){ + +.actionlinks { + flex-direction: column; + position: static; + gap: 40px; + margin-top: 40px; +} + +.menuicon { + display: block; + cursor: pointer; + margin-left: auto; + margin-right: 10px; +} + +.navelements { + position: absolute; + right: 0; + top: 90px; + background-color: #ffffff; + width: 0px; + height: calc(100vh - 60px); + transition: all 0.3s ease-in; + overflow: hidden; + margin: 0; +} + +.navelements ul { + display: flex; + justify-content: space-between; + list-style-type: none; + } + + .navelements ul li:not(:last-child) { + margin-right: 60px; + } + + .navelements ul a { + font-size: 16px; + font-weight: 400; + color: #2f234f; + text-decoration: none; + } + + .navelements ul a.active { + color: #574c4c; + font-weight: 500; + position: relative; + } + + .navelements ul a.active::after { + content: ''; + position: absolute; + bottom: -4px; + left: 0; + width: 100%; + height: 2px; + background-color: #574c4c; + } + + .navelements.active { + width: 100%; + overflow-y: hidden; + height: calc(100vh - 100px); + } + + .navelements ul { + display: flex; + flex-direction: column; + } + + .navelements ul li { + margin-right: unset; + margin-top: 22px; + } + +} \ No newline at end of file diff --git a/uniEmpleos/src/components/ImageDirectUploader/ImageDirectUploader.jsx b/uniEmpleos/src/components/ImageDirectUploader/ImageDirectUploader.jsx index 6fbe9391..9f87ad72 100644 --- a/uniEmpleos/src/components/ImageDirectUploader/ImageDirectUploader.jsx +++ b/uniEmpleos/src/components/ImageDirectUploader/ImageDirectUploader.jsx @@ -2,20 +2,41 @@ import React from "react" import PropTypes from "prop-types" import style from "./ImageDirectUploader.module.css" -const ImageDirectUploader = ({ uploader }) => ( +const ImageDirectUploader = ({ + uploader, + handleInputChange, + isSelected, + archivo, +}) => (
-
-