<commit_before>// @flow
import React, { Component } from 'react'
import DocumentTitle from 'react-document-title'
import ReactMarkdown from 'react-markdown'
import { connect } from 'react-redux'
import { compose } from 'recompose'

import { withStyles } from '@material-ui/core/styles'
import Grid from '@material-ui/core/Grid'
import Hidden from '@material-ui/core/Hidden'
import Typography from '@material-ui/core/Typography'

import CharacterLoadError from './CharacterLoadError.jsx'
import ProtectedComponent from 'containers/ProtectedComponent.jsx'
import BlockPaper from 'components/generic/blockPaper.jsx'
import sharedStyles from 'styles/'
import { getSpecificCharacter } from 'selectors'
import type { Character } from 'utils/flow-types'

const styles = theme => ({
  ...sharedStyles(theme),
  portrait: {
    maxWidth: '100%',
    display: 'block',
    margin: 'auto',
  },
  portraitWrap: {
    //textAlign: 'center',
  },
})

type Props = { character: Character, classes: Object }
class BioFullPage extends Component<Props> {
  render() {
    /* Escape hatch */
    if (this.props.character == undefined) return <CharacterLoadError />

    const { character, classes } = this.props

    return (
      <div>
        <DocumentTitle title={`${character.name} Bio | Lot-Casting Atemi`} />

        <Hidden smUp>
          <div style={{ height: '2.5em' }}>&nbsp;</div>
        </Hidden>

        <Grid container spacing={24}>
          <Grid item xs={12}>
            <Typography variant="headline">Bio/Misc</Typography>
          </Grid>

          <Grid item xs={12}>
            <BlockPaper>
              <Typography
                component={ReactMarkdown}
                className={classes.markdown}
                source={character.description}
              />
            </BlockPaper>
          </Grid>

          <Grid item xs={12} md={6}>
            <BlockPaper>
              {character.type !== 'Character' && (
                <Typography paragraph>
                  Iconic Anima: {character.anima_display || 'Not specified'}
                </Typography>
              )}
              <Typography paragraph>
                Lore Background: {character.lore_background || 'Not specified'}
              </Typography>
              <Typography paragraph>
                Native Language: {character.native_language}
              </Typography>
            </BlockPaper>
          </Grid>

          <Grid item xs={12} md={6}>
            <BlockPaper>
              <div className={classes.portraitWrap}>
                <a
                  href={character.portrait_link}
                  target="_blank"
                  rel="noopener noreferrer"
                >
                  <img
                    src={character.portrait_link}
                    className={classes.portrait}
                  />
                </a>
              </div>
            </BlockPaper>
          </Grid>

          <Grid item xs={12}>
            <BlockPaper>
              <Typography variant="subheading">
                Inventory/Other Equipment
              </Typography>
              <Typography
                component={ReactMarkdown}
                className={classes.markdown}
                source={character.equipment || 'None'}
              />
              <Typography variant="subheading">Notes</Typography>
              <Typography
                component={ReactMarkdown}
                className={classes.markdown}
                source={character.notes}
              />
            </BlockPaper>
          </Grid><commit_msg>Add XP log to bio tab<commit_after>// @flow
import React, { Component } from 'react'
import DocumentTitle from 'react-document-title'
import ReactMarkdown from 'react-markdown'
import { connect } from 'react-redux'
import { compose } from 'recompose'

import { withStyles } from '@material-ui/core/styles'
import Grid from '@material-ui/core/Grid'
import Hidden from '@material-ui/core/Hidden'
import Typography from '@material-ui/core/Typography'

import CharacterLoadError from './CharacterLoadError.jsx'
import ProtectedComponent from 'containers/ProtectedComponent.jsx'
import BlockPaper from 'components/generic/blockPaper.jsx'
import sharedStyles from 'styles/'
import { getSpecificCharacter } from 'selectors'
import type { Character } from 'utils/flow-types'

const styles = theme => ({
  ...sharedStyles(theme),
  portrait: {
    maxWidth: '100%',
    display: 'block',
    margin: 'auto',
  },
  portraitWrap: {
    //textAlign: 'center',
  },
})

type Props = { character: Character, classes: Object }
class BioFullPage extends Component<Props> {
  render() {
    /* Escape hatch */
    if (this.props.character == undefined) return <CharacterLoadError />

    const { character, classes } = this.props
    const xp_log = character.xp_log.map(x => (
      <Typography key={x.label}>
        {x.label}: {x.points} points
      </Typography>
    ))
    const solar_xp_log = character.xp_log_solar.map(x => (
      <Typography key={x.label}>
        {x.label}: {x.points} points
      </Typography>
    ))

    return (
      <div>
        <DocumentTitle title={`${character.name} Bio | Lot-Casting Atemi`} />

        <Hidden smUp>
          <div style={{ height: '2.5em' }}>&nbsp;</div>
        </Hidden>

        <Grid container spacing={24}>
          <Grid item xs={12}>
            <Typography variant="headline">Bio/Misc</Typography>
          </Grid>

          <Grid item xs={12}>
            <BlockPaper>
              <Typography
                component={ReactMarkdown}
                className={classes.markdown}
                source={character.description}
              />
            </BlockPaper>
          </Grid>

          <Grid item xs={12} md={6}>
            <BlockPaper>
              {character.type !== 'Character' && (
                <Typography paragraph>
                  Iconic Anima: {character.anima_display || 'Not specified'}
                </Typography>
              )}
              <Typography paragraph>
                Lore Background: {character.lore_background || 'Not specified'}
              </Typography>
              <Typography paragraph>
                Native Language: {character.native_language}
              </Typography>
            </BlockPaper>
          </Grid>

          <Grid item xs={12} md={6}>
            <BlockPaper>
              <div className={classes.portraitWrap}>
                <a
                  href={character.portrait_link}
                  target="_blank"
                  rel="noopener noreferrer"
                >
                  <img
                    src={character.portrait_link}
                    className={classes.portrait}
                  />
                </a>
              </div>
            </BlockPaper>
          </Grid>

          <Grid item xs={12}>
            <BlockPaper>
              <Typography variant="subheading">
                Inventory/Other Equipment
              </Typography>
              <Typography
                component={ReactMarkdown}
                className={classes.markdown}
                source={character.equipment || 'None'}
              />
              <Typography variant="subheading">Notes</Typography>
              <Typography
                component={ReactMarkdown}
                className={classes.markdown}
                source={character.notes}
              />
            </BlockPaper>
          </Grid>

          <Grid item xs={12}>
            <BlockPaper>
              <div style={{ display: 'flex', flexWrap: 'wrap' }}>
                <div style={{ flex: 1 }}>
                  <Typography variant="subheading">XP</Typography>
                  {xp_log}
                </div>

                <div style={{ flex: 1 }}>
                  <Typography variant="subheading">Solar XP</Typography>
                  {solar_xp_log}
                </div>
              </div>
            </BlockPaper>
          </Grid>
{'fraction_non_alphanumeric': 0.11882677362747555, 'fraction_numerical': 0.005264477312609677, 'mean_word_length': 1.695608108108108, 'pattern_counts': {'":': 0, '<': 115, '<?xml version=': 0, '>': 119, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4329382', 'n_tokens_mistral': 2175, 'n_tokens_neox': 2036, 'n_words': 464}