Animate parallax on load; Experimental Link scrolls to top
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
|
||||
import React from 'react'
|
||||
import { Link } from 'react-router'
|
||||
import React from 'react';
|
||||
import { Link } from 'react-router';
|
||||
|
||||
export default class Link extends React.Component{
|
||||
export default class extends React.Component{
|
||||
|
||||
constructor(props){
|
||||
super(props);
|
||||
@ -10,16 +10,16 @@ export default class Link extends React.Component{
|
||||
|
||||
handleClick(e){
|
||||
if (!this.props.retainScroll){
|
||||
window.scrollTo(0, 0);
|
||||
document.getElementById('main').scrollTo(0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
render(){
|
||||
render(){
|
||||
return (
|
||||
<Link
|
||||
onClick={e => this.handleClick(e)}
|
||||
className={this.props.className ? this.props.className : null}
|
||||
to={to}>
|
||||
to={this.props.to}>
|
||||
{this.props.children}
|
||||
</Link>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user