From 0e29e7dc3d249fe724df48f7cf1e02f58aa88953 Mon Sep 17 00:00:00 2001 From: jp-lima Date: Fri, 19 Sep 2025 11:24:07 -0300 Subject: [PATCH] =?UTF-8?q?melhorias=20na=20organiza=C3=A7=C3=A3o=20de=20p?= =?UTF-8?q?astas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.js | 11 +- .../AgendarConsulta/FormNovaConsulta.jsx | 22 ++-- .../AgendarConsulta/TabelaAgendamentoDia.jsx | 2 +- .../AgendarConsulta/TabelaAgendamentoMes.jsx | 3 +- .../TabelaAgendamentoSemana.jsx | 4 +- .../{ => style}/styleTabelas/tabeladia.css | 0 .../{ => style}/styleTabelas/tabelames.css | 0 .../{ => style}/styleTabelas/tabelasemana.css | 0 .../style}/styleagendamentos.css | 0 src/components/Header.js | 14 --- src/pages/ChatApp.jsx | 110 ----------------- src/pages/DataTable.jsx | 27 ----- ...rmLayout.jsx => DoctorCadastroManager.jsx} | 4 +- src/pages/EmailApp.jsx | 113 ------------------ src/pages/GalleryApp.jsx | 82 ------------- src/pages/Inicio.jsx | 2 +- ...mLayout.jsx => PatientCadastroManager.jsx} | 17 ++- src/pages/files.jsx | 84 ------------- src/pages/{ => style}/Inicio.css | 0 19 files changed, 31 insertions(+), 464 deletions(-) rename src/components/AgendarConsulta/{ => style}/styleTabelas/tabeladia.css (100%) rename src/components/AgendarConsulta/{ => style}/styleTabelas/tabelames.css (100%) rename src/components/AgendarConsulta/{ => style}/styleTabelas/tabelasemana.css (100%) rename src/components/{Estilo => AgendarConsulta/style}/styleagendamentos.css (100%) delete mode 100644 src/components/Header.js delete mode 100644 src/pages/ChatApp.jsx delete mode 100644 src/pages/DataTable.jsx rename src/pages/{DoctorFormLayout.jsx => DoctorCadastroManager.jsx} (96%) delete mode 100644 src/pages/EmailApp.jsx delete mode 100644 src/pages/GalleryApp.jsx rename src/pages/{FormLayout.jsx => PatientCadastroManager.jsx} (80%) delete mode 100644 src/pages/files.jsx rename src/pages/{ => style}/Inicio.css (100%) diff --git a/src/App.js b/src/App.js index aefbcb8..3d45098 100644 --- a/src/App.js +++ b/src/App.js @@ -1,10 +1,10 @@ import React, { useState } from 'react'; import Sidebar from './components/Sidebar'; -import Header from './components/Header'; +//import Header from './components/Header'; import Table from "./pages/Table"; import Inicio from './pages/Inicio'; -import FormLayout from './pages/FormLayout'; +import PatientCadastroManager from './pages/PatientCadastroManager'; import EditPage from './pages/EditPage'; import DoctorEditPage from './pages/DoctorEditPage'; @@ -12,10 +12,9 @@ import Details from './pages/Details'; import DoctorDetails from './pages/DoctorDetails'; import DoctorTable from './pages/DoctorTable'; -import DoctorFormLayout from './pages/DoctorFormLayout'; +import DoctorCadastroManager from './pages/DoctorCadastroManager'; import Agendamento from './pages/Agendamento' - import LaudoManager from "./pages/LaudoManager"; function App() { @@ -31,9 +30,9 @@ function App() { case 'agendamento': return ; case 'form-layout': - return ; + return ; case 'doctor-form-layout': - return ; + return ; case 'table': return ; case 'doctor-table': diff --git a/src/components/AgendarConsulta/FormNovaConsulta.jsx b/src/components/AgendarConsulta/FormNovaConsulta.jsx index b8435cc..6723e6c 100644 --- a/src/components/AgendarConsulta/FormNovaConsulta.jsx +++ b/src/components/AgendarConsulta/FormNovaConsulta.jsx @@ -1,6 +1,6 @@ import React from "react"; import InputMask from "react-input-mask"; -import "../Estilo/styleagendamentos.css"; +import "./style/styleagendamentos.css"; const FormNovaConsulta = ({ onCancel }) => { const handleSubmit = (e) => { @@ -15,19 +15,21 @@ const FormNovaConsulta = ({ onCancel }) => {

