Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'mini-store';
@KootExtend({
styles: require('./header.module.less'),
})
@connect((state) => ({
isHide: state.isHide,
}))
class Header extends Component {
static propTypes = {
children: PropTypes.node
}
element = undefined
render() {
const { isHide } = this.props;
let translateY = 0;
if( this.element ){
translateY = isHide ? this.element.offsetHeight : 0;
}
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'mini-store';
@KootExtend({
styles: require('./content-inner.module.less'),
})
@connect((state) => ({
scrollOffset: state.scrollOffset,
isHide: state.isHide
}))
class Content extends Component {
static propTypes = {
children: PropTypes.node
}
element = undefined;
scroll = {
scrolling: false,
previousTop: 0,
previousTime: 0,
}