Skip to content

Commit c4cdbb0

Browse files
committed
modal example cleanup
1 parent 7379b7f commit c4cdbb0

File tree

1 file changed

+11
-50
lines changed

1 file changed

+11
-50
lines changed

demo/pages/HomePage/ModalSection2.jsx

Lines changed: 11 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,11 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1010
'use strict';
1111

1212
import React from 'react';
13-
import SLDSButton from '../../../components/SLDSButton';
14-
import {ButtonIcon, Icon} from './../../../components/SLDSIcons';
1513
import {default as PrismCode} from 'react-prism/lib/PrismCode';
16-
import {EventUtil} from '../../../components/utils';
17-
import SLDSDateInput from '../../../components/SLDSDateInput';
1814

19-
import SLDSModal from '../../../components/SLDSModal';
20-
import {SLDSModalTrigger, SLDSPicklistBase} from '../../../components';
15+
import {SLDSModal, SLDSButton, SLDSPicklistBase} from '../../../components';
2116

2217

23-
24-
25-
26-
27-
const customStyles = {
28-
content : {
29-
position : 'default',
30-
top : 'default',
31-
left : 'default',
32-
right : 'default',
33-
bottom : 'default',
34-
border : 'default',
35-
background : 'default',
36-
overflow : 'default',
37-
WebkitOverflowScrolling : 'default',
38-
borderRadius : 'default',
39-
outline : 'default',
40-
padding : 'default'
41-
},
42-
overlay : {
43-
backgroundColor: 'default'
44-
}
45-
};
46-
4718
module.exports = React.createClass( {
4819

4920
getDefaultProps () {
@@ -56,13 +27,8 @@ module.exports = React.createClass( {
5627
};
5728
},
5829

59-
handleOpenModalClick (event) {
60-
SLDSModalTrigger.open(this.getModalConfig(event.target));
61-
},
62-
6330
openModal () {
6431
this.setState({modalIsOpen: true});
65-
// SLDSModalTrigger.open(this.getModalConfig());
6632
},
6733

6834
closeModal () {
@@ -123,20 +89,6 @@ module.exports = React.createClass( {
12389
</div>;
12490
},
12591

126-
127-
renderModal () {
128-
return <SLDSModal
129-
isOpen={this.state.modalIsOpen}
130-
title={<span>Super Stuff</span>}
131-
footer={[
132-
<button className='slds-button slds-button--neutral' onClick={this.closeModal}>Cancel</button>,
133-
<button className='slds-button slds-button--neutral slds-button--brand' onClick={this.handleSubmitModal}>Save</button>
134-
]}
135-
onRequestClose={this.closeModal}>
136-
{this.getModalContent()}
137-
</SLDSModal>;
138-
},
139-
14092
render() {
14193
return (
14294

@@ -156,7 +108,16 @@ module.exports = React.createClass( {
156108
<SLDSButton flavor='brand' onClick={this.openModal}>
157109
Open Modal
158110
</SLDSButton>
159-
{this.renderModal()}
111+
<SLDSModal
112+
isOpen={this.state.modalIsOpen}
113+
title={<span>Super Stuff</span>}
114+
footer={[
115+
<button className='slds-button slds-button--neutral' onClick={this.closeModal}>Cancel</button>,
116+
<button className='slds-button slds-button--neutral slds-button--brand' onClick={this.handleSubmitModal}>Save</button>
117+
]}
118+
onRequestClose={this.closeModal}>
119+
{this.getModalContent()}
120+
</SLDSModal>
160121
</div>
161122
</div>
162123

0 commit comments

Comments
 (0)