import PropTypes from 'prop-types'; import React from 'react'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import { browserHistory } from 'react-router'; import { updateSettings, initiateVerification, createApiKey, removeApiKey } from '../actions'; import Nav from '../../../components/Nav'; import AssetList from '../../IDE/components/AssetList'; import SketchList from '../../IDE/components/SketchList'; import Searchbar from '../../IDE/components/Searchbar'; import DashboardTabSwitcher, { TabKey } from '../components/DashboardTabSwitcher'; class DashboardView extends React.Component { static defaultProps = { user: null, }; constructor(props) { super(props); this.closeAccountPage = this.closeAccountPage.bind(this); this.gotoHomePage = this.gotoHomePage.bind(this); } componentDidMount() { document.body.className = this.props.theme; } closeAccountPage() { browserHistory.push(this.props.previousPath); } gotoHomePage() { browserHistory.push('/'); } selectedTabName() { const path = this.props.location.pathname; if (/assets/.test(path)) { return TabKey.assets; } return TabKey.sketches; } ownerName() { if (this.props.params.username) { return this.props.params.username; } return this.props.user.username; } isOwner() { return this.props.user.username === this.props.params.username; } navigationItem() { } render() { const currentTab = this.selectedTabName(); const isOwner = this.isOwner(); const { username } = this.props.params; return (