-
Notifications
You must be signed in to change notification settings - Fork 842
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bugfix/2361 EuiLink disabled (#2423)
- Loading branch information
1 parent
2eb5aa2
commit d40b288
Showing
7 changed files
with
140 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import React, { Component } from 'react'; | ||
import { | ||
EuiLink, | ||
EuiSwitch, | ||
EuiSpacer, | ||
EuiTextColor, | ||
} from '../../../../src/components'; | ||
|
||
export class LinkDisable extends Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
disableLink: true, | ||
}; | ||
} | ||
|
||
toggleLinkDisable = () => { | ||
this.setState(prevState => ({ disableLink: !prevState.disableLink })); | ||
}; | ||
|
||
render() { | ||
return ( | ||
<div> | ||
<EuiSwitch | ||
label="Disable Links" | ||
checked={this.state.disableLink} | ||
onChange={this.toggleLinkDisable} | ||
/> | ||
<EuiSpacer size="m" /> | ||
<p> | ||
This{' '} | ||
<EuiLink | ||
color="accent" | ||
disabled={this.state.disableLink} | ||
onClick={() => window.alert('Button clicked')}> | ||
paragraph | ||
</EuiLink>{' '} | ||
has two{this.state.disableLink ? ' disabled ' : ' enabled '} | ||
<EuiLink | ||
color="warning" | ||
disabled={this.state.disableLink} | ||
onClick={() => window.alert('Button clicked')}> | ||
links | ||
</EuiLink>{' '} | ||
in it. | ||
</p> | ||
<EuiSpacer size="m" /> | ||
<EuiTextColor color="accent"> | ||
When links are disabled, they inherit the{' '} | ||
<EuiLink | ||
color="secondary" | ||
disabled={this.state.disableLink} | ||
onClick={() => window.alert('Button clicked')}> | ||
color | ||
</EuiLink>{' '} | ||
of surrounding text. | ||
</EuiTextColor> | ||
</div> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters