yapi/client/containers/Interface/InterfaceList/InterfaceList.js
2017-07-26 16:29:13 +08:00

36 lines
901 B
JavaScript

import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { Link } from 'react-router-dom'
import { Button } from 'antd'
class InterfaceList extends Component {
static propTypes = {
projectMember: PropTypes.func
}
constructor(props) {
super(props)
}
getInterfaceId () {
const reg = /Interface\/(\d+)/g
const url = location.href
url.match(reg)
return RegExp.$1
}
render () {
const { projectMember } = this.props
const getInterfaceId = this.getInterfaceId()
return (
<div className="interface-btngroup">
<Link to={`/AddInterface/${getInterfaceId}`}><Button className="interface-btn" type="primary" icon="plus">添加接口</Button></Link>
<Button className="interface-btn" type="primary" onClick={projectMember} icon="user">管理成员</Button>
</div>
)
}
}
export default InterfaceList