Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
handleAddReaction = preventDoubleTap(() => {
const {theme} = this.props;
const {formatMessage} = this.context.intl;
const screen = 'AddReaction';
const title = formatMessage({id: 'mobile.post_info.add_reaction', defaultMessage: 'Add Reaction'});
MaterialIcon.getImageSource('close', 20, theme.sidebarHeaderTextColor).then((source) => {
const passProps = {
closeButton: source,
onEmojiPress: this.handleAddReactionToPost,
};
showModal(screen, title, passProps);
});
});
icons.map(async k => {
iconsCache[k] = await Icon.getImageSource(k.toString(), 24);
}),
);
constructor(props) {
super(props);
MaterialIcon.getImageSource('close', 20, this.props.theme.sidebarHeaderTextColor).then((source) => {
this.closeButton = source;
});
this.state = {
top: new Animated.Value(-100),
};
}
constructor(props) {
super(props);
this.state = {
searching: false,
term: '',
};
MaterialIcon.getImageSource('close', 20, this.props.theme.sidebarHeaderTextColor).then((source) => {
this.closeButton = source;
});
}
this.close(() => {
MaterialIcon.getImageSource('close', 20, theme.sidebarHeaderTextColor).then((source) => {
const screen = 'EditPost';
const title = intl.formatMessage({id: 'mobile.edit_post.title', defaultMessage: 'Editing Message'});
const passProps = {
post,
closeButton: source,
};
showModal(screen, title, passProps);
});
});
};
showTermsOfServiceModal = async () => {
const {intl} = this.context;
const {theme} = this.props;
const closeButton = await MaterialIcon.getImageSource('close', 20, theme.sidebarHeaderTextColor);
const screen = 'TermsOfService';
const passProps = {closeButton};
const title = intl.formatMessage({id: 'mobile.tos_link', defaultMessage: 'Terms of Service'});
const options = {
layout: {
backgroundColor: theme.centerChannelBg,
},
topBar: {
visible: true,
height: null,
title: {
color: theme.sidebarHeaderTextColor,
text: title,
},
},
};
super(props);
this.combinedActionsRef = React.createRef();
this.state = {
sections: this.buildSections(props),
showIndicator: false,
width: 0,
};
this.keyboardDismissProp = {
keyboardDismissMode: Platform.OS === 'ios' ? 'interactive' : 'none',
onScrollBeginDrag: this.scrollBeginDrag,
};
MaterialIcon.getImageSource('close', 20, this.props.theme.sidebarHeaderTextColor).then((source) => {
this.closeButton = source;
});
}
constructor(props) {
super(props);
this.state = {
serverUrl: '',
};
MaterialIcon.getImageSource('close', 20, props.theme.sidebarHeaderTextColor).then((source) => {
this.closeButton = source;
});
getCurrentServerUrl().then((url) => {
this.setState({serverUrl: removeProtocol(url)});
});
}
iconNamePropsPairs.map(([iconName, iconProps]) =>
Icon.getImageSource(iconName, iconProps.size),
),
super(props);
this.combinedActionsRef = React.createRef();
this.state = {
sections: this.buildSections(props),
showIndicator: false,
width: 0,
};
this.keyboardDismissProp = {
keyboardDismissMode: Platform.OS === 'ios' ? 'interactive' : 'none',
onScrollBeginDrag: this.scrollBeginDrag,
};
MaterialIcon.getImageSource('close', 20, this.props.theme.sidebarHeaderTextColor).then((source) => {
this.closeButton = source;
});
}