Skip to content

Commit

Permalink
Merge pull request #28 from unb-mds/feature/pesquisa
Browse files Browse the repository at this point in the history
📝 seção pesquisa
  • Loading branch information
joseandre25 authored Dec 2, 2023
2 parents 8dfbe26 + f80e4af commit ba4de6b
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/Layout/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const Navbar = () => {
<div className="flex space-x-4">
{/* Links de Navegação Interna com fonte mais negrito (bold) e espaço maior entre eles */}
<Link href="/" className="text-white hover:text-gray-300 text-lg font-semibold ml-4">Home</Link>
<Link href="/pesquisar" className="text-white hover:text-gray-300 text-lg font-semibold ml-4">Pesquisar</Link>
<Link href="/sobre" className="text-white hover:text-gray-300 text-lg font-semibold ml-4">Sobre</Link>
<Link
href="https://github.com/unb-mds/2023.2-LicitaX"
Expand Down
88 changes: 88 additions & 0 deletions src/components/Pages/Pesquisar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import Image from "next/image";
import { useState } from "react";

export const Pesquisar = () => {
const [assunto, setAssunto] = useState("");
const [municipio, setMunicipio] = useState("");
const [dataInicial, setDataInicial] = useState("");
const [dataFinal, setDataFinal] = useState("");

const handleSearch = async () => {
// Implemente a chamada à API usando os estados (assunto, municipio, dataInicial, dataFinal)
// Certifique-se de utilizar a URL correta da API.

try {
// Código para chamar a API aqui
} catch (error) {
console.error("Erro ao chamar a API:", error);
}
};

return (
<div className="flex">
<div className="bg-[#410c0c] w-80 h-screen p-4 text-white">
<p className="text-white font-bold text-2xl mt-4 mb-4">
Em que você tem interesse?
</p>
<p className="text-white mt-4">
Aqui você pode pesquisar sobre qualquer tema e verificar cada vez que ele foi discutido em um determinado intervalo de tempo nos diários oficiais dos municípios de Sobral e Horizonte, no Ceará.
</p>
<Image
alt="logo-unb"
width={240}
height={240}
src="https://i.pinimg.com/originals/84/a7/86/84a786798c453d6a536f31cba73e5409.png"
/>
</div>
<div className="flex flex-col items-center ml-16">
<div className="flex space-x-6 mt-10">
<input
type="text"
placeholder="Sobre o que você quer saber?"
value={assunto}
onChange={(e) => setAssunto(e.target.value)}
className="p-2 border border-gray-300 rounded"
/>
<select
value={municipio}
onChange={(e) => setMunicipio(e.target.value)}
className="p-2 border border-gray-300 rounded"
>
<option value="">Selecione o Município</option>
<option value="Sobral">Sobral (CE)</option>
<option value="Horizonte">Horizonte (CE)</option>
</select>
<div>
<label className="block text-sm font-medium text-gray-700">
Data Inicial:
</label>
<input
type="date"
value={dataInicial}
onChange={(e) => setDataInicial(e.target.value)}
className="p-2 border border-gray-300 rounded"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700">
Data Final:
</label>
<input
type="date"
value={dataFinal}
onChange={(e) => setDataFinal(e.target.value)}
className="p-2 border border-gray-300 rounded"
/>
</div>
</div>
<button
onClick={handleSearch}
className="mt-4 bg-[#410c0c] text-white p-2 rounded hover:bg-[#832929]"
style={{ width: "200px" }}
>
Pesquisar
</button>
</div>
</div>
);
};
3 changes: 2 additions & 1 deletion src/components/Pages/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export { Home } from './Home';
export { Sobre } from './Sobre';
export { Sobre } from './Sobre';
export { Pesquisar } from './Pesquisar';
12 changes: 12 additions & 0 deletions src/pages/pesquisar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Footer, Navbar } from '@/components/Layout';
import { Pesquisar } from '@/components/Pages';

const PesquisarPage = () => (
<div className="flex flex-col h-screen">
<Navbar />
<Pesquisar />
<Footer />
</div>
);

export default PesquisarPage;

0 comments on commit ba4de6b

Please sign in to comment.