-
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.
Steps now pass a status prop for optional styling.
- Loading branch information
Showing
10 changed files
with
217 additions
and
21 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,69 @@ | ||
|
||
import React, { | ||
Component, | ||
Fragment, | ||
} from 'react'; | ||
|
||
import { | ||
EuiSpacer, | ||
EuiSteps, | ||
EuiButton, | ||
} from '../../../../src/components'; | ||
|
||
export default class extends Component { | ||
|
||
constructor(props) { | ||
super(props); | ||
|
||
this.state = { | ||
status: 'incomplete', | ||
}; | ||
|
||
this.handleComplete = this.handleComplete.bind(this); | ||
} | ||
|
||
handleComplete() { | ||
this.setState({ | ||
status: 'complete', | ||
}); | ||
} | ||
|
||
render() { | ||
|
||
let button; | ||
if (this.state.status === "incomplete") { | ||
button = ( | ||
<EuiButton onClick={this.handleComplete}>You complete me</EuiButton> | ||
); | ||
} | ||
|
||
const firstSetOfSteps = [ | ||
{ | ||
title: 'Normal step', | ||
children: <p>Do this first</p>, | ||
}, | ||
{ | ||
title: 'Push the button to complete this final step', | ||
children: ( | ||
<Fragment> | ||
<p> | ||
I am a fancy button just waiting to be pushed! | ||
</p> | ||
<EuiSpacer /> | ||
{button} | ||
</Fragment> | ||
), | ||
status: this.state.status, | ||
}, | ||
]; | ||
|
||
return ( | ||
<div> | ||
<EuiSteps | ||
steps={firstSetOfSteps} | ||
/> | ||
|
||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -234,6 +234,7 @@ export { | |
} from './spacer'; | ||
|
||
export { | ||
EuiStep, | ||
EuiSteps, | ||
EuiSubSteps, | ||
EuiStepsHorizontal, | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
export { | ||
EuiStep, | ||
} from './step'; | ||
|
||
export { | ||
EuiSteps, | ||
} from './steps'; | ||
|
Oops, something went wrong.