Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!nextProps.delay || nextProps.delay > 0) {
startTimer();
}
}
// If notification is up, refresh timeout when id changes
if (props.visible && props.id !== nextProps.id) {
clearTimeout(timeoutId);
if (!nextProps.delay || nextProps.delay > 0) {
startTimer();
}
}
return true;
}),
mapProps(({ setState, ...rest }) => ({
close: () => {
setState(() => false);
if (timeoutId) clearTimeout(timeoutId);
},
...rest,
}))
);
/*----------------------------------------------------------------------------*/
export default enhance(Notification);
fetchPatterns();
}
});
const handlers = withHandlers({
fetchPatterns: ({ setPatterns }) => () => {
axios
.get('http://5b3757f86223c40014605837.mockapi.io/patterns')
.then(({ data }) => {
setPatterns(data);
})
.catch(error => console.error(error));
}
});
const replaceProps = mapProps(props => ({
...props,
dict: language[props.language],
patterns: props.patterns.length
? props.patterns
.filter(item => {
const searchQuery =
props.location.search.indexOf('search=') >= 0
? props.location.search.split('search=')[1]
: props.searchQuery;
return (
(item.title.hasOwnProperty(props.language) &&
item.title[props.language].toLowerCase().indexOf(searchQuery) >=
0) ||
item.tags.toLowerCase().indexOf(searchQuery) >= 0 ||
(item.hasOwnProperty('description') &&
item.description.hasOwnProperty(props.language) &&
}),
defaultProps({
size: 'md'
}),
connect((state, props) => {
const symbol = props.symbol
if (symbol === 'ERC20') {
return { src: Erc20Svg, fill: '#fff' }
}
let iconSrc = getAssetIconUrl(state, symbol)
if (!iconSrc) {
iconSrc = QuestionMarkSvg
}
return { src: iconSrc }
}),
mapProps((props) => omit(props, 'symbol', 'dispatch'))
)(Icon)
}
export default compose(
setDisplayName('FaastLink'),
setPropTypes({
...Link.propTypes,
merge: PropTypes.bool,
}),
defaultProps({
merge: false
}),
withRouter,
withProps(({ to, merge, location: current }) => ({
to: stringifyLocationQs(merge ? mergeLocations(to, current) : to)
})),
mapProps((props) => omit(props, 'merge', 'match', 'location', 'history', 'staticContext'))
)(Link)
import React, { PropTypes } from 'react'
import cn from 'classnames'
import { compose, mapProps } from 'recompose'
import stylesClasses from 'styles'
import { useSheet } from 'styles/jss'
import { Types, selectClasses } from 'styles/mixins'
const styles = {
layout: {
display: 'flex',
},
}
const enhance = compose(
useSheet(styles),
mapProps(({ sheet: { classes }, ...props }) => ({
...props,
classes: {
...classes,
additional: selectClasses(props, stylesClasses.classes, ['padding', 'justifyContent', 'alignItems']),
},
})),
)
const Layout = ({ children, classes, className }) => (
<div>{children}</div>
)
Layout.propTypes = {
classes: PropTypes.object,
children: PropTypes.node,
Clear completed
const footerApi = {
activeCount: PropTypes.number.isRequired,
completedCount: PropTypes.number.isRequired,
filter: PropTypes.string.isRequired,
onClearCompleted: PropTypes.func.isRequired,
onShow: PropTypes.func.isRequired
}
export default compose(
onlyUpdateForPropTypes,
setPropTypes(footerApi),
renameProp('filter', 'selectedFilter'),
mapProps(({ activeCount, selectedFilter, onShow, completedCount, onClearCompleted }) => ({
todoCount: TodoCount({ activeCount }),
FilterLink: withProps({ selectedFilter, onShow }, FilterLink),
clearButton: completedCount > 0 ? ClearButton({ onClearCompleted }) : null
}))
)(Footer)
export default composeComponent(
'LanguageProvider',
injectReducer(REDUX_KEY, reducer),
connect(
createSelector(
makeSelectLocale(),
(locale) => ({ locale }),
),
),
setPropTypes({
locale: PropTypes.string,
messages: PropTypes.object,
children: PropTypes.element.isRequired,
}),
mapProps(({ locale, messages, ...props }) => ({
locale,
key: locale,
messages: messages[locale],
...props,
})),
({ children, ...props }) => (
{children}
),
)
}
},
componentDidUpdate(prevProps) {
if (prevProps.startGuiFadeOut !== this.props.startGuiFadeOut) {
this.startFade();
}
},
};
export default compose(
connectWithId(mapStateToProps, {
setOption,
}),
withHandlers(handlers),
setLifecycle(lifecycle),
mapProps(props => ({
children: props.children,
fullScreen: props.fullScreen,
guiFadeOut: props.guiFadeOut,
onMouseMove: props.onMouseMove,
})),
)(GuiAnimation);
${getSlotFragmentSpreads(slots, 'root')}
}
`,
settings: gql`
fragment TalkAdmin_OrganizationSettings_settings on Settings {
organizationName
organizationContactEmail
${getSlotFragmentSpreads(slots, 'settings')}
}
`,
}),
connect(
mapStateToProps,
mapDispatchToProps
),
mapProps(({ root, settings, updatePending, errors, ...rest }) => ({
slotPassthrough: {
root,
settings,
updatePending,
errors,
},
updatePending,
settings,
errors,
...rest,
}))
)(OrganizationSettings);
* Данные
*/
datasource: PropTypes.object,
};
CardItem.defaultProps = {
rows: ['image', 'header', 'meta', 'text', 'extra'],
linear: false,
inverse: false,
outline: false,
};
export { CardItem };
export default compose(
setDisplayName('CardItem'),
mapProps(({ datasource, ...rest }) => extend(datasource, rest))
)(CardItem);