Coder Social home page Coder Social logo

lluiscamino / fake-tweet Goto Github PK

View Code? Open in Web Editor NEW
111.0 4.0 20.0 2.48 MB

Tweet React Component

Home Page: https://lluiscamino.github.io/fake-tweet/

License: MIT License

JavaScript 1.39% HTML 1.12% CSS 23.85% TypeScript 73.65%
tweet twitter react react-component

fake-tweet's Introduction

Fake Tweet

Tweet React component. See a live demo.

Example

Fake tweet example

Installation

npm i fake-tweet

Usage

The following snippet is an example of use of the fake-tweet component:

import React from "react";
import FakeTweet from "fake-tweet";

function App() {
  const config = {
    user: {
      nickname: "twitter",
      name: "Twitter",
      avatar: "avatar.png",
      verified: true,
      locked: false
    },
    display: "default",
    text: "This is a fake tweet",
    image: "",
    date: "3:32 PM · Feb 14, 1997",
    app: "Twitter for iPhone",
    retweets: 32000,
    quotedTweets: 100,
    likes: 12700
  };
  return (
    <div className="App">
      <FakeTweet config={config} />
    </div>
  );
}

export default App;

You also need to pass a config object to the component with the following properties:

  • User:
    • Nickname: Twitter @username
    • Name
    • Avatar: Twitter avatar URL
    • Verified: Set to true to include the verified icon
    • Locked: Set to true to include the private account icon
  • Display: Twitter theme (default, dim or lightsout)
  • Text: The text the tweet will display
  • Image (optional): You can include an image to the tweet. Can be either a single URL string or an array of up to four URL strings for multiple images.
  • Date: A string that represents a date
  • App: For example, "Twitter for iPhone"
  • Retweets: Number of retweets
  • Quoted Tweets: Number of quoted tweets
  • Likes: Number of likes

fake-tweet's People

Contributors

dependabot[bot] avatar dgca avatar lluiscamino avatar sagar-gavhane avatar sno2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fake-tweet's Issues

Add support for URLs

If a URL is present on the tweet and, it should be displayed according to Twitter cards docs.

If the site has no twitter:card metatag, then the URL should be displayed as a regular link.

Add normal node support

Perhaps make it so this is not limited to just react. I wanna use this on other node projects.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.