Animate parallax on load; Experimental Link scrolls to top

This commit is contained in:
James Barnsley
2018-10-24 21:15:57 +13:00
parent 00811f7084
commit 42414b25d3
11 changed files with 10682 additions and 13769 deletions

View File

@ -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>
);