<commit_before>import React, { Component, Fragment } from 'react'
import Helmet from 'react-helmet'
import { api } from 'data.json'
import {
  ThemeProvider,
  Box,
  Button,
  Card,
  Container,
  Flex,
  Heading,
  LargeButton,
  Link as DSLink,
  Text,
  cx
} from '@hackclub/design-system'
import ApplyNav from 'components/apply/ApplyNav'
import LeaderInviteForm from 'components/apply/LeaderInviteForm'
import Login from 'components/apply/Login'
import SubmitButton from 'components/apply/SubmitButton'
import LoadingAnimation from 'components/LoadingAnimation'
import fetch from 'unfetch'
import Link from 'gatsby-link'

LargeButton.link = LargeButton.withComponent(Link)

const A = DSLink.extend`
  :hover {
    text-decoration: underline;
  }
`

const timeSince = time => {
  const seconds = Math.floor((new Date() - new Date(time)) / 1000)
  const intervals = [
    [Math.floor(seconds / (60 * 60 * 24 * 7)), 'weeks'],
    [Math.floor(seconds / (60 * 60 * 24)), 'days'],
    [Math.floor(seconds / (60 * 60)), 'hours'],
    [Math.floor(seconds / 60), 'minutes']
  ]
  for (var i = 0; i < intervals.length; i++) {
    let interval = intervals[i]
    if (interval[0] > 1) {
      return interval.join(' ')
    }
  }
  return 'less than a minute'
}

const Neg = () => <Text.span color="error" bold children="NOT" />

const CustomCard = Card.extend`
  ul {
    padding-left: 0;
  }
`

const ApplicationCard = props => {
  const {
    id,
    leader_profiles,
    updated_at,
    created_at,
    submitted_at
  } = props.app
  const { authToken, callback, app } = props

  const leaderProfile = leader_profiles.find(
    profile => profile.user.id == props.userId
  )
  const coLeaderProfiles = leader_profiles.filter(
    profile => profile.user.id != props.userId
  )

  return (
    <Container maxWidth={36} mt={3} p={3}>
      <Flex
        align="center"
        justify="center"
        flexDirection={['column', 'row']}
        mx={[null, -2]}
      >
        <LargeButton.link
          w={1}
          m={2}
          inverted
          to={`/apply/club?id=${id}`}
          children="Edit Application"
        />
        <LargeButton.link
          w={1}
          m={2}
          inverted
          to={`/apply/leader?id=${leaderProfile.id}`}
          children="Edit Leader Profile"
        />
      </Flex>
      <Flex mt={2} mb={4}>
        <SubmitButton authToken={authToken} application={app} />
      </Flex>
      <CustomCard boxShadowSize="md" p={[3, 4]} color="black" bg="snow">
        <Text>You only need a team to apply. Invite them:</Text>
        <LeaderInviteForm id={id} authToken={authToken} callback={callback} />
        <Text>After you submit your application:</Text>
        <ul>
          <li>We’ll get back to you with our decision in 3 days</li>
          <li>
            If you’re accepted, we’ll schedule a call to train you to lead your
            club
          </li>
          <li>
            We’ll give you access to our curriculum, a template for your
            meetings, and our online community of club leaders
          </li>
          <li>
            Once you start holding meetings, we’ll check in with you each week
            to make sure everything is going well
          </li>
        </ul>
        <p>
          Contact us at <A href="mailto:<EMAIL>"><EMAIL></A>{' '}
          if you have any questions while applying.
        </p>
        <ul>
          <li>
            This application was{' '}
            {submitted_at !== null
              ? 'submitted'
              : updated_at === created_at ? 'created' : 'updated'}{' '}
            {timeSince(updated_at)} ago
          </li>
          <li>
            You have {leaderProfile.completed_at ? null : <Neg />} finished your
            leader profile
          </li>
          {coLeaderProfiles.map((profile, index) => (
            <li key={index}>
              <strong>{profile.user.email} </strong>
              {profile.completed_at ? null : (
                <span>
                  has <Neg />{' '}
                </span>
              )}
              finished their leader profile
            </li>
          ))}
        </ul>
        <Text color="slate" f={1}>
          <em>
            * We also accept applications from clubs that have already held
            meetings.
          </em>
        </Text>
      </CustomCard>
    </Container>
  )
}

