Skip to content

Commit

Permalink
fix error datatable
Browse files Browse the repository at this point in the history
  • Loading branch information
karenyov committed Apr 11, 2023
1 parent a76947a commit 7cd7fb8
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 27 deletions.
9 changes: 2 additions & 7 deletions src/components/tables/DebtsAllTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,7 @@ export default function DebtsAllTable({ userId }: Props) {
{
name: "Descrição",
selector: (row: DebtDTO) => (
<Tag
size="lg"
variant="solid"
borderRadius="full"
colorScheme="secondary"
>
<Tag size="lg" variant="solid" borderRadius="full" bg="primary.700">
{row.debtDescription}
</Tag>
),
Expand Down Expand Up @@ -198,7 +193,7 @@ export default function DebtsAllTable({ userId }: Props) {
key={category.categoryId}
color="white"
bg="gray.600"
_selected={{ color: "white", bg: "secondary.500" }}
_selected={{ color: "white", bg: "primary.700" }}
>
<Text as="b">{category.description}</Text>
</Tab>
Expand Down
48 changes: 31 additions & 17 deletions src/components/tables/HistoryAllByRegisterTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import {
useTheme,
VStack,
Heading,
Center
Center,
Tag
} from "@chakra-ui/react";
import {
LineChart,
Expand Down Expand Up @@ -54,31 +55,44 @@ export default function HistoryAllByRegisterTable({ registerId }: Props) {
const columns = [
{
name: "Período",
selector: (row: HistoryDTO) => row.period,
selector: (row: HistoryDTO) => (
<Tag size="md" variant="solid" borderRadius="full" bg="primary.700">
{row.period}
</Tag>
),
},
{
name: "Crédito",
selector: (row: HistoryDTO) =>
new Intl.NumberFormat("pt-br", {
style: "currency",
currency: "BRL",
}).format(Number(row.totalDebt)),
selector: (row: HistoryDTO) => (
<Tag size="md" variant="solid" borderRadius="full" colorScheme="green">
{new Intl.NumberFormat("pt-br", {
style: "currency",
currency: "BRL",
}).format(Number(row.totalDebt))}
</Tag>
),
},
{
name: "Débito",
selector: (row: HistoryDTO) =>
new Intl.NumberFormat("pt-br", {
style: "currency",
currency: "BRL",
}).format(Number(row.totalDebt)),
selector: (row: HistoryDTO) => (
<Tag size="md" variant="solid" borderRadius="full" colorScheme="red">
{new Intl.NumberFormat("pt-br", {
style: "currency",
currency: "BRL",
}).format(Number(row.totalDebt))}
</Tag>
),
},
{
name: "Saldo",
selector: (row: HistoryDTO) =>
new Intl.NumberFormat("pt-br", {
style: "currency",
currency: "BRL",
}).format(Number(row.balanceCredit)),
selector: (row: HistoryDTO) => (
<Tag size="md" variant="solid" borderRadius="full" colorScheme="blue">
{new Intl.NumberFormat("pt-br", {
style: "currency",
currency: "BRL",
}).format(Number(row.balanceCredit))}
</Tag>
),
},
{
name: "Deletar",
Expand Down
6 changes: 3 additions & 3 deletions src/pages/debt/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export default function Debt() {
size="lg"
variant="solid"
borderRadius="full"
colorScheme="secondary"
bg="primary.700"
>
{row.debtDescription}
</Tag>
Expand Down Expand Up @@ -862,8 +862,8 @@ export default function Debt() {
<Tab
key={category.categoryId}
color="white"
bg="gray.600"
_selected={{ color: "white", bg: "primary.500" }}
bg={colorMode === "dark" ? "gray.600" : "gray.300"}
_selected={{ color: "white", bg: "primary.700" }}
>
<Text as="b">{category.description}</Text>
</Tab>
Expand Down

0 comments on commit 7cd7fb8

Please sign in to comment.