Use react links.

This commit is contained in:
Yang Luo
2021-02-12 00:31:53 +08:00
parent 8790e95147
commit ee1e08ae20
5 changed files with 40 additions and 44 deletions

View File

@ -1,4 +1,5 @@
import React from "react";
import {Link} from "react-router-dom";
import {Button, Col, Popconfirm, Row, Table} from 'antd';
import moment from "moment";
import * as Setting from "./Setting";
@ -75,7 +76,9 @@ class OrganizationListPage extends React.Component {
sorter: (a, b) => a.name.localeCompare(b.name),
render: (text, record, index) => {
return (
<a href={`/organizations/${text}`}>{text}</a>
<Link to={`/organizations/${text}`}>
{text}
</Link>
)
}
},
@ -111,7 +114,7 @@ class OrganizationListPage extends React.Component {
render: (text, record, index) => {
return (
<div>
<Button style={{marginTop: '10px', marginBottom: '10px', marginRight: '10px'}} type="primary" onClick={() => Setting.goToLink(`/organizations/${record.name}`)}>Edit</Button>
<Button style={{marginTop: '10px', marginBottom: '10px', marginRight: '10px'}} type="primary" onClick={() => this.props.history.push(`/organizations/${record.name}`)}>Edit</Button>
<Popconfirm
title={`Sure to delete organization: ${record.name} ?`}
onConfirm={() => this.deleteOrganization(index)}