0.1.0 • Published 6 years ago

@jonasknutsen/wp-react-components v0.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
6 years ago

wp-react-coponents

Simple helper components in React, that takes values WordPress posts.

Install and use

npm install @jonasknutsen/wp-react-components

import React from 'react'
import {PostDate} from '@jonasknutsen/wp-react-components'

export default class Example extends React.Component {
  const {post} = this.props
  render () {
    return (
      <div>
        <PostDate post={post} />
      </div>
    )
  }
}

Components

PostDate

PropsValueDefaultRequiredComment
postobjecttrueThe WordPress post
publishedTextstring'Published'falseText before published date
modifiedTextstring'Modified'falseText before modified date
classNamestringfalseClass name for outer div

PostDateInline

PropsValueDefaultRequiredComment
postobjecttrueThe WordPress post
publishedTextstring'Published'falseText before published date
modifiedTextstring'Modified'falseText before modified date
classNamestringfalseClass name for outer span
showDiffboolfalsefalseShow modified date, if applicable