Skip to content

Commit

Permalink
fix: qr
Browse files Browse the repository at this point in the history
  • Loading branch information
baynt1 committed Sep 12, 2024
1 parent cf8aa07 commit bd31613
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 36 deletions.
3 changes: 3 additions & 0 deletions src/entities/dashboard/payment-data/model/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ export interface IColumnPayments {
date: string
post: string
sum: number
id: number
status: string
type: string
}
37 changes: 2 additions & 35 deletions src/entities/dashboard/payment-data/payment-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { TableProps } from 'antd'
import { useNotify } from 'app/providers/app'
import { IColumnPayments } from 'entities/dashboard/payment-data/model/interface'
import { IPostsResponse } from 'entities/settings/posts-table/model/interface'
import { useEffect, useState } from 'react'
import React, { useEffect, useState } from 'react'
import { getAxiosInstance } from 'shared/api/api-query/api-query'
import { setPaymentsState } from 'shared/redux/dashboard/dashboard-slice'
import { useAppDispatch } from 'shared/redux/store'
Expand Down Expand Up @@ -41,38 +41,5 @@ export const usePaymentData = () => {
fetchPosts()
}, [])

const columns: TableProps<IColumnPayments>['columns'] = [
{
title: 'Платеж №',
dataIndex: 'id',
key: 'id',
},
{
title: 'Статус',
dataIndex: 'status',
key: 'status',
},
{
title: 'Тип',
dataIndex: 'type',
key: 'type',
},
{
title: 'Дата',
dataIndex: 'date',
key: 'date',
},
{
title: 'Пост',
dataIndex: 'post',
key: 'post',
},
{
title: 'Сумма',
dataIndex: 'sum',
key: 'sum',
},
]

return { fetchData, columns, postSelect }
return { fetchData, postSelect }
}
3 changes: 3 additions & 0 deletions src/entities/dashboard/table-data/model/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ export interface ITablePaymentsState {
date: string
post: string
sum: number
id: number
status: string
type: string
}
49 changes: 48 additions & 1 deletion src/pages/dashboard/dashboard.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,60 @@
import { TableProps } from 'antd'
import { usePaymentData } from 'entities/dashboard/payment-data'
import { IColumnPayments } from 'entities/dashboard/payment-data/model/interface'
import { useTableData } from 'entities/dashboard/table-data'
import { DashboardCharts } from 'pages/dashboard/ui/dashboard-charts'
import { DashboardFilters } from 'pages/dashboard/ui/dashboard-filters'
import { DashboardPayment } from 'pages/dashboard/ui/dashboard-payment'
import React, { FC } from 'react'

export const Dashboard: FC = () => {
const { fetchData, columns, postSelect } = usePaymentData()
const { fetchData, postSelect } = usePaymentData()
const { paymentTable, paymentTableSum, totalPaymentTable } = useTableData()
const columns: TableProps<IColumnPayments>['columns'] = [
{
title: 'Платеж №',
dataIndex: 'id',
key: 'id',
},
{
title: 'Статус',
dataIndex: 'status',
key: 'status',
},
{
title: 'Тип',
dataIndex: 'type',
key: 'type',
},
{
title: 'Дата',
dataIndex: 'date',
key: 'date',
},
{
title: 'Пост',
dataIndex: 'post',
key: 'post',
},
{
title: 'Сумма',
dataIndex: 'sum',
key: 'sum',
},
{
title: 'Qr-код',
key: 'qr',
render: (_, record) => (
<a
href={`https://kaspi.kz/pay/GrandS?service_id=8248&12789=${record.id}`}
target={'_blank'}
rel='noreferrer'
>
Показать
</a>
),
},
]

return (
<>
Expand Down

0 comments on commit bd31613

Please sign in to comment.