Skip to content

Commit

Permalink
Merge pull request #19 from pieceowater-dev/dev
Browse files Browse the repository at this point in the history
fix: qr
  • Loading branch information
baynt1 authored Sep 12, 2024
2 parents f3ab794 + a770cdf commit f2528d5
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 24 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"preview": "vite preview"
},
"dependencies": {
"@ant-design/icons": "^5.4.0",
"@reduxjs/toolkit": "^2.2.3",
"@tanstack/react-query": "^5.29.2",
"antd": "^5.16.1",
Expand Down
4 changes: 1 addition & 3 deletions src/entities/dashboard/payment-data/payment-data.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
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 React, { useEffect, useState } from 'react'
import { 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
39 changes: 31 additions & 8 deletions src/entities/settings/posts-table/use-posts-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@ import { Space, TableProps } from 'antd'
import { useNotify } from 'app/providers/app'
import { IPostsResponse } from 'entities/settings/posts-table/model/interface'
import { IPostsTableProps } from 'pages/settings/ui/posts/model/interface'
import { useEffect, useState } from 'react'
import React, { useEffect, useState } from 'react'
import { getAxiosInstance } from 'shared/api/api-query/api-query'
import { useToggle } from 'shared/lib/hooks/use-toggle'
import { setPostsState } from 'shared/redux/settings/settings-slice'
import { useAppDispatch } from 'shared/redux/store'

import {
DeleteOutlined,
EditOutlined,
LoadingOutlined,
PauseCircleOutlined,
PlayCircleOutlined,
} from '@ant-design/icons'

export const usePostsTable = () => {
const { openNotification } = useNotify()
const dispatch = useAppDispatch()
Expand Down Expand Up @@ -92,6 +100,19 @@ export const usePostsTable = () => {
dataIndex: 'bin',
key: 'bin',
},
{
title: 'Qr-код',
key: 'qr',
render: (_, record) => (
<a
href={`https://kaspi.kz/pay/GrandS?service_id=8248&12789=${record.identifier}`}
target={'_blank'}
rel='noreferrer'
>
Показать QR
</a>
),
},
{
title: 'Действие',
key: 'action',
Expand All @@ -110,17 +131,19 @@ export const usePostsTable = () => {
handlePostModal()
}}
>
Редактировать
<EditOutlined />
</a>
<a onClick={() => (stopLoading ? null : deletePost(record.key, true))}>
{stopLoading
? 'Загрузка'
: stoppedPosts.filter((item) => item.id === record.key)[0].stopped
? 'Приостановлен'
: 'Приостановить'}
{stopLoading ? (
<LoadingOutlined />
) : stoppedPosts.filter((item) => item.id === record.key)[0].stopped ? (
<PlayCircleOutlined />
) : (
<PauseCircleOutlined />
)}
</a>
<a onClick={() => (deleteLoading ? null : deletePost(record.key))}>
{deleteLoading ? 'Загрузка' : 'Удалить'}
{deleteLoading ? <LoadingOutlined /> : <DeleteOutlined />}
</a>
</Space>
),
Expand Down
13 changes: 0 additions & 13 deletions src/pages/dashboard/dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,6 @@ export const Dashboard: FC = () => {
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 f2528d5

Please sign in to comment.