<commit_before>/**
 * @providesModule CaseOverview
 * @flow
 */

import React from 'react'
import styled from 'styled-components'
import { connect } from 'react-redux'

import TableOfContents from './TableOfContents'
import Billboard from './Billboard'
import EnrollForm from './EnrollForm'
import Tracker from 'utility/Tracker'
import { SignInFormContainer } from 'utility/SignInForm'
import { Consumer as ContentItemSelectionContextConsumer } from 'deployment/contentItemSelectionContext'

import type { ContextRouter } from 'react-router-dom'
import type { State, ReaderState } from 'redux/state'

type StateProps = {
  editing: boolean,
  reader: ?ReaderState,
  signInForm: ?string,
}
function mapStateToProps ({ caseData, edit }: State): StateProps {
  return {
    editing: edit.inProgress,
    reader: caseData.reader,
    signInForm: window.caseData.signInForm,
  }
}

type Props = StateProps & ContextRouter
const CaseOverview = ({ editing, location, reader, signInForm }: Props) => {
  return (
    <ContentItemSelectionContextConsumer>
      {({ selecting }) => (
        <Container editing={editing}>
          <Billboard />
          <aside className="CaseOverviewRight">
            {signInForm != null && !selecting ? (
              <SignInFormContainer formContents={signInForm} />
            ) : reader && !reader.enrollment ? (
              <EnrollForm />
            ) : null}
            <TableOfContents />
            {location.pathname === '/' && (
              <Tracker<commit_msg>don't show signin on case overview page<commit_after>/**
 * @providesModule CaseOverview
 * @flow
 */

import React from 'react'
import styled from 'styled-components'
import { connect } from 'react-redux'

import TableOfContents from './TableOfContents'
import Billboard from './Billboard'
import EnrollForm from './EnrollForm'
import Tracker from 'utility/Tracker'
import { SignInFormContainer } from 'utility/SignInForm'
import { Consumer as ContentItemSelectionContextConsumer } from 'deployment/contentItemSelectionContext'

import type { ContextRouter } from 'react-router-dom'
import type { State, ReaderState } from 'redux/state'

type StateProps = {
  editing: boolean,
  reader: ?ReaderState,
  signInForm: ?string,
}
function mapStateToProps ({ caseData, edit }: State): StateProps {
  return {
    editing: edit.inProgress,
    reader: caseData.reader,
    signInForm: window.caseData.signInForm,
  }
}

type Props = StateProps & ContextRouter
const CaseOverview = ({ editing, location, reader, signInForm }: Props) => {
  return (
    <ContentItemSelectionContextConsumer>
      {({ selecting }) => (
        <Container editing={editing}>
          <Billboard />
          <aside className="CaseOverviewRight">
            {reader && !reader.enrollment ? (
              <EnrollForm />
            ) : null}
            <TableOfContents />
            {location.pathname === '/' && (
              <Tracker
{'fraction_non_alphanumeric': 0.11266643905769887, 'fraction_numerical': 0.0, 'mean_word_length': 3.3088235294117645, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 20, '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': '1445219', 'n_tokens_mistral': 818, 'n_tokens_neox': 812, 'n_words': 210}