├── example ├── .npmignore ├── images │ ├── npm-icon.png │ └── github-icon.png ├── index.html ├── tsconfig.json ├── package.json ├── index.css └── index.tsx ├── scrutinizer.yml ├── .gitignore ├── example.png ├── src ├── index.tsx ├── types │ ├── UserData.ts │ └── TweetConfig.ts ├── components │ ├── tweet │ │ ├── Metadata.tsx │ │ ├── Content.tsx │ │ ├── Tweet.tsx │ │ ├── Actions.tsx │ │ ├── UserInfo.tsx │ │ ├── Impact.tsx │ │ ├── ImagesContainer.tsx │ │ └── Tweet.css │ └── icons │ │ ├── DropIcon.tsx │ │ ├── LikeIcon.tsx │ │ ├── ShareIcon.tsx │ │ ├── CommentIcon.tsx │ │ ├── LockIcon.tsx │ │ ├── RetweetIcon.tsx │ │ └── VerifiedIcon.tsx └── hooks │ ├── useDisplay.tsx │ ├── useImage.tsx │ └── useText.tsx ├── jest.config.js ├── .github └── workflows │ ├── size.yml │ └── main.yml ├── tsdx.config.js ├── test └── index.test.tsx ├── LICENSE ├── tsconfig.json ├── README.md └── package.json /example/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .cache 3 | dist -------------------------------------------------------------------------------- /scrutinizer.yml: -------------------------------------------------------------------------------- 1 | build: 2 | environment: 3 | node: v14.0 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | .DS_Store 3 | node_modules 4 | .cache 5 | dist 6 | .idea 7 | -------------------------------------------------------------------------------- /example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lluiscamino/fake-tweet/HEAD/example.png -------------------------------------------------------------------------------- /src/index.tsx: -------------------------------------------------------------------------------- 1 | import Tweet from './components/tweet/Tweet'; 2 | 3 | export default Tweet; 4 | -------------------------------------------------------------------------------- /example/images/npm-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lluiscamino/fake-tweet/HEAD/example/images/npm-icon.png -------------------------------------------------------------------------------- /example/images/github-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lluiscamino/fake-tweet/HEAD/example/images/github-icon.png -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | //jest.config.js 2 | 3 | module.exports = { 4 | moduleNameMapper: { 5 | "\\.(css|sass)$": "identity-obj-proxy", 6 | }, 7 | }; 8 | -------------------------------------------------------------------------------- /src/types/UserData.ts: -------------------------------------------------------------------------------- 1 | type UserData = { 2 | nickname: string; 3 | name: string; 4 | avatar: string; 5 | verified: boolean; 6 | locked: boolean; 7 | }; 8 | 9 | export default UserData; 10 | -------------------------------------------------------------------------------- /.github/workflows/size.yml: -------------------------------------------------------------------------------- 1 | name: size 2 | on: [pull_request] 3 | jobs: 4 | size: 5 | runs-on: ubuntu-latest 6 | env: 7 | CI_JOB_NUMBER: 1 8 | steps: 9 | - uses: actions/checkout@v1 10 | - uses: andresz1/size-limit-action@v1 11 | with: 12 | github_token: ${{ secrets.GITHUB_TOKEN }} 13 | -------------------------------------------------------------------------------- /src/types/TweetConfig.ts: -------------------------------------------------------------------------------- 1 | import UserData from './UserData'; 2 | 3 | type TweetConfig = { 4 | user: UserData; 5 | display: string; 6 | text: string; 7 | image?: string | string[]; 8 | date: string; 9 | app: string; 10 | retweets: number; 11 | quotedTweets: number; 12 | likes: number; 13 | }; 14 | 15 | export default TweetConfig; 16 | -------------------------------------------------------------------------------- /src/components/tweet/Metadata.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import TweetConfig from '../../types/TweetConfig'; 3 | 4 | function Metadata({ config }: { config: TweetConfig }) { 5 | return ( 6 |