1.0.7 • Published 4 years ago

react-fake-tweet v1.0.7

Weekly downloads
6
License
MIT
Repository
github
Last release
4 years ago

react-fake-tweet

React renderer for tweets.

NPM JavaScript Style Guide

This project is a fork of fake-tweet by Lluís Camino with the following improvements:

  • Uses CSS modules to not pollute CSS namespace
  • Allows you to override className, style, etc on root element
  • Smaller bundle size via microbundle
  • Fixes some style issues
  • Used in production by twitter-search.io

Install

npm install --save react-fake-tweet

Usage

import React, { Component } from 'react'

import { Tweet } from 'react-fake-tweet'
import 'react-fake-tweet/dist/index.css'

const tweet = {
  /* ... */
}

class Example extends Component {
  render() {
    return (
      <Tweet
        config={{
          user: {
            avatar: tweet.user.profile_image_url,
            nickname: tweet.user.screen_name,
            name: tweet.user.name
          },
          text: tweet.text,
          date: Date.now(),
          retweets: tweet.retweet_count,
          likes: tweet.favorite_count
        }}
      />
    )
  }
}

Related

  • react-tweet-embed - Embeds a tweet using Twitter's official embedding SDK.
    • Significantly more accurate and robust
    • Slightly more heavy-weight
    • No way that I'm aware of to fake the resulting tweet's content

License

MIT © transitive-bullshit

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.1.0

4 years ago