This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { combineReducers } from 'redux'; | |
import { router5Reducer } from 'redux-router5'; | |
export default combineReducers({ | |
router: router5Reducer | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import { Provider } from 'react-redux'; | |
import { RouterProvider } from 'react-router5'; | |
import configureStore from './_redux/store'; | |
import createRouter from './_router/router'; | |
import dataMiddleware from './_router/dataMiddleware'; | |
import routes from './_router/routes'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { PureComponent } from 'react'; | |
import { connect } from 'react-redux'; | |
import { routeNodeSelector } from 'redux-router5'; | |
import Preview from './Preview'; | |
import './List.css'; | |
class List extends PureComponent { | |
render() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { PureComponent } from 'react'; | |
import { bindActionCreators } from 'redux'; | |
import { connect } from 'react-redux'; | |
import { actions, routeNodeSelector } from 'redux-router5'; | |
import TransitionGroup from 'react-transition-group/TransitionGroup'; | |
import List from './List'; | |
import Post from './Post'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { PureComponent } from 'react'; | |
export default class Preview extends PureComponent { | |
render() { | |
const { id, image, title, onClick } = this.props; | |
return ( | |
<div | |
data-id={id} | |
className="preview cover" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { PureComponent } from 'react'; | |
import { connect } from 'react-redux'; | |
import { routeNodeSelector } from 'redux-router5'; | |
import CSSTransition from 'react-transition-group/CSSTransition'; | |
import './Post.css'; | |
class Post extends PureComponent { | |
render() { | |
const { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.App { | |
position: relative; | |
} | |
.full-width { | |
max-width: 480px; | |
width: 100vw; | |
} | |
.cover { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ... */ | |
import { chain, composite, delay, spring, styler, tween } from 'popmotion'; | |
import { cubicBezier } from 'popmotion/easing'; | |
import scroll from 'stylefire/scroll'; | |
/* ... */ | |
class Post extends PureComponent { | |
from = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getPreviewStyleAndPosition = () => { | |
const { top, width, height } = this.preview.getBoundingClientRect(); | |
return { | |
top, | |
width, | |
height, | |
borderRadius: 16 | |
}; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onEnter = () => { | |
/* same code */ | |
this.from = this.getPreviewStyleAndPosition(); | |
this.to = { | |
top: 0, | |
height: window.innerHeight, | |
width: document.body.offsetWidth, | |
borderRadius: 0 | |
}; |