From 3bb840a2ff8cc29faacb1301af1effb6e0139de9 Mon Sep 17 00:00:00 2001 From: FLucasF Date: Tue, 10 Dec 2024 21:53:03 -0300 Subject: [PATCH] adicionando o .env --- {public => src}/assets/tutorial/acertando_quiz.png | Bin {public => src}/assets/tutorial/errando_quiz.png | Bin {public => src}/assets/tutorial/feedback.png | Bin {public => src}/assets/tutorial/final_quiz.png | Bin .../assets/tutorial/mais_informacoes.png | Bin {public => src}/assets/tutorial/navbar.png | Bin src/data/questions.json | 3 +-- src/pages/InformacaoUsuario/InformacaoUsuario.jsx | 2 +- src/pages/Quiz/Quiz.jsx | 2 +- src/pages/Tutorial/Tutorial.jsx | 13 ++++++------- vite.config.js | 12 +++++++----- 11 files changed, 16 insertions(+), 16 deletions(-) rename {public => src}/assets/tutorial/acertando_quiz.png (100%) rename {public => src}/assets/tutorial/errando_quiz.png (100%) rename {public => src}/assets/tutorial/feedback.png (100%) rename {public => src}/assets/tutorial/final_quiz.png (100%) rename {public => src}/assets/tutorial/mais_informacoes.png (100%) rename {public => src}/assets/tutorial/navbar.png (100%) diff --git a/public/assets/tutorial/acertando_quiz.png b/src/assets/tutorial/acertando_quiz.png similarity index 100% rename from public/assets/tutorial/acertando_quiz.png rename to src/assets/tutorial/acertando_quiz.png diff --git a/public/assets/tutorial/errando_quiz.png b/src/assets/tutorial/errando_quiz.png similarity index 100% rename from public/assets/tutorial/errando_quiz.png rename to src/assets/tutorial/errando_quiz.png diff --git a/public/assets/tutorial/feedback.png b/src/assets/tutorial/feedback.png similarity index 100% rename from public/assets/tutorial/feedback.png rename to src/assets/tutorial/feedback.png diff --git a/public/assets/tutorial/final_quiz.png b/src/assets/tutorial/final_quiz.png similarity index 100% rename from public/assets/tutorial/final_quiz.png rename to src/assets/tutorial/final_quiz.png diff --git a/public/assets/tutorial/mais_informacoes.png b/src/assets/tutorial/mais_informacoes.png similarity index 100% rename from public/assets/tutorial/mais_informacoes.png rename to src/assets/tutorial/mais_informacoes.png diff --git a/public/assets/tutorial/navbar.png b/src/assets/tutorial/navbar.png similarity index 100% rename from public/assets/tutorial/navbar.png rename to src/assets/tutorial/navbar.png diff --git a/src/data/questions.json b/src/data/questions.json index 65ae82d..8ef861d 100644 --- a/src/data/questions.json +++ b/src/data/questions.json @@ -160,5 +160,4 @@ "correct": "Desconfiar de perfis com informações incompletas" } -] - +] \ No newline at end of file diff --git a/src/pages/InformacaoUsuario/InformacaoUsuario.jsx b/src/pages/InformacaoUsuario/InformacaoUsuario.jsx index 9f9819f..be4aa5d 100644 --- a/src/pages/InformacaoUsuario/InformacaoUsuario.jsx +++ b/src/pages/InformacaoUsuario/InformacaoUsuario.jsx @@ -6,7 +6,7 @@ import styles from './InformacaoUsuario.module.css'; const InformacaoUsuario = () => { const [userID, setUserID] = useState(''); const navigate = useNavigate(); - const API_URL = 'https://activities.a4s.dev.br/api/user'; + const API_URL = import.meta.env.VITE_API_USER_URL; const handleSubmit = async (e) => { e.preventDefault(); diff --git a/src/pages/Quiz/Quiz.jsx b/src/pages/Quiz/Quiz.jsx index f9c588a..d92dd47 100644 --- a/src/pages/Quiz/Quiz.jsx +++ b/src/pages/Quiz/Quiz.jsx @@ -31,7 +31,7 @@ const Quiz = () => { const saveResponseQuestion = async (response) => { try { - const result = await axios.post('https://activities.a4s.dev.br/api/response', response); + const result = await axios.post(import.meta.env.VITE_API_RESPONSE_URL, response); return result.data; } catch (error) { console.error('Error saving response:', error); diff --git a/src/pages/Tutorial/Tutorial.jsx b/src/pages/Tutorial/Tutorial.jsx index cb218b4..2dc6097 100644 --- a/src/pages/Tutorial/Tutorial.jsx +++ b/src/pages/Tutorial/Tutorial.jsx @@ -1,12 +1,11 @@ import React from 'react'; import styles from './Tutorial.module.css'; - -import acertando from '../../../public/assets/tutorial/acertando_quiz.png'; -import errando from '../../../public/assets/tutorial/errando_quiz.png'; -import feedback from '../../../public/assets/tutorial/feedback.png'; -import maisInformacoes from '../../../public/assets/tutorial/mais_informacoes.png'; -import finalQuiz from '../../../public/assets/tutorial/final_quiz.png'; -import navbar from '../../../public/assets/tutorial/navbar.png' +import acertando from '../../assets/tutorial/acertando_quiz.png'; +import errando from '../../assets/tutorial/errando_quiz.png'; +import feedback from '../../assets/tutorial/feedback.png'; +import maisInformacoes from '../../assets/tutorial/mais_informacoes.png'; +import finalQuiz from '../../assets/tutorial/final_quiz.png'; +import navbar from '../../assets/tutorial/navbar.png'; const Tutorial = () => { return ( diff --git a/vite.config.js b/vite.config.js index 8034288..aaa8b7c 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,9 +1,11 @@ -import { defineConfig } from 'vite' -import react from '@vitejs/plugin-react' +import { defineConfig } from 'vite'; +import react from '@vitejs/plugin-react'; // https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], - base: "/EviteOgolpeWEB/" - -}) + base: "/EviteOgolpeWEB/", + define: { + 'process.env': {}, // Garante compatibilidade com algumas dependências que usam `process.env` + }, +});