Removed Introduction/onboarding code from ui.js
Will be moving elsewhere... • Removed: - Introduction/onboarding code from ui.js - /welcome route
This commit is contained in:
parent
5791a5225b
commit
0eb3ae2dfa
@ -16,7 +16,6 @@ import {
|
|||||||
} from '../../actions/notifications'
|
} from '../../actions/notifications'
|
||||||
import LoadingBar from '../../components/loading_bar'
|
import LoadingBar from '../../components/loading_bar'
|
||||||
import { fetchFilters } from '../../actions/filters'
|
import { fetchFilters } from '../../actions/filters'
|
||||||
import { MIN_ACCOUNT_CREATED_AT_ONBOARDING } from '../../actions/onboarding'
|
|
||||||
import { clearHeight } from '../../actions/height_cache'
|
import { clearHeight } from '../../actions/height_cache'
|
||||||
import { openModal } from '../../actions/modal'
|
import { openModal } from '../../actions/modal'
|
||||||
import WrappedRoute from './util/wrapped_route'
|
import WrappedRoute from './util/wrapped_route'
|
||||||
@ -40,7 +39,6 @@ import ModalPage from '../../pages/modal_page'
|
|||||||
import SettingsPage from '../../pages/settings_page'
|
import SettingsPage from '../../pages/settings_page'
|
||||||
import ProPage from '../../pages/pro_page'
|
import ProPage from '../../pages/pro_page'
|
||||||
import ExplorePage from '../../pages/explore_page'
|
import ExplorePage from '../../pages/explore_page'
|
||||||
import IntroductionPage from '../../pages/introduction_page'
|
|
||||||
import AboutPage from '../../pages/about_page'
|
import AboutPage from '../../pages/about_page'
|
||||||
// import AuthPage from '../../pages/auth_page'
|
// import AuthPage from '../../pages/auth_page'
|
||||||
|
|
||||||
@ -66,7 +64,6 @@ import {
|
|||||||
GroupTimeline,
|
GroupTimeline,
|
||||||
HashtagTimeline,
|
HashtagTimeline,
|
||||||
HomeTimeline,
|
HomeTimeline,
|
||||||
Introduction,
|
|
||||||
Investors,
|
Investors,
|
||||||
LikedStatuses,
|
LikedStatuses,
|
||||||
ListCreate,
|
ListCreate,
|
||||||
@ -97,8 +94,6 @@ const messages = defineMessages({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const mapStateToProps = (state) => ({
|
const mapStateToProps = (state) => ({
|
||||||
shownOnboarding: state.getIn(['settings', 'shownOnboarding'], false),
|
|
||||||
accountCreatedAt: state.getIn(['accounts', me, 'created_at']),
|
|
||||||
isComposing: state.getIn(['compose', 'is_composing']),
|
isComposing: state.getIn(['compose', 'is_composing']),
|
||||||
hasComposingText: state.getIn(['compose', 'text']).trim().length !== 0,
|
hasComposingText: state.getIn(['compose', 'text']).trim().length !== 0,
|
||||||
hasMediaAttachments: state.getIn(['compose', 'media_attachments']).size > 0,
|
hasMediaAttachments: state.getIn(['compose', 'media_attachments']).size > 0,
|
||||||
@ -134,7 +129,6 @@ class SwitchingArea extends PureComponent {
|
|||||||
children: PropTypes.node,
|
children: PropTypes.node,
|
||||||
location: PropTypes.object,
|
location: PropTypes.object,
|
||||||
onLayoutChange: PropTypes.func.isRequired,
|
onLayoutChange: PropTypes.func.isRequired,
|
||||||
shownOnboarding: PropTypes.bool.isRequired,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
@ -166,7 +160,6 @@ class SwitchingArea extends PureComponent {
|
|||||||
<Redirect from='/' to='/home' exact />
|
<Redirect from='/' to='/home' exact />
|
||||||
<WrappedRoute path='/home' exact page={HomePage} component={HomeTimeline} content={children} />
|
<WrappedRoute path='/home' exact page={HomePage} component={HomeTimeline} content={children} />
|
||||||
|
|
||||||
<WrappedRoute path='/welcome' exact page={IntroductionPage} component={Introduction} content={children} />
|
|
||||||
|
|
||||||
<WrappedRoute path='/about' publicRoute exact page={AboutPage} component={About} content={children} componentParams={{ title: 'About' }} />
|
<WrappedRoute path='/about' publicRoute exact page={AboutPage} component={About} content={children} componentParams={{ title: 'About' }} />
|
||||||
<WrappedRoute path='/about/dmca' publicRoute exact page={AboutPage} component={DMCA} content={children} componentParams={{ title: 'DMCA' }} />
|
<WrappedRoute path='/about/dmca' publicRoute exact page={AboutPage} component={DMCA} content={children} componentParams={{ title: 'DMCA' }} />
|
||||||
@ -269,8 +262,6 @@ class UI extends PureComponent {
|
|||||||
hasMediaAttachments: PropTypes.bool,
|
hasMediaAttachments: PropTypes.bool,
|
||||||
location: PropTypes.object,
|
location: PropTypes.object,
|
||||||
intl: PropTypes.object.isRequired,
|
intl: PropTypes.object.isRequired,
|
||||||
shownOnboarding: PropTypes.bool.isRequired,
|
|
||||||
accountCreatedAt: PropTypes.string.isRequired,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
@ -387,15 +378,6 @@ class UI extends PureComponent {
|
|||||||
componentWillMount() {
|
componentWillMount() {
|
||||||
if (!me) return
|
if (!me) return
|
||||||
|
|
||||||
//If first time opening app, and is new user, show onboarding
|
|
||||||
const accountCreatedAtValue = moment(this.props.accountCreatedAt).valueOf()
|
|
||||||
const shouldShowOnboarding = !this.props.shownOnboarding && accountCreatedAtValue > MIN_ACCOUNT_CREATED_AT_ONBOARDING
|
|
||||||
|
|
||||||
if (shouldShowOnboarding) {
|
|
||||||
this.context.router.history.push('/welcome')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
window.addEventListener('beforeunload', this.handleBeforeUnload, false)
|
window.addEventListener('beforeunload', this.handleBeforeUnload, false)
|
||||||
|
|
||||||
document.addEventListener('dragenter', this.handleDragEnter, false)
|
document.addEventListener('dragenter', this.handleDragEnter, false)
|
||||||
@ -434,8 +416,6 @@ class UI extends PureComponent {
|
|||||||
|
|
||||||
this.setState({ fetchedNotifications: true })
|
this.setState({ fetchedNotifications: true })
|
||||||
this.props.dispatch(expandNotifications())
|
this.props.dispatch(expandNotifications())
|
||||||
} else if (pathname === '/welcome') {
|
|
||||||
this.context.router.history.push('/home')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.props.dispatch(initializeNotifications())
|
this.props.dispatch(initializeNotifications())
|
||||||
@ -552,11 +532,7 @@ class UI extends PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const { children, location } = this.props
|
||||||
children,
|
|
||||||
location,
|
|
||||||
shownOnboarding,
|
|
||||||
} = this.props
|
|
||||||
const { draggingOver } = this.state
|
const { draggingOver } = this.state
|
||||||
|
|
||||||
// : todo :
|
// : todo :
|
||||||
@ -580,11 +556,7 @@ class UI extends PureComponent {
|
|||||||
<div ref={this.setRef} className={_s.gabsocial}>
|
<div ref={this.setRef} className={_s.gabsocial}>
|
||||||
<LoadingBar className={[_s.height1PX, _s.z3, _s.bgBrandLight].join(' ')} />
|
<LoadingBar className={[_s.height1PX, _s.z3, _s.bgBrandLight].join(' ')} />
|
||||||
|
|
||||||
<SwitchingArea
|
<SwitchingArea location={location} onLayoutChange={this.handleLayoutChange}>
|
||||||
location={location}
|
|
||||||
onLayoutChange={this.handleLayoutChange}
|
|
||||||
shownOnboarding={shownOnboarding}
|
|
||||||
>
|
|
||||||
{children}
|
{children}
|
||||||
</SwitchingArea>
|
</SwitchingArea>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user