Skip to content

Commit f72946c

Browse files
committed
Added classNames to body (closes #8)
1 parent 68650aa commit f72946c

File tree

6 files changed

+22
-8
lines changed

6 files changed

+22
-8
lines changed

dist/react-swipeable-bottom-sheet.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4152,9 +4152,13 @@ var SwipeableBottomSheet = (function (_Component) {
41524152
}),
41534153
_react2['default'].createElement(
41544154
'div',
4155-
{ style: styles.swiper.body, ref: function (elt) {
4155+
{
4156+
ref: function (elt) {
41564157
return _this.bodyElt = elt;
4157-
} },
4158+
},
4159+
style: styles.swiper.body,
4160+
className: 'ReactSwipeableBottomSheet--' + (isOpen ? 'open' : 'close')
4161+
},
41584162
this.props.children
41594163
),
41604164
_react2['default'].createElement('div', { style: styles.swiper.bottomSlide })

dist/react-swipeable-bottom-sheet.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/src/controlled.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ class App extends React.Component {
3535
padding: '10px',
3636
boxSizing: 'border-box',
3737
backgroundColor: 'white',
38-
fontSize: '18px'
38+
fontSize: '18px',
39+
minHeight: '50vh'
3940
}
4041
};
4142

example/src/uncontrolled.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class App extends React.Component {
1919
boxSizing: 'border-box',
2020
backgroundColor: 'white',
2121
fontSize: '18px',
22+
minHeight: '50vh'
2223
}
2324
};
2425

lib/SwipeableBottomSheet.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,13 @@ var SwipeableBottomSheet = (function (_Component) {
191191
}),
192192
_react2['default'].createElement(
193193
'div',
194-
{ style: styles.swiper.body, ref: function (elt) {
194+
{
195+
ref: function (elt) {
195196
return _this.bodyElt = elt;
196-
} },
197+
},
198+
style: styles.swiper.body,
199+
className: 'ReactSwipeableBottomSheet--' + (isOpen ? 'open' : 'close')
200+
},
197201
this.props.children
198202
),
199203
_react2['default'].createElement('div', { style: styles.swiper.bottomSlide })

src/SwipeableBottomSheet.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,11 @@ class SwipeableBottomSheet extends Component {
155155
containerStyle={styles.swiper.container}
156156
slideStyle={styles.swiper.slide}
157157
>
158-
<div style={styles.swiper.body} ref={elt => this.bodyElt = elt}>
158+
<div
159+
ref={elt => this.bodyElt = elt}
160+
style={styles.swiper.body}
161+
className={`ReactSwipeableBottomSheet--${isOpen ? 'open' : 'close'}`}
162+
>
159163
{this.props.children}
160164
</div>
161165
<div style={styles.swiper.bottomSlide}/>

0 commit comments

Comments
 (0)