Improved button styling
Added toast when collection permissions are saved Removed usage of setState (old habits die hard)
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import { observable } from 'mobx';
|
||||
import { observer } from 'mobx-react';
|
||||
import styled from 'styled-components';
|
||||
import Tip from './Tip';
|
||||
import CopyToClipboard from './CopyToClipboard';
|
||||
@@ -9,17 +11,12 @@ type Props = {
|
||||
team: Team,
|
||||
};
|
||||
|
||||
type State = {
|
||||
linkCopied: boolean,
|
||||
};
|
||||
|
||||
class TipInvite extends React.Component<Props, State> {
|
||||
state = {
|
||||
linkCopied: false,
|
||||
};
|
||||
@observer
|
||||
class TipInvite extends React.Component<Props> {
|
||||
@observable linkCopied: boolean = false;
|
||||
|
||||
handleCopy = () => {
|
||||
this.setState({ linkCopied: true });
|
||||
this.linkCopied = true;
|
||||
};
|
||||
|
||||
render() {
|
||||
@@ -35,7 +32,7 @@ class TipInvite extends React.Component<Props, State> {
|
||||
–{' '}
|
||||
<CopyToClipboard text={team.url} onCopy={this.handleCopy}>
|
||||
<a>
|
||||
{this.state.linkCopied
|
||||
{this.linkCopied
|
||||
? 'link copied to clipboard!'
|
||||
: 'copy a link to share.'}
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user