mirror of
https://github.com/grafana/grafana.git
synced 2025-02-13 09:05:45 -06:00
* User Experience: apply the same pattern feedback for all copy to clipboard buttons * add copy icon to all ClipboardButton use cases * Change primary color for copy to clipboard in create token * Add success button variant * Remove copy confirmation from TableCellInspectModal because it's in the base component now * Design tweaks to copy confirmation - Only change the icon to tick to avoid the button changing size - Change button to success green - Only show copy confirmation state for 2 seconds * revert TabelCellInspectModal text button back * revert accidental change to ShareLink Co-authored-by: joshhunt <josh@trtr.co>
49 lines
1.1 KiB
TypeScript
49 lines
1.1 KiB
TypeScript
import React, { PureComponent } from 'react';
|
|
import { connect, ConnectedProps } from 'react-redux';
|
|
|
|
import { Button, ClipboardButton } from '@grafana/ui';
|
|
import { Invitee } from 'app/types';
|
|
|
|
import { revokeInvite } from './state/actions';
|
|
|
|
const mapDispatchToProps = {
|
|
revokeInvite,
|
|
};
|
|
|
|
const connector = connect(null, mapDispatchToProps);
|
|
|
|
interface OwnProps {
|
|
invitee: Invitee;
|
|
}
|
|
|
|
export type Props = OwnProps & ConnectedProps<typeof connector>;
|
|
|
|
class InviteeRow extends PureComponent<Props> {
|
|
render() {
|
|
const { invitee, revokeInvite } = this.props;
|
|
return (
|
|
<tr>
|
|
<td>{invitee.email}</td>
|
|
<td>{invitee.name}</td>
|
|
<td className="text-right">
|
|
<ClipboardButton icon="copy" variant="secondary" size="sm" getText={() => invitee.url}>
|
|
Copy Invite
|
|
</ClipboardButton>
|
|
|
|
</td>
|
|
<td>
|
|
<Button
|
|
variant="destructive"
|
|
size="sm"
|
|
icon="times"
|
|
onClick={() => revokeInvite(invitee.code)}
|
|
aria-label="Revoke Invite"
|
|
/>
|
|
</td>
|
|
</tr>
|
|
);
|
|
}
|
|
}
|
|
|
|
export default connector(InviteeRow);
|