Skip to content

Commit

Permalink
feat initial cards
Browse files Browse the repository at this point in the history
  • Loading branch information
joannestephany committed Dec 16, 2024
1 parent d791b61 commit 11047ff
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions src/Pages/InitialPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,7 @@ const InitialPage = () => {
) as PropsAplicationContext;

const [dates, setDates] = useState<Nullable<(Date | null)[]>>(null);
const [formattedDates, setFormattedDates] = useState<{
start: string;
end: string;
}>({
start: "",
end: "",
});

const [ts, setTs] = useState<number | undefined>();
const [chartData, setChartData] = useState<any>(null);

Expand All @@ -91,8 +85,6 @@ const InitialPage = () => {
const start = formatDate(dates[0]);
const end = formatDate(dates[1]);

setFormattedDates({ start, end });

const fetchData = async () => {
try {
const response = await requestChartMatriculated(start, end);
Expand Down Expand Up @@ -152,11 +144,16 @@ const InitialPage = () => {
title={`Bem vindo, ${propsAplication.user?.name}!`}
description="Visualização dos dados gerais do meuBen."
>

<Row id="space-between" style={{width: "100%"}}>
{/* todo: deixar a barra com o tamanho maior */}
{propsAplication.project && (
<Row id="end">
<Row
id="space-between"
style={{
width: "100%",
display: "flex",
alignItems: "center",
}}
>
{propsAplication.project && (
<Row id="end" style={{ flex: 1, marginRight: "10px" }}>
<DropdownComponent
options={[
...propsAplication.project,
Expand All @@ -171,7 +168,7 @@ const InitialPage = () => {
</Row>
)}
{propsAplication.user?.role === ROLE.ADMIN && (
<Row id="end">
<Row id="end">
<Button
label="Baixar CSV"
icon="pi pi-download"
Expand All @@ -180,7 +177,6 @@ const InitialPage = () => {
/>
</Row>
)}

</Row>

<Padding padding="16px" />
Expand Down

0 comments on commit 11047ff

Please sign in to comment.