import React from 'react'; import { Link } from 'react-router'; import classNames from 'classnames'; import ImagePreview from './ImagePreview'; import * as utils from '../utils'; export default class Article extends React.Component { constructor(props) { super(props); this.imgToPreview = this.imgToPreview.bind(this); } isPreviewImg(string) { return /^ 1; const previewClassName = classNames({ 'preview-image-boxes': true, clearfix: true, 'preview-image-boxes-with-popup': hasPopup, }); return ; } render() { const { content, location } = this.props; const jumper = content.description.filter((node) => { return node.type === 'h2'; }).map((node) => { return (
  • { node.children }
  • ); }); content.description = content.description.map(this.imgToPreview); return (

    { content.meta.chinese || content.meta.english } { !content.meta.subtitle ? null : { content.meta.subtitle } }

    { !content.intro ? null : content.intro.map(utils.objectToComponent.bind(null, location.pathname)) } { jumper.length > 0 ?
      { jumper }
    : null } { content.description.map(utils.objectToComponent.bind(null, location.pathname)) }
    ); } }