diff --git a/src/App.css b/src/App.css index e564177..74a714d 100644 --- a/src/App.css +++ b/src/App.css @@ -26,3 +26,17 @@ display: none; } +@keyframes fadeIn { + from { opacity: 0; } + to { opacity: 1; } +} + +/* Стилизация общего вида select */ +select { + + -webkit-appearance: none; /* Для Chrome, Safari */ + -moz-appearance: none; /* Для Firefox */ + appearance: none; /* Для остальных браузеров */ + + position: relative; +} diff --git a/src/App.js b/src/App.js index 39d3fd0..e3dbf4b 100644 --- a/src/App.js +++ b/src/App.js @@ -3,19 +3,24 @@ import SendIcon from './img/paper-plane.png'; import { useState } from 'react'; import Message from './misc/Message'; +import SendForm from './misc/SendForm'; +import Spinner from './misc/Spinner'; +import WaitResponse from './misc/WaitResponse'; import './App.css'; function App() { const [Stage, setStage] = useState(0); const [Loading, setLoading] = useState(false); + const [GenerationProcess, setGenerationProcess] = useState(false); + const [LoadingText, setLoadingText] = useState(""); const [formData, setFormData] = useState({ name: '', work_place: '', - problem:'', - message:'' + problem: '', + message: '' }); const handleChange = (e) => { @@ -26,32 +31,47 @@ function App() { })); }; + const [messages, setMessages] = useState([]); + + const addMessage = (text, self = true) => { + const newMessage = { + id: Date.now(), // уникальный ключ для нового элемента + text: text, + self: self + }; + + setMessages(prev => [...prev, newMessage]); + }; + window.addMessage = addMessage; const handleSubmit = (e) => { e.preventDefault(); // Останавливаем стандартную отправку формы console.log('Отправленные данные:', formData); setLoading(true); - - setTimeout(()=>{ + + setTimeout(() => { setStage(1); setLoading(false); + addMessage(formData.message); + + setTimeout(() => { + addMessage("Ваш вопрос отправлен в службу поддержки. Уже подбираем варианты решения проблемы...", false); + setTimeout(() => { + setGenerationProcess(true); + }, 500); + }, 500); + + }, 500) - },300) - }; return (