Giter Site home page Giter Site logo

nusanam / fake-tweet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lluiscamino/fake-tweet

0.0 0.0 0.0 1.81 MB

Tweet React Component

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

License: MIT License

JavaScript 93.37% HTML 1.79% CSS 4.84%

fake-tweet's Introduction

Fake Tweet

Tweet React component. See a live demo.

Example

Fake tweet example

Installation

npm i fake-tweet

Usage

To use the fake-tweet component in your app after having installed it, import the component and its stylesheet:

import React from "react";
import FakeTweet from "fake-tweet";
import "fake-tweet/build/index.css";

function App() {
  const config = {
    user: {
      nickname: "twitter",
      name: "Twitter",
      avatar: "avatar.png",
      verified: true,
      locked: false
    },
    nightMode: false,
    text: "This is a fake tweet",
    image: "",
    date: "3:32 PM · Feb 14, 1997",
    app: "Twitter for iPhone",
    retweets: 32000,
    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
  • NightMode: Set to true to display tweet in night mode
  • Text: The text the tweet will display
  • Image (optional): You can include an image to the tweet
  • Date: A string that represents a date
  • App: For example, "Twitter for iPhone"
  • Retweets: Number of retweets
  • Likes: Number of likes

fake-tweet's People

Contributors

lluiscamino avatar sagar-gavhane avatar

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.