Files
optolith-client/js/views/profile/Profile.js
T
Lukas Obermann 0602f421ba Cleaned up SCSS and character sheet print
- Normalized many SCSS files as deep as possible
- Fixed print css to display all 6 pages
- Fixed sheet header to match original sheet header
- Fixed issue with range property for ranged items
2016-12-26 16:16:49 +13:00

70 lines
1.3 KiB
JavaScript

import Overview from './Overview';
import PhaseStore from '../../stores/PhaseStore';
import React, { Component } from 'react';
import Sheets from './Sheets';
import SubTabs from '../../components/SubTabs';
export default class Profile extends Component {
state = {
phase: PhaseStore.get(),
tab: 'overview'
};
_updatePhaseStore = () => this.setState({
phase: PhaseStore.get()
});
handleClick = tab => this.setState({ tab });
componentDidMount() {
PhaseStore.addChangeListener(this._updatePhaseStore );
}
componentWillUnmount() {
PhaseStore.removeChangeListener(this._updatePhaseStore );
}
render() {
const { phase, tab } = this.state;
var element;
switch (tab) {
case 'overview':
element = <Overview />;
break;
case 'sheets':
element = <Sheets />;
break;
}
return (
<section id="profile">
<SubTabs
tabs={[
{
label: 'Übersicht',
tag: 'overview'
},
// {
// label: 'Hintergrund',
// tag: 'background',
// disabled: true
// },
{
label: 'Heldenbogen',
tag: 'sheets',
// disabled: true
disabled: phase < 3
}
]}
active={this.state.tab}
onClick={this.handleClick} />
{element}
</section>
);
}
}