-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce18636
commit e6e287f
Showing
9 changed files
with
133 additions
and
172 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
30 changes: 12 additions & 18 deletions
30
docs/app/Examples/addons/Confirm/Types/ConfirmConfirmExample.js
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,33 +1,27 @@ | ||
import React, { Component } from 'react' | ||
import { Button, Header, Image, Modal } from 'stardust' | ||
import { Button, Confirm } from 'stardust' | ||
|
||
class ModalModalExample extends Component { | ||
class ConfirmConfirmExample extends Component { | ||
state = { active: false } | ||
|
||
show = () => this.setState({ active: true }) | ||
hide = () => this.setState({ active: false }) | ||
handleConfirm = () => this.setState({ active: false }) | ||
handleCancel = () => this.setState({ active: false }) | ||
|
||
render() { | ||
const { active } = this.state | ||
const { active, result } = this.state | ||
|
||
return ( | ||
<div> | ||
<Button onClick={this.show}>Show Modal</Button> | ||
|
||
<Modal active={active} onHide={this.hide}> | ||
<Modal.Header>Select a Photo</Modal.Header> | ||
<Modal.Content image> | ||
<Image className='medium' src='http://semantic-ui.com/images/avatar2/large/rachel.png' /> | ||
<Modal.Description> | ||
<Header>Default Profile Image</Header> | ||
<p>We've found the following gravatar image associated with your e-mail address.</p> | ||
<p>Is it okay to use this photo?</p> | ||
</Modal.Description> | ||
</Modal.Content> | ||
</Modal> | ||
<Button onClick={this.show}>Show</Button> | ||
<Confirm | ||
active={active} | ||
onCancel={this.handleCancel} | ||
onConfirm={this.handleConfirm} | ||
/> | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
export default ModalModalExample | ||
export default ConfirmConfirmExample |
37 changes: 13 additions & 24 deletions
37
docs/app/Examples/addons/Confirm/Variations/ConfirmButtonsExample.js
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,38 +1,27 @@ | ||
import React, { Component } from 'react' | ||
import { Button, Icon, Confirm } from 'stardust' | ||
import { Button, Confirm } from 'stardust' | ||
|
||
class ConfirmContentExample extends Component { | ||
class ConfirmButtonsExample extends Component { | ||
state = { active: false } | ||
|
||
show = () => this.setState({ active: true }) | ||
hide = () => this.setState({ active: false }) | ||
handleConfirm = () => this.setState({ active: false }) | ||
handleCancel = () => this.setState({ active: false }) | ||
|
||
render() { | ||
const { active, size } = this.state | ||
|
||
return ( | ||
<div> | ||
<Button onClick={this.show}>Small</Button> | ||
|
||
<Confirm size={size} active={active} onHide={this.hide}> | ||
<Confirm.Header> | ||
Delete Your Account | ||
</Confirm.Header> | ||
<Confirm.Content> | ||
<p>Are you sure you want to delete your account</p> | ||
</Confirm.Content> | ||
<Confirm.Actions> | ||
<Button className='negative'> | ||
No | ||
</Button> | ||
<Button className='positive right labeled icon'> | ||
Yes <Icon name='checkmark' /> | ||
</Button> | ||
</Confirm.Actions> | ||
</Confirm> | ||
<Button onClick={this.show}>Show</Button> | ||
<Confirm | ||
active={this.state.active} | ||
cancelLabel='Never mind' | ||
confirmLabel="Let's do it" | ||
onCancel={this.handleCancel} | ||
onConfirm={this.handleConfirm} | ||
/> | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
export default ConfirmContentExample | ||
export default ConfirmButtonsExample |
40 changes: 13 additions & 27 deletions
40
docs/app/Examples/addons/Confirm/Variations/ConfirmContentExample.js
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,40 +1,26 @@ | ||
import React, { Component } from 'react' | ||
import { Button, Icon, Modal } from 'stardust' | ||
import { Button, Confirm } from 'stardust' | ||
|
||
class ModalSizeExample extends Component { | ||
class ConfirmButtonsExample extends Component { | ||
state = { active: false } | ||
|
||
show = (size) => () => this.setState({ size, active: true }) | ||
hide = () => this.setState({ active: false }) | ||
show = () => this.setState({ active: true }) | ||
handleConfirm = () => this.setState({ active: false }) | ||
handleCancel = () => this.setState({ active: false }) | ||
|
||
render() { | ||
const { active, size } = this.state | ||
|
||
return ( | ||
<div> | ||
<Button onClick={this.show('small')}>Small</Button> | ||
<Button onClick={this.show('large')}>Large</Button> | ||
<Button onClick={this.show('fullscreen')}>Fullscreen</Button> | ||
|
||
<Modal size={size} active={active} onHide={this.hide}> | ||
<Modal.Header> | ||
Delete Your Account | ||
</Modal.Header> | ||
<Modal.Content> | ||
<p>Are you sure you want to delete your account</p> | ||
</Modal.Content> | ||
<Modal.Actions> | ||
<Button className='negative'> | ||
No | ||
</Button> | ||
<Button className='positive right labeled icon'> | ||
Yes <Icon name='checkmark' /> | ||
</Button> | ||
</Modal.Actions> | ||
</Modal> | ||
<Button onClick={this.show}>Show</Button> | ||
<Confirm | ||
active={this.state.active} | ||
content='This is a custom message' | ||
onCancel={this.handleCancel} | ||
onConfirm={this.handleConfirm} | ||
/> | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
export default ModalSizeExample | ||
export default ConfirmButtonsExample |
36 changes: 12 additions & 24 deletions
36
docs/app/Examples/addons/Confirm/Variations/ConfirmHeaderExample.js
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,38 +1,26 @@ | ||
import React, { Component } from 'react' | ||
import { Button, Icon, Confirm } from 'stardust' | ||
import { Button, Confirm } from 'stardust' | ||
|
||
class ConfirmContentExample extends Component { | ||
class ConfirmHeaderExample extends Component { | ||
state = { active: false } | ||
|
||
show = () => this.setState({ active: true }) | ||
hide = () => this.setState({ active: false }) | ||
handleConfirm = () => this.setState({ active: false }) | ||
handleCancel = () => this.setState({ active: false }) | ||
|
||
render() { | ||
const { active, size } = this.state | ||
|
||
return ( | ||
<div> | ||
<Button onClick={this.show}>Small</Button> | ||
|
||
<Confirm size={size} active={active} onHide={this.hide}> | ||
<Confirm.Header> | ||
Delete Your Account | ||
</Confirm.Header> | ||
<Confirm.Content> | ||
<p>Are you sure you want to delete your account</p> | ||
</Confirm.Content> | ||
<Confirm.Actions> | ||
<Button className='negative'> | ||
No | ||
</Button> | ||
<Button className='positive right labeled icon'> | ||
Yes <Icon name='checkmark' /> | ||
</Button> | ||
</Confirm.Actions> | ||
</Confirm> | ||
<Button onClick={this.show}>Show</Button> | ||
<Confirm | ||
active={this.state.active} | ||
header='This is a custom header' | ||
onCancel={this.handleCancel} | ||
onConfirm={this.handleConfirm} | ||
/> | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
export default ConfirmContentExample | ||
export default ConfirmHeaderExample |
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
Oops, something went wrong.