<commit_before>import React from 'react'
import { NavLink } from 'react-router-dom'
import EditTools from './EditTools'
import PreviewTools from './PreviewTools'

import styles from './Toolbar.styl'

export default ({ params, project, layout, theme, onLayoutChanged, onThemeChanged }) => {
  const { username, owner, project: projectName, mode } = params
  const linkBase = ['', username, owner, projectName].join('/').replace('//', '/')

  return (
    <div className={styles.container}>
      <nav role="navigation" className={styles.nav}>
        <NavLink to={linkBase + '/edit'} className={styles.navLink} activeClassName={styles.active}>
          <img src="/public/img/toolbar/edit.png" />
          Edit
        </NavLink>
        <NavLink
          to={linkBase + '/preview'}
          className={styles.navLink}
          activeClassName={styles.active}
        >
          <img src="/public/img/toolbar/preview.png" />
          Preview
        </NavLink>
      </nav>
      {mode === 'edit' && <EditTools />}
      {mode === 'preview' &&
        <PreviewTools
          href={`/preview/${owner || username}/${projectName}`}
          layout={layout}
          theme={theme}
          onLayoutChanged={onLayoutChanged}
          onThemeChanged={onThemeChanged}
        />}
    </div>
  )
}<commit_msg>Revert "Construct proper URL for org projects"<commit_after>import React from 'react'
import { NavLink } from 'react-router-dom'
import EditTools from './EditTools'
import PreviewTools from './PreviewTools'

import styles from './Toolbar.styl'

export default ({ params, project, layout, theme, onLayoutChanged, onThemeChanged }) => {
  const { username, owner, project: projectName, mode } = params
  const linkBase = ['', username, owner, projectName].join('/').replace('//', '/')

  return (
    <div className={styles.container}>
      <nav role="navigation" className={styles.nav}>
        <NavLink to={linkBase + '/edit'} className={styles.navLink} activeClassName={styles.active}>
          <img src="/public/img/toolbar/edit.png" />
          Edit
        </NavLink>
        <NavLink
          to={linkBase + '/preview'}
          className={styles.navLink}
          activeClassName={styles.active}
        >
          <img src="/public/img/toolbar/preview.png" />
          Preview
        </NavLink>
      </nav>
      {mode === 'edit' && <EditTools />}
      {mode === 'preview' &&
        <PreviewTools
          href={`/preview/${username}/${projectName}`}
          layout={layout}
          theme={theme}
          onLayoutChanged={onLayoutChanged}
          onThemeChanged={onThemeChanged}
        />}
    </div>
  )
}
{'fraction_non_alphanumeric': 0.15570672713529857, 'fraction_numerical': 0.0, 'mean_word_length': 2.581867388362652, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 29, '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': '3223447', 'n_tokens_mistral': 735, 'n_tokens_neox': 735, 'n_words': 161}