From b257c1e1d4c1e818241733bba9797b6c8a7dedd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabr=C3=ADcia=20Resende?= Date: Wed, 27 Sep 2023 17:45:07 -0300 Subject: [PATCH] Calculadora Final --- src/Components/Activity/index.jsx | 163 ------ src/Components/Calculator/style.ts | 2 +- src/Components/ErrorMessage/index.tsx | 24 - src/Components/ErrorMessage/style.ts | 49 -- .../Feedback/Note/ButtonNote/index.tsx | 21 - .../Feedback/Note/ButtonNote/style.ts | 24 - src/Components/Feedback/Note/index.tsx | 46 -- src/Components/Feedback/Note/style.ts | 29 - src/Components/Feedback/index.tsx | 553 ------------------ src/Components/Feedback/style.ts | 66 --- src/Components/Layout/index.tsx | 37 -- src/Components/Login/index.jsx | 10 - src/Components/Reports/Answers/index.jsx | 118 ---- src/Components/Subtract/style.ts | 7 +- src/Pages/Home/index.tsx | 20 - src/Style/GlobalStyles.ts | 30 +- src/assets/images/Group 56.png | Bin 0 -> 69425 bytes src/assets/images/SubtractParte2.png | Bin 41209 -> 50167 bytes src/assets/images/SubtractParte2s.png | Bin 0 -> 39633 bytes src/assets/images/sSubtractParte2.png | Bin 0 -> 41209 bytes 20 files changed, 30 insertions(+), 1169 deletions(-) delete mode 100644 src/Components/Activity/index.jsx delete mode 100644 src/Components/ErrorMessage/index.tsx delete mode 100644 src/Components/ErrorMessage/style.ts delete mode 100644 src/Components/Feedback/Note/ButtonNote/index.tsx delete mode 100644 src/Components/Feedback/Note/ButtonNote/style.ts delete mode 100644 src/Components/Feedback/Note/index.tsx delete mode 100644 src/Components/Feedback/Note/style.ts delete mode 100644 src/Components/Feedback/index.tsx delete mode 100644 src/Components/Feedback/style.ts delete mode 100644 src/Components/Login/index.jsx delete mode 100644 src/Components/Reports/Answers/index.jsx create mode 100644 src/assets/images/Group 56.png create mode 100644 src/assets/images/SubtractParte2s.png create mode 100644 src/assets/images/sSubtractParte2.png diff --git a/src/Components/Activity/index.jsx b/src/Components/Activity/index.jsx deleted file mode 100644 index accd12f..0000000 --- a/src/Components/Activity/index.jsx +++ /dev/null @@ -1,163 +0,0 @@ -import React, { useState } from 'react' - -import ResultComponent from '../Models' - -import imagemEspelho from '../../assets/images/imagesWord/espelho.svg'; -import imagemMeuLugar from '../../assets/images/imagesWord/meu_lugar.svg'; -import imagemInspira from '../../assets/images/imagesWord/inspira.svg'; -import imagemDescoberta from '../../assets/images/imagesWord/descoberta.svg'; -import imagemFazNegocios from '../../assets/images/imagesWord/faz_negocios.svg'; -import imagemNaJornada from '../../assets/images/imagesWord/na_jornada.svg'; -import imagemMinhaHistoria from '../../assets/images/imagesWord/minha_historia.svg'; -import imagemNaPratica from '../../assets/images/imagesWord/na_pratica.svg'; - -const atividadesPorMundo = { - "Mundo Espelho": { - atividades: [ - "Swot pessoal", - "Proposta de valor", - "Canvas", - ], - imagemUrl: imagemEspelho, - }, - "Mundo Meu Lugar": { - atividades: [ - "Identidade", - "Descrevendo meu lugar", - "Nome do meu negócio", - ], - imagemUrl: imagemMeuLugar, - }, - "Mundo Inspira": { - atividades: [ - "Pesquisando referências", - "Visitando quem faz", - "Negócio social?", - ], - imagemUrl: imagemInspira, - }, - "Mundo Descoberta": { - atividades: [ - "Como é hoje e como poderia ser?", - "Swot adaptada", - "Minha receita", - ], - imagemUrl: imagemDescoberta, - }, - "Mundo Faz Negócios": { - atividades: [ - "Game On", - "Raio-X do cliente", - "Jornada do cliente", - ], - imagemUrl: imagemFazNegocios, - }, - - "Mundo Na Jornada": { - atividades: [ - "Catalogando", - "Precificando", - "Preço na prática", - ], - imagemUrl: imagemNaJornada, - }, - - "Mundo Minha História": { - atividades: [ - "Minha história e meu negócio", - "Venda se puder", - "Minha narrativa", - ], - imagemUrl: imagemMinhaHistoria, - }, - "Mundo Na Prática": { - atividades: [ - "Plano de ação (Mvp)", - "Teste", - "Análise dos resultados", - ], - imagemUrl: imagemNaPratica, - }, -}; - -const mapeamentoAtividades = { - "Mundo Espelho": atividadesPorMundo["Mundo Espelho"].atividades, - "Mundo Meu Lugar": atividadesPorMundo["Mundo Meu Lugar"].atividades, - "Mundo Inspira": atividadesPorMundo["Mundo Inspira"].atividades, - "Mundo Descoberta": atividadesPorMundo["Mundo Descoberta"].atividades, - "Mundo Faz Negócios": atividadesPorMundo["Mundo Faz Negócios"].atividades, - "Mundo Na Jornada": atividadesPorMundo["Mundo Na Jornada"].atividades, - "Mundo Minha História": atividadesPorMundo["Mundo Minha História"].atividades, - "Mundo Na Prática": atividadesPorMundo["Mundo Na Prática"].atividades, -}; - - -const Activity = ({ questions, passar }) => { - const results = {}; - - const carregar = (dados) => { - passar(dados); - } - - for (const [category, questionList] of Object.entries(questions)) { - let result = ""; - let indicesBetween6And9 = []; - - if (questionList.some((question) => question <= 5)) { - result = atividadesPorMundo[category].atividades.join(", "); - } else { - indicesBetween6And9 = questionList - .map((question, index) => ({ value: question, index })) - .filter(({ value }) => value >= 6 && value <= 8) - .map(({ index }) => index); - - if (indicesBetween6And9.length > 0) { - result = indicesBetween6And9.map(index => atividadesPorMundo[category].atividades[index]).join(", "); - } - } - results[category] = result; - } - - - const displayResults = () => { - const resultComponents = []; - const dadosNovo = []; - - for (const [category, questionList] of Object.entries(questions)) { - if (results[category]) { - - const novoTeste = { - category: category, - activities: questionList, - result: results[category], - } - - dadosNovo.push( - novoTeste - ) - - resultComponents.push( - - ); - } - } - carregar(dadosNovo); - return resultComponents; - }; - - return ( -
- {displayResults()} -
- ); -}; - -export default Activity; \ No newline at end of file diff --git a/src/Components/Calculator/style.ts b/src/Components/Calculator/style.ts index bdc5947..eb2e1a1 100644 --- a/src/Components/Calculator/style.ts +++ b/src/Components/Calculator/style.ts @@ -9,7 +9,7 @@ export const Card = styled.div` max-width: 450px; height: auto; - // padding: 20px; + padding: 20px; margin: 0 auto; diff --git a/src/Components/ErrorMessage/index.tsx b/src/Components/ErrorMessage/index.tsx deleted file mode 100644 index 65c735a..0000000 --- a/src/Components/ErrorMessage/index.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import React from "react"; -import { ErrorMessageContainer } from "./style"; // Importe os estilos - - -interface ErrorMessageProps { - errorMessage: string | null; - type?: "error" | "confirmation"; -} - - -const ErrorMessage: React.FC = ({ errorMessage, type }) => { - if (!errorMessage) { - return null; - } - - return ( - -

{errorMessage}

-
- ); -}; - - -export default ErrorMessage; \ No newline at end of file diff --git a/src/Components/ErrorMessage/style.ts b/src/Components/ErrorMessage/style.ts deleted file mode 100644 index 18d1910..0000000 --- a/src/Components/ErrorMessage/style.ts +++ /dev/null @@ -1,49 +0,0 @@ -import styled from "styled-components"; - - -export const ErrorMessageContainer = styled.div<{ type?: "error" | "confirmation" }>` - p { - font-size: 16px; - /* Estilos comuns para ambas as mensagens */ - } - - ${({ type }) => - type === "error" && - ` - p { - color: red; - padding: 10px; - background-color: #f8d7da; - border-color:#f5c6cb - width: 100%; - border-radius:3%; - text-align: center; - - - // @media only screen and (max-width: 1070px) { - // margin-right: 70px; - // } - } - `} - - ${({ type }) => - type === "confirmation" && - ` - p { - text-align: center; - color: green; - text-align: center; - padding: 15px; - background-color: #d4edda; - border-color: #c3e6cb; - width: 35%; - border-radius: 3%; - position: absolute; - top: 0px; - /* margin: 0px 103px 30px -252px; */ - left: calc(30vw); - margin: 0px; - - } - `} -`; diff --git a/src/Components/Feedback/Note/ButtonNote/index.tsx b/src/Components/Feedback/Note/ButtonNote/index.tsx deleted file mode 100644 index 4a208e8..0000000 --- a/src/Components/Feedback/Note/ButtonNote/index.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { Button } from "./style" - -interface PropsButton { - title?: string, - onClick?: any, - active?: boolean -} - - - -const ButtonNote = ({ onClick, title, active }: PropsButton) => { - - return ( - - ) -} - - -export default ButtonNote; \ No newline at end of file diff --git a/src/Components/Feedback/Note/ButtonNote/style.ts b/src/Components/Feedback/Note/ButtonNote/style.ts deleted file mode 100644 index c46f6b3..0000000 --- a/src/Components/Feedback/Note/ButtonNote/style.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { styled } from "styled-components"; - -interface PropsButton { - active?: boolean -} - -export const Button = styled.div` - border-radius: 5.357px; - border: 3px solid ${props => props.active ? "black" : "#83C2E2"}; - background: ${props => props.active ? "aliceblue" : "#FFF"}; - font-weight: ${props => props.active ? "bold" : "normal"}; - display: flex; - flex-direction: row; - width: 25.446px; - height: 25px; - padding: 7.143px 10.714px; - justify-content: center; - gap: 1.786px; - flex-shrink: 0; - cursor: url("/cursor_header.png"), pointer; - &:hover{ - background-color: aliceblue; - } -`; \ No newline at end of file diff --git a/src/Components/Feedback/Note/index.tsx b/src/Components/Feedback/Note/index.tsx deleted file mode 100644 index 7616c49..0000000 --- a/src/Components/Feedback/Note/index.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import { Padding, RowResponse } from "../../../Style/GlobalStyles"; -import ButtonNote from "./ButtonNote"; -import { Question } from "./style"; - -interface PropsNote { - question?: string, - value?: number, - setValue?: any -} - -const Note = ({ question, setValue, value }: PropsNote) => { - - - return ( -
- - - {question} - - - - setValue(1)} title="1" /> - {/* */} - setValue(2)} title="2" /> - {/* */} - setValue(3)} title="3" /> - {/* */} - setValue(4)} title="4" /> - {/* */} - setValue(5)} title="5" /> - {/* */} - setValue(6)} title="6" /> - {/* */} - setValue(7)} title="7" /> - {/* */} - setValue(8)} title="8" /> - {/* */} - setValue(9)} title="9" /> - {/* */} - setValue(10)} title="10" /> - -
- ) -} - -export default Note; \ No newline at end of file diff --git a/src/Components/Feedback/Note/style.ts b/src/Components/Feedback/Note/style.ts deleted file mode 100644 index cb5a361..0000000 --- a/src/Components/Feedback/Note/style.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { styled } from "styled-components"; -import styles from "../../../Style"; - - -export const Question = styled.p` - color: #000; - font-family: ${styles.typography.types.inter}; - font-size: 18px; - font-style: normal; - font-weight: 500; - /* line-height: 10px; */ - /* letter-spacing: 0.05px; */ - - @media only screen and (max-width: 1070px) { - font-size: 16px; - margin: auto 46px 19px -2px; - - } - @media only screen and (max-width: 1100px) { - font-size: 14px; - } - @media only screen and (max-width: 1070px) { - text-align: center; - margin-right: 1px; - margin-top: 15px; - } - - -`; \ No newline at end of file diff --git a/src/Components/Feedback/index.tsx b/src/Components/Feedback/index.tsx deleted file mode 100644 index 24b8e90..0000000 --- a/src/Components/Feedback/index.tsx +++ /dev/null @@ -1,553 +0,0 @@ -import React, { useState } from "react"; -import ErrorMessage from "../ErrorMessage"; -import { useNavigate } from "react-router-dom"; -import { - Column, - Padding, - Row, - RowResponse, -} from "../../Style/GlobalStyles"; -import Note from "./Note"; -import { - Container, - Sheet, - Title, - Title2, -} from "./style"; - -import ButtonCalculator from "../Buttons/ButtonsCalculator"; -import ButtonsNextProx from "../Buttons/ButtonsNextProx"; - -const Feedback: React.FC = () => { - const [step, setStep] = useState(1); - const [questionOne, setQuestionOne] = useState(undefined); - const [questionTwo, setQuestionTwo] = useState(undefined); - const [questionThree, setQuestionThree] = useState(undefined); - const [questionFour, setQuestionFour] = useState(undefined); - const [questionFive, setQuestionFive] = useState(undefined); - const [questionSix, setQuestionSix] = useState(undefined); - const [questionSeven, setQuestionSeven] = useState(undefined); - const [questionEight, setQuestionEight] = useState(undefined); - const [questionNine, setQuestionNine] = useState(undefined); - const [questionTen, setQuestionTen] = useState(undefined); - const [questionEleven, setQuestionEleven] = useState(undefined); - const [questionTwelve, setQuestionTwelve] = useState(undefined); - const [questionThirteen, setQuestionThirteen] = useState(undefined); - const [questionFourteen, setQuestionFourteen] = useState(undefined); - const [questionFiveteen, setQuestionFiveteen] = useState(undefined); - const [questionSixteen, setQuestionSixteen] = useState(undefined); - const [questionSeventeen, setQuestionSeventeen] = useState(undefined); - const [questionEighteen, setQuestionEighteen] = useState(undefined); - const [questionNineteen, setQuestionNineteen] = useState(undefined); - const [questionTwenty, setQuestionTwenty] = useState(undefined); - const [questionTwentyOne, setQuestionTwentyOne] = useState(undefined); - const [questionTwentyTwo, setQuestionTwentyTwo] = useState(undefined); - const [questionTwentyThree, setQuestionTwentyThree] = useState(undefined); - const [questionTwentyFour, setQuestionTwentyFour] = useState(undefined); - const [questionTwentyFive, setQuestionTwentyFive] = useState(undefined); - const [questionTwentySix, setQuestionTwentySix] = useState(undefined); - - const nome_but = "Próximo Mundo"; - const navigate = useNavigate(); - - const [errorMessage, setErrorMessage] = useState(null); - const [messageType, setMessageType] = useState("error"); // Inicialize com "error" como valor padrão - - - - // Segue os botões + validação + próximas etapas - - const isStep1Valid = () => { - return ( - questionOne !== undefined && - questionTwo !== undefined && - questionThree !== undefined - ); - }; - const isStep2Valid = () => { - return ( - questionFour !== undefined && - questionFive !== undefined && - questionSix !== undefined - ); - }; - const isStep3Valid = () => { - return ( - questionSeven !== undefined && - questionEight !== undefined && - questionNine !== undefined - ); - - }; - const isStep4Valid = () => { - return ( - - questionTen !== undefined && - questionEleven !== undefined && - questionTwelve !== undefined - ); - - }; - const isStep5Valid = () => { - return ( - questionThirteen !== undefined && - questionFourteen !== undefined && - questionFiveteen !== undefined - ); - - }; - const isStep6Valid = () => { - return ( - questionSixteen !== undefined && - questionSeventeen !== undefined && - questionEighteen !== undefined - ); - - }; - const isStep7Valid = () => { - return ( - questionNineteen !== undefined && - questionTwenty !== undefined && - questionTwentyOne !== undefined - ); - - }; - const isStep8Valid = () => { - return ( - questionTwentyTwo !== undefined && - questionTwentyThree !== undefined && - questionTwentyFour !== undefined - ); - - }; - - // Analisanado os botões: - const handleNextStep = () => { - switch (step) { - case 1: - if (isStep1Valid()) { - setStep(step + 1); - setErrorMessage(null); - } else { - setErrorMessage("Por favor, preencha todos os campos antes de avançar."); - setMessageType("error"); - } - break; - case 2: - if (isStep2Valid()) { - setStep(step + 1); - setErrorMessage(null); - } else { - setErrorMessage("Por favor, preencha todos os campos antes de avançar."); - setMessageType("error"); - } - break; - case 3: - if (isStep3Valid()) { - setStep(step + 1); - setErrorMessage(null); - } else { - setErrorMessage("Por favor, preencha todos os campos antes de avançar."); - setMessageType("error"); - } - break; - case 4: - if (isStep4Valid()) { - setStep(step + 1); - setErrorMessage(null); - } else { - setErrorMessage("Por favor, preencha todos os campos antes de avançar."); - setMessageType("error"); - } - break; - case 5: - if (isStep5Valid()) { - setStep(step + 1); - setErrorMessage(null); - - } else { - setErrorMessage("Por favor, preencha todos os campos antes de avançar."); - setMessageType("error"); - } - break; - case 6: - if (isStep6Valid()) { - setStep(step + 1); - setErrorMessage(null); - - } else { - setErrorMessage("Por favor, preencha todos os campos antes de avançar."); - setMessageType("error"); - } - break; - case 7: - if (isStep7Valid()) { - setStep(step + 1); - setErrorMessage(null); - - } else { - setErrorMessage("Por favor, preencha todos os campos antes de avançar."); - setMessageType("error"); - } - break; - case 8: - if (isStep8Valid()) { - setStep(step + 1); - setErrorMessage(null); - - } else { - setErrorMessage("Por favor, preencha todos os campos antes de avançar."); - setMessageType("error"); - } - break; - // Adicione casos para as outras etapas - default: - break; - } - }; - - const handlePrevStep = () => { - setStep(step - 1); - }; - - const handleSubmit = () => { - if ( - questionTwentyFive !== undefined && - questionTwentySix !== undefined - ) { - // alert("Enviando " + questionOne + ", " + questionTwo); - setErrorMessage("Respostas enviadas com sucesso!"); - setMessageType("confirmation"); - // navigate("/tasks"); - - - setTimeout(() => { - const questionsData = getAllQuestions(); - navigate("/tasks", { state: { questions: questionsData } }); - }, 3000); // 2000 milissegundos (2 segundos) - } else { - setMessageType("error"); - setErrorMessage("Por favor, preencha todos os campos antes de avançar."); - - } - }; - - - const getAllQuestions = () => { - return { - "Mundo Espelho": [ - questionOne, - questionTwo, - questionThree, - ], - "Mundo Meu Lugar": [ - questionFour, - questionFive, - questionSix, - ], - "Mundo Inspira": [ - questionSeven, - questionEight, - questionNine, - ], - "Mundo Descoberta": [ - questionTen, - questionEleven, - questionTwelve, - ], - "Mundo Faz Negócios": [ - questionThirteen, - questionFourteen, - questionFiveteen, - ], - "Mundo Na Jornada": [ - questionSixteen, - questionSeventeen, - questionEighteen, - ], - "Mundo Minha História": [ - questionNineteen, - questionTwenty, - questionTwentyOne, - ], - "Mundo Na Prática": [ - questionTwentyTwo, - questionTwentyThree, - questionTwentyFour, - ], - }; - }; - - return ( - - {/* */} - - Autoavaliação - - - - - - - - - - - {(() => { - switch (step) { - case 1: - return "Mundo 'Espelho'"; - case 2: - return "Mundo 'Meu Lugar'"; - case 3: - return "Mundo 'Inspira'"; - case 4: - return "Mundo 'Descoberta'"; - case 5: - return "Mundo 'Faz Negócios'"; - case 6: - return "Mundo 'Na Jornada'"; - case 7: - return "Mundo 'Minha História'"; - case 8: - return "Mundo 'Na Prática'"; - case 9: - return "Mundo 'Próxima Parada'"; - default: - return ""; - } - })()} - - - {/* */} - - {/* */} - - - {step === 1 && ( - <> - - - - - - )} - {step === 2 && ( - <> - - - - - - )} - {step === 3 && ( - <> - - - - - - )} - {step === 4 && ( - <> - - - - - - )} - {step === 5 && ( - <> - - - - - - )} - {step === 6 && ( - <> - - - - - - )} - {step === 7 && ( - <> - - - - - - )} - {step === 8 && ( - <> - - - - - - )} - {step === 9 && ( - <> - Para quem ainda não tem CNPJ: - - - Para quem já tem CNPJ: - - - - - )} - - - - {/* */} - - - - - - - - - {step > 1 && step <= 9 && ( - - )} - {step > 0 && step < 9 && ( - - )} - {step === 9 && ( - <> - - - )} - - - - - - - - - - ); -}; - -export default Feedback; diff --git a/src/Components/Feedback/style.ts b/src/Components/Feedback/style.ts deleted file mode 100644 index d6fc6b7..0000000 --- a/src/Components/Feedback/style.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { styled } from "styled-components"; -import backgroundBody2 from "../../assets/images/SubtractAutoAvaliacao.png"; -import styles from "../../Style"; - - -export const Sheet = styled.div` - border-radius: 49px; - background: url(${backgroundBody2}); - background-repeat: no-repeat; - height: auto; - margin: auto; - width: 70%; - background-size: 100%; - object-fit: cover; - - @media only screen and (max-width: 1070px) { - background: #f8fae4; - width: 100%; - } -`; - -export const Title = styled.div` - font-family: ${styles.typography.types.daleRegular}; - color: #4F5683; - font-size: 45.022px; - font-style: normal; - font-weight: 400; - // line-height: 42.766px; /* 75% */ - letter-spacing: 0.285px; - - @media only screen and (max-width: 1100px) { - display: flex; - flex-direction: column; - font-size: 32px; - } - - @media only screen and (max-width: 640px) { - font-size: 28px; - text-align: center; - } -`; - -export const Title2 = styled.div` - font-family: ${styles.typography.types.daleRegular}; - color: #4F5683; - font-size: 25.022px; - font-style: normal; - font-weight: 400; - letter-spacing: 0.285px; - - @media only screen and (max-width: 1100px) { - display: flex; - flex-direction: column; - font-size: 22px; - } -`; - - - -export const Container = styled.div` - height: auto; - width: 100%; - @media only screen and (max-width: 1070px) { - width: 100%; - } -`; \ No newline at end of file diff --git a/src/Components/Layout/index.tsx b/src/Components/Layout/index.tsx index 139bf54..fd40b39 100644 --- a/src/Components/Layout/index.tsx +++ b/src/Components/Layout/index.tsx @@ -14,25 +14,6 @@ interface Props { } const Layout = ({ children, set, value }: Props) => { - const getButtonStateFromStorage = () => { - const storedState = localStorage.getItem("buttonState"); - if (storedState !== null) { - return parseInt(storedState, 10); - } - return value || 0; - }; - - useEffect(() => { - const storedButtonState = getButtonStateFromStorage(); - set(storedButtonState); - }, [set]); - - // Função para atualizar o estado do botão e armazená-lo no localStorage - const updateButtonState = (newValue: number) => { - set(newValue); - localStorage.setItem("buttonState", newValue.toString()); - }; - return (
@@ -48,24 +29,6 @@ const Layout = ({ children, set, value }: Props) => { - - <> - -