Informações do paciente

- - +
+ + - - - {(inputProps) => } - + + + {(inputProps) => } + - - + + +
- + diff --git a/src/components/AgendarConsulta/TabelaAgendamentoDia.jsx b/src/components/AgendarConsulta/TabelaAgendamentoDia.jsx index 0babdf9..5c0c0ef 100644 --- a/src/components/AgendarConsulta/TabelaAgendamentoDia.jsx +++ b/src/components/AgendarConsulta/TabelaAgendamentoDia.jsx @@ -1,7 +1,7 @@ import React from 'react' import CardConsulta from './CardConsulta' import AgendamentosMes from './DadosConsultasMock' -import "./styleTabelas/tabeladia.css"; +import "./style/styleTabelas/tabeladia.css"; const TabelaAgendamentoDia = ({handleClickAgendamento}) => { diff --git a/src/components/AgendarConsulta/TabelaAgendamentoMes.jsx b/src/components/AgendarConsulta/TabelaAgendamentoMes.jsx index 8474452..924332f 100644 --- a/src/components/AgendarConsulta/TabelaAgendamentoMes.jsx +++ b/src/components/AgendarConsulta/TabelaAgendamentoMes.jsx @@ -2,11 +2,10 @@ import React from 'react' import AgendamentosMes from './DadosConsultasMock' import dayjs from "dayjs" import CardConsulta from './CardConsulta' -import "./styleTabelas/tabelames.css"; +import "./style/styleTabelas/tabelames.css"; const TabelaAgendamentoMes = ({ListarDiasdoMes}) => { - const agendamentosMes = [0,1,2,3,4,5] const dataHoje = dayjs() const AnoAtual = dataHoje.year() diff --git a/src/components/AgendarConsulta/TabelaAgendamentoSemana.jsx b/src/components/AgendarConsulta/TabelaAgendamentoSemana.jsx index faa36fb..386864f 100644 --- a/src/components/AgendarConsulta/TabelaAgendamentoSemana.jsx +++ b/src/components/AgendarConsulta/TabelaAgendamentoSemana.jsx @@ -1,8 +1,8 @@ import React from 'react' -import Agendamento from '../../pages/Agendamento' + import AgendamentosMes from './DadosConsultasMock' import CardConsulta from './CardConsulta' -import "./styleTabelas/tabelasemana.css"; +import "./style/styleTabelas/tabelasemana.css"; const TabelaAgendamentoSemana = () => { diff --git a/src/components/AgendarConsulta/styleTabelas/tabeladia.css b/src/components/AgendarConsulta/style/styleTabelas/tabeladia.css similarity index 100% rename from src/components/AgendarConsulta/styleTabelas/tabeladia.css rename to src/components/AgendarConsulta/style/styleTabelas/tabeladia.css diff --git a/src/components/AgendarConsulta/styleTabelas/tabelames.css b/src/components/AgendarConsulta/style/styleTabelas/tabelames.css similarity index 100% rename from src/components/AgendarConsulta/styleTabelas/tabelames.css rename to src/components/AgendarConsulta/style/styleTabelas/tabelames.css diff --git a/src/components/AgendarConsulta/styleTabelas/tabelasemana.css b/src/components/AgendarConsulta/style/styleTabelas/tabelasemana.css similarity index 100% rename from src/components/AgendarConsulta/styleTabelas/tabelasemana.css rename to src/components/AgendarConsulta/style/styleTabelas/tabelasemana.css diff --git a/src/components/Estilo/styleagendamentos.css b/src/components/AgendarConsulta/style/styleagendamentos.css similarity index 100% rename from src/components/Estilo/styleagendamentos.css rename to src/components/AgendarConsulta/style/styleagendamentos.css diff --git a/src/components/Header.js b/src/components/Header.js deleted file mode 100644 index a94edc9..0000000 --- a/src/components/Header.js +++ /dev/null @@ -1,14 +0,0 @@ -import React from 'react'; - -// O componente agora recebe a função `toggleSidebar` como uma prop. -function Header({ toggleSidebar }) { - return ( -
- - - -
- ); -} - -export default Header; diff --git a/src/pages/ChatApp.jsx b/src/pages/ChatApp.jsx deleted file mode 100644 index 54d8ff5..0000000 --- a/src/pages/ChatApp.jsx +++ /dev/null @@ -1,110 +0,0 @@ -import React, { useState } from "react"; - -function ChatApp() { - const [selectedUser, setSelectedUser] = useState(1); - - const users = [ - { id: 1, name: "Alice", avatar: "https://i.pravatar.cc/40?img=1" }, - { id: 2, name: "Bob", avatar: "https://i.pravatar.cc/40?img=2" }, - { id: 3, name: "Charlie", avatar: "https://i.pravatar.cc/40?img=3" } - ]; - - const messages = { - 1: [ - { from: "Alice", text: "Oi Rafael 👋", time: "10:15" }, - { from: "Você", text: "E aí Alice, tudo bem?", time: "10:16" }, - { from: "Alice", text: "Tudo ótimo! 😄", time: "10:17" } - ], - 2: [ - { from: "Bob", text: "Fala mano!", time: "09:30" }, - { from: "Você", text: "Tranquilo Bob?", time: "09:32" }, - { from: "Bob", text: "Sempre ✌️", time: "09:33" } - ], - 3: [ - { from: "Charlie", text: "Já viu a novidade?", time: "Ontem" }, - { from: "Você", text: "Qual novidade?", time: "Ontem" }, - { from: "Charlie", text: "Te conto depois kkk 🤐", time: "Ontem" } - ] - }; - - const currentMessages = messages[selectedUser] || []; - - return ( - <> -
-

Chat Application

-

Converse em tempo real com seus contatos

-
- -
-
- {/* Sidebar - Contatos */} -
-
Contatos
-
    - {users.map((user) => ( -
  • setSelectedUser(user.id)} - > - {user.name} - {user.name} -
  • - ))} -
-
- - {/* Chat */} -
-
- {currentMessages.map((msg, index) => ( -
-
- {msg.from}: {msg.text} -
-
{msg.time}
-
- ))} -
- - {/* Caixa de mensagem */} -
- - -
-
-
-
- - ); -} - -export default ChatApp; diff --git a/src/pages/DataTable.jsx b/src/pages/DataTable.jsx deleted file mode 100644 index dd4fff7..0000000 --- a/src/pages/DataTable.jsx +++ /dev/null @@ -1,27 +0,0 @@ -import React from "react"; - -function DataTable() { - return ( - <> -
-

Data Table

-
-
-
-
-
-
-

Minha Data Table

-
-
-

Aqui você vai construir sua DataTable futuramente 🚀

-
-
-
-
-
- - ); -} - -export default DataTable; diff --git a/src/pages/DoctorFormLayout.jsx b/src/pages/DoctorCadastroManager.jsx similarity index 96% rename from src/pages/DoctorFormLayout.jsx rename to src/pages/DoctorCadastroManager.jsx index 02a9bed..3a928c4 100644 --- a/src/pages/DoctorFormLayout.jsx +++ b/src/pages/DoctorCadastroManager.jsx @@ -4,7 +4,7 @@ import React, { useState } from 'react'; import DoctorList from '../components/doctors/DoctorList'; import DoctorForm from '../components/doctors/DoctorForm'; -function FormLayout( ) { +function DoctorCadastroManager( ) { // Este estado vai controlar qual "tela" mostrar: 'list' (lista) ou 'form' (formulário) const [view, setView] = useState('form'); @@ -66,4 +66,4 @@ function FormLayout( ) { ); } -export default FormLayout; \ No newline at end of file +export default DoctorCadastroManager; \ No newline at end of file diff --git a/src/pages/EmailApp.jsx b/src/pages/EmailApp.jsx deleted file mode 100644 index 4dd64e2..0000000 --- a/src/pages/EmailApp.jsx +++ /dev/null @@ -1,113 +0,0 @@ -import React from "react"; - -function EmailApp() { - // Lista fake de emails para exibir - const emails = [ - { - id: 1, - from: "Open source project public release", - preview: "Hey John, bah kivu decrete epanorthotic unnotched...", - time: "4:14 AM", - starred: true, - avatar: "https://i.pravatar.cc/40?img=1" - }, - { - id: 2, - from: "Ecommerce website Paypal integration", - preview: "We will start the new application development soon...", - time: "2:15 AM", - starred: false, - avatar: "https://i.pravatar.cc/40?img=2" - }, - { - id: 3, - from: "How To Set Intentions That Energize You", - preview: "I will provide you more details after this Saturday...", - time: "Yesterday", - starred: false, - avatar: "https://i.pravatar.cc/40?img=3" - } - ]; - - return ( - <> -
-

Email Application

-

An application for user to check email inbox

-
- -
-
- {/* Sidebar */} -
- -
    -
  • 📥 Inbox
  • -
  • 📤 Sent
  • -
  • 📝 Draft
  • -
  • ⭐ Starred
  • -
  • 🚫 Spam
  • -
  • 🗑 Trash
  • -
- -
Labels
-
    -
  • 🏷 Product
  • -
  • 💼 Work
  • -
  • 📌 Misc
  • -
  • 👨‍👩‍👧 Family
  • -
  • 🎨 Design
  • -
-
- - {/* Emails */} -
-
-
- - - - -
- -
- -
- {emails.map((mail) => ( -
-
- - avatar -
- {mail.from} -

{mail.preview}

-
-
-
- {mail.starred ? "⭐" : "☆"}
- {mail.time} -
-
- ))} -
-
-
-
- - ); -} - -export default EmailApp; diff --git a/src/pages/GalleryApp.jsx b/src/pages/GalleryApp.jsx deleted file mode 100644 index 8a004b0..0000000 --- a/src/pages/GalleryApp.jsx +++ /dev/null @@ -1,82 +0,0 @@ -import React, { useState } from "react"; - -function GalleryApp() { - const [photos, setPhotos] = useState([ - { id: 1, url: "https://picsum.photos/400/300?random=7", title: "Paisagem 1" }, - /*{url da fotos },*/ - /*{url da fotos },*/ - /*{url da fotos },*/ - /*{url da fotos },*/ - /*{url da fotos },*/ - ]); - - const [selectedPhoto, setSelectedPhoto] = useState(null); - - return ( -
-
-

Galeria de Fotos

-
- - {/* Grade de fotos */} -
- {photos.map((photo) => ( -
-
setSelectedPhoto(photo)}> - {photo.title} -
-
{photo.title}
-
-
-
- ))} -
- - {/* Modal de visualização */} - {selectedPhoto && ( -
setSelectedPhoto(null)} - > -
e.stopPropagation()} - > - {selectedPhoto.title} -
{selectedPhoto.title}
- -
-
- )} -
- ); -} - -export default GalleryApp; diff --git a/src/pages/Inicio.jsx b/src/pages/Inicio.jsx index e5105ef..543650d 100644 --- a/src/pages/Inicio.jsx +++ b/src/pages/Inicio.jsx @@ -1,6 +1,6 @@ import React, { useState, useEffect } from 'react'; import { FaUser, FaUserPlus, FaCalendarAlt, FaCalendarCheck } from 'react-icons/fa'; -import './Inicio.css'; +import './style/Inicio.css'; function Inicio({ setCurrentPage }) { const [pacientes, setPacientes] = useState([]); diff --git a/src/pages/FormLayout.jsx b/src/pages/PatientCadastroManager.jsx similarity index 80% rename from src/pages/FormLayout.jsx rename to src/pages/PatientCadastroManager.jsx index 4383d3d..7653975 100644 --- a/src/pages/FormLayout.jsx +++ b/src/pages/PatientCadastroManager.jsx @@ -1,12 +1,12 @@ import React, { useState } from 'react'; // Importamos os dois novos componentes que criamos -import PatientList from '../components/patients/PatientList'; + import PatientForm from '../components/patients/PatientForm'; -function FormLayout( ) { +function PatientCadastroManager( {setCurrentPage} ) { // Este estado vai controlar qual "tela" mostrar: 'list' (lista) ou 'form' (formulário) - const [view, setView] = useState('form'); + const [formData, setFormData] = useState({}) var myHeaders = new Headers(); @@ -33,7 +33,7 @@ function FormLayout( ) { alert(`Paciente "${patientData.nome}" salvo com sucesso!`); //altere isso para integração com backend // Após salvar, voltamos para a tela de lista - setView('list'); + }; return ( @@ -48,16 +48,13 @@ function FormLayout( ) { {/* Se a view for 'list', mostramos a lista com o botão. */} {/* Se for 'form', mostramos o formulário de cadastro. */} - {view === 'list' ? ( - setView('form')} /> - ) : ( setView('list')} + onCancel={() => {setCurrentPage('table')}} formData={formData} setFormData={setFormData} /> - )} + @@ -65,4 +62,4 @@ function FormLayout( ) { ); } -export default FormLayout; \ No newline at end of file +export default PatientCadastroManager; \ No newline at end of file diff --git a/src/pages/files.jsx b/src/pages/files.jsx deleted file mode 100644 index a854aed..0000000 --- a/src/pages/files.jsx +++ /dev/null @@ -1,84 +0,0 @@ -import React, { useState } from "react"; - -function Files() { - // 1. Criamos um estado para armazenar o arquivo selecionado pelo usuário - const [selectedFile, setSelectedFile] = useState(null); - - // 2. Esta função é chamada quando o usuário seleciona um arquivo no input - const handleFileChange = (event) => { - // Pegamos o primeiro arquivo da lista (mesmo que só possa selecionar um) - const file = event.target.files[0]; - if (file) { - setSelectedFile(file); - } - }; - - // 3. Esta função é chamada quando o botão "Enviar Arquivo" é clicado - const handleUpload = () => { - if (!selectedFile) { - alert("Por favor, selecione um arquivo antes de enviar."); - return; - } - - // --- Lógica de Envio (Simulação) --- - // Em um projeto real, aqui você enviaria o 'selectedFile' para um servidor. - // Por enquanto, vamos apenas mostrar um alerta de sucesso. - console.log("Enviando o arquivo:", selectedFile.name); - alert(`Arquivo "${selectedFile.name}" enviado com sucesso! (Isso é uma simulação)`); - - // Limpa o estado após o envio - setSelectedFile(null); - }; - - return ( - <> -
-

Files

-
-
-
-
-
-
-

Gerenciamento de Arquivos

-
-
- {/* 4. Adicionamos o input de arquivo e o botão */} -
- - {/* O 'key' ajuda o React a resetar o input quando o arquivo é "enviado" */} - -
- - {/* Mostra o nome do arquivo selecionado */} - {selectedFile && ( -

- Arquivo selecionado: {selectedFile.name} -

- )} - - -
-
-
-
-
- - ); -} - -export default Files; \ No newline at end of file diff --git a/src/pages/Inicio.css b/src/pages/style/Inicio.css similarity index 100% rename from src/pages/Inicio.css rename to src/pages/style/Inicio.css