export default class extends Component {
  constructor(props) {
    super(props)
<commit_msg>Clarify how to successfully apply<commit_after>import React, { Component, Fragment } from 'react'
import Helmet from 'react-helmet'
import { api } from 'data.json'
import {
  ThemeProvider,
  Box,
  Button,
  Card,
  Container,
  Flex,
  Heading,
  LargeButton,
  Link as DSLink,
  Text,
  cx
} from '@hackclub/design-system'
import ApplyNav from 'components/apply/ApplyNav'
import LeaderInviteForm from 'components/apply/LeaderInviteForm'
import Login from 'components/apply/Login'
import SubmitButton from 'components/apply/SubmitButton'
import LoadingAnimation from 'components/LoadingAnimation'
import fetch from 'unfetch'
import Link from 'gatsby-link'

LargeButton.link = LargeButton.withComponent(Link)

const A = DSLink.extend`
  :hover {
    text-decoration: underline;
  }
`

const timeSince = time => {
  const seconds = Math.floor((new Date() - new Date(time)) / 1000)
  const intervals = [
    [Math.floor(seconds / (60 * 60 * 24 * 7)), 'weeks'],
    [Math.floor(seconds / (60 * 60 * 24)), 'days'],
    [Math.floor(seconds / (60 * 60)), 'hours'],
    [Math.floor(seconds / 60), 'minutes']
  ]
  for (var i = 0; i < intervals.length; i++) {
    let interval = intervals[i]
    if (interval[0] > 1) {
      return interval.join(' ')
    }
  }
  return 'less than a minute'
}

const Neg = () => <Text.span color="error" bold children="NOT" />

const ApplicationCard = props => {
  const {
    id,
    leader_profiles,
    updated_at,
    created_at,
    submitted_at
  } = props.app
  const { authToken, callback, app } = props

  const leaderProfile = leader_profiles.find(
    profile => profile.user.id == props.userId
  )
  const coLeaderProfiles = leader_profiles.filter(
    profile => profile.user.id != props.userId
  )

  return (
    <Container maxWidth={36} my={3} p={3}>
      <Card boxShadowSize="md" p={[3, 4]} color="black" bg="snow">
        <Heading.h3>How to get into Hack Club</Heading.h3>
        <Text>
          When reviewing applications, we look for a strong leadership team that has obtained a teacher sponsor to host their club and the support of their school administration.
          Teams should have 2 to 3 co-leads -- we rarely accept solo leaders. 
        </Text>
        <br />
        <Text>Invite your co-leads:</Text>
        <LeaderInviteForm id={id} authToken={authToken} callback={callback} />
        <Text>After you submit your application:</Text>
        <ul>
          <li>We’ll get back to you with our decision in 3 days</li>
          <li>
            If you’re accepted, we’ll schedule a call to train you to lead your
            club
          </li>
          <li>
            We’ll give you access to our curriculum, a template for your
            meetings, and our online community of club leaders
          </li>
          <li>
            Once you start holding meetings, we’ll check in with you each week
            to make sure everything is going well
          </li>
        </ul>
        <p>
          Contact us at <A href="mailto:<EMAIL>"><EMAIL></A>{' '}
          if you have any questions while applying.
        </p>
        <ul>
          <li>
            This application was{' '}
            {submitted_at !== null
              ? 'submitted'
              : updated_at === created_at ? 'created' : 'updated'}{' '}
            {timeSince(updated_at)} ago
          </li>
          <li>
            You have {leaderProfile.completed_at ? null : <Neg />} finished your
            leader profile
          </li>
          {coLeaderProfiles.map((profile, index) => (
            <li key={index}>
              <strong>{profile.user.email} </strong>
              {profile.completed_at ? null : (
                <span>
                  has <Neg />{' '}
                </span>
              )}
              finished their leader profile
            </li>
          ))}
        </ul>
        <Text color="slate" f={1}>
          <em>
            * We also accept applications from clubs that have already held
            meetings.
          </em>
        </Text>
      </Card>
      <Flex
        align="center"
        justify="center"
        flexDirection={['column', 'row']}
        mt={4}
        mx={[null, -2]}
      >
        <LargeButton.link
          w={1}
          m={2}
          inverted
          to={`/apply/club?id=${id}`}
          children="Edit Application"
        />
        <LargeButton.link
          w={1}
          m={2}
          inverted
          to={`/apply/leader?id=${leaderProfile.id}`}
          children="Edit Leader Profile"
        />
      </Flex>
      <Flex mt={2} mb={4}>
        <SubmitButton authToken={authToken} application={app} />
      </Flex>
    </Container>
  )
}

export default class extends Component {
  constructor(props) {
    super(props)

{'fraction_non_alphanumeric': 0.12647154120315368, 'fraction_numerical': 0.009504266119451345, 'mean_word_length': 2.0025940337224384, 'pattern_counts': {'":': 0, '<': 112, '<?xml version=': 0, '>': 124, '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': '4478652', 'n_tokens_mistral': 2821, 'n_tokens_neox': 2735, 'n_words': 779}