Skip to content

Commit

Permalink
Merge pull request #644 from shoutem/release/4.6.3
Browse files Browse the repository at this point in the history
Release/4.6.3
  • Loading branch information
Definitely-Not-Vlad authored Oct 1, 2021
2 parents 96d9168 + 4c8aa3d commit a9370e9
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 16 deletions.
13 changes: 11 additions & 2 deletions components/ListView.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class ListView extends PureComponent {

this.state = {
status: props.loading ? Status.LOADING : Status.IDLE,
isScrolling: false,
};
}

Expand Down Expand Up @@ -196,17 +197,21 @@ class ListView extends PureComponent {
// reference
mappedProps.ref = this.handleListViewRef;

mappedProps.onMomentumScrollBegin = this.setIsScrolling(true);

mappedProps.onMomentumScrollEnd = this.setIsScrolling(false);

return mappedProps;
}

// eslint-disable-next-line consistent-return
createOnLoadMore() {
const { onLoadMore, data } = this.props;
const { status } = this.state;
const { isScrolling, status } = this.state;
if (onLoadMore) {
return _.throttle(
() => {
if (!_.isEmpty(data) && status === Status.IDLE) {
if (!_.isEmpty(data) && isScrolling && status === Status.IDLE) {
onLoadMore();
}
},
Expand All @@ -216,6 +221,10 @@ class ListView extends PureComponent {
}
}

setIsScrolling(isScrolling) {
this.setState({ isScrolling });
}

autoHideHeader({
nativeEvent: {
layout: { height },
Expand Down
15 changes: 14 additions & 1 deletion html/components/SimpleHtml.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class SimpleHtml extends PureComponent {
customTagStyles: PropTypes.object,
customHandleLinkPress: PropTypes.func,
unsupportedVideoFormatMessage: PropTypes.string,
customAlterNode: PropTypes.func,
};

constructor(props) {
Expand All @@ -56,10 +57,22 @@ class SimpleHtml extends PureComponent {
* video iframe tags in when video format is unsupported
*/
alterNode(node) {
const { style } = this.props;
const { customAlterNode, style } = this.props;

const styleAttrib = _.get(node, 'attribs.style', '').trim();

if (customAlterNode && _.isFunction(customAlterNode)) {
const resolvedNode = customAlterNode(
node,
cssObjectToString,
cssStringToObject,
);

if (resolvedNode) {
return resolvedNode;
}
}

if (node.name === 'table') {
return tableAlterNode(node);
}
Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shoutem/ui",
"version": "4.6.2",
"version": "4.6.3",
"description": "Styleable set of components for React Native applications",
"scripts": {
"lint": "eslint .",
Expand Down Expand Up @@ -35,7 +35,7 @@
"react-native-transformable-image": "shoutem/react-native-transformable-image#v0.0.20",
"react-native-vector-icons": "~6.6.0",
"react-native-webview": "~11.0.0",
"react-native-youtube-iframe": "~2.0.1",
"react-native-youtube-iframe": "~2.1.2",
"stream": "0.0.2",
"tinycolor2": "1.4.1"
},
Expand Down
11 changes: 5 additions & 6 deletions theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -2041,18 +2041,17 @@ export default (variables = defaultThemeVariables) => ({
minHeight: 40,
maxHeight: 200,
justifyContent: 'center',
backgroundColor: inverseColorBrightnessForAmount(
variables.paperColor,
5,
),
backgroundColor:
variables.categoryDropdownBackgroundColor ||
inverseColorBrightnessForAmount(variables.paperColor, 5),
width: window.width,
marginTop: 0,
borderBottomWidth: StyleSheet.hairlineWidth,
borderColor: variables.navBarBorderColor,
},
selectedOption: {
'shoutem.ui.Icon': {
color: variables.text.color,
color: variables.categoryDropdownTextColor || variables.text.color,
},
'shoutem.ui.Text': {
...variables.navBarText,
Expand All @@ -2061,7 +2060,7 @@ export default (variables = defaultThemeVariables) => ({
'normal',
variables.navBarText.fontStyle,
),
color: variables.text.color,
color: variables.categoryDropdownTextColor || variables.text.color,
fontWeight: resolveFontWeight('normal'),
fontStyle: resolveFontStyle(variables.navBarText.fontStyle),
textAlign: 'center',
Expand Down

0 comments on commit a9370e9

Please sign in to comment.