mirror of
https://github.com/grafana/grafana.git
synced 2025-02-13 09:05:45 -06:00
* removed unsused grafana-icon classes, replaced grafana-icons with gicons * replaced old dashboard and datasource icons with gicon, fixed so icons on plugin list are shown * removed unsused grafana-icon classes, replaced grafana-icons with gicons * replaced old dashboard and datasource icons with gicon, fixed so icons on plugin list are shown * replaced fontawesome cog, eye, link and edit with gicons * updated snapshot * fixed color of cog in dashboard nav, removed icons from buttons, ran preitterier on some files * changed opacity on getting started icons and fixed getting started button * .5 -> 0.5 fix for prettier
61 lines
1.4 KiB
TypeScript
61 lines
1.4 KiB
TypeScript
import React, { createRef, PureComponent } from 'react';
|
|
import { connect } from 'react-redux';
|
|
import { Invitee } from 'app/types';
|
|
import { revokeInvite } from './state/actions';
|
|
|
|
export interface Props {
|
|
invitee: Invitee;
|
|
revokeInvite: typeof revokeInvite;
|
|
}
|
|
|
|
class InviteeRow extends PureComponent<Props> {
|
|
private copyUrlRef = createRef<HTMLTextAreaElement>();
|
|
|
|
copyToClipboard = () => {
|
|
const node = this.copyUrlRef.current;
|
|
|
|
if (node) {
|
|
node.select();
|
|
document.execCommand('copy');
|
|
}
|
|
};
|
|
|
|
render() {
|
|
const { invitee, revokeInvite } = this.props;
|
|
return (
|
|
<tr>
|
|
<td>{invitee.email}</td>
|
|
<td>{invitee.name}</td>
|
|
<td className="text-right">
|
|
<button className="btn btn-inverse btn-small" onClick={this.copyToClipboard}>
|
|
<textarea
|
|
readOnly={true}
|
|
value={invitee.url}
|
|
style={{ position: 'absolute', right: -1000 }}
|
|
ref={this.copyUrlRef}
|
|
/>
|
|
Copy Invite
|
|
</button>
|
|
|
|
</td>
|
|
<td>
|
|
<button className="btn btn-danger btn-small" onClick={() => revokeInvite(invitee.code)}>
|
|
<i className="fa fa-remove" />
|
|
</button>
|
|
</td>
|
|
</tr>
|
|
);
|
|
}
|
|
}
|
|
|
|
const mapDispatchToProps = {
|
|
revokeInvite,
|
|
};
|
|
|
|
export default connect(
|
|
() => {
|
|
return {};
|
|
},
|
|
mapDispatchToProps
|
|
)(InviteeRow);
|