Add back button

This commit is contained in:
Viet Anh Nguyen 2024-02-05 14:31:18 +07:00
parent 2fcff26a7e
commit a01ea01d7e
2 changed files with 25 additions and 8 deletions

View File

@ -148,7 +148,7 @@ const ReportTable: React.FC = () => {
title: 'Actions', title: 'Actions',
dataIndex: 'actions', dataIndex: 'actions',
key: 'actions', key: 'actions',
width: 200, width: 210,
render: (_, record) => { render: (_, record) => {
return ( return (
<div style={{ flexDirection: 'row' }}> <div style={{ flexDirection: 'row' }}>
@ -158,7 +158,7 @@ const ReportTable: React.FC = () => {
}} }}
style={{ marginRight: 10 }} style={{ marginRight: 10 }}
> >
Detail Details
</Button> </Button>
<Button onClick={() => handleDownloadReport(record.report_id)}> <Button onClick={() => handleDownloadReport(record.report_id)}>
Download Download

View File

@ -1,4 +1,4 @@
import { DownloadOutlined } from '@ant-design/icons'; import { DownloadOutlined, ArrowLeftOutlined } from '@ant-design/icons';
import { t } from '@lingui/macro'; import { t } from '@lingui/macro';
import { import {
Button, Button,
@ -271,14 +271,32 @@ const ReportDetail = () => {
URL.revokeObjectURL(anchorElement.href); URL.revokeObjectURL(anchorElement.href);
}; };
const handleBack = () => {
window.history.back();
};
return ( return (
<> <>
<SbtPageHeader <SbtPageHeader
title={ title={
<Tooltip <>
title={id} <Tooltip title={t`Back`}>
style={{ cursor: 'pointer' }} <Button
>{t`Report ${id.slice(0, 16)}...`}</Tooltip> size='middle'
type='default'
icon={<ArrowLeftOutlined />}
onClick={() => handleBack()}
style={{
marginRight: 10,
lineHeight: '1.8',
height: 38
}}
>
{t`Back`}
</Button>
</Tooltip>
{t`Report Details`}
</>
} }
extra={ extra={
<Button <Button
@ -298,7 +316,6 @@ const ReportDetail = () => {
{report_data?.metadata?.subsidiary} {report_data?.metadata?.subsidiary}
</span> </span>
</Typography.Title> </Typography.Title>
<Typography.Title level={5}> <Typography.Title level={5}>
Start date:{' '} Start date:{' '}
<span style={{ fontWeight: '400' }}> <span style={{ fontWeight: '400' }}>