mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-03 06:28:51 +00:00
working tweets skeleton
This commit is contained in:
1 parent
2f52579635
commit
b2b69365ba
5 files changed
+47
-14
No files matched your search
@@ -2,8 +2,10 @@ import React from "react";
|
||||
|
||||
import { List } from "../../../ui/components/List";
|
||||
import Tweet from "./Tweet";
|
||||
import TweetSkeletonList from "./TweetSkeletonList";
|
||||
|
||||
export function TweetList({ tweets }) {
|
||||
if (!tweets) return <TweetSkeletonList />;
|
||||
return (
|
||||
<List>
|
||||
{tweets.map((tweet) => (
|
||||
|
||||
@@ -1,12 +1,39 @@
|
||||
import React from "react";
|
||||
import Divider from "@material-ui/core/Divider";
|
||||
import { makeStyles } from "@material-ui/core/styles";
|
||||
import Skeleton from "@material-ui/lab/Skeleton";
|
||||
|
||||
const useStyles = makeStyles({
|
||||
root: {
|
||||
width: "100%",
|
||||
padding: "15px",
|
||||
display: "flex",
|
||||
flexFlow: "row nowrap",
|
||||
marginTop: "3px",
|
||||
marginBottom: "3px",
|
||||
},
|
||||
left: {},
|
||||
right: {
|
||||
marginLeft: "15px",
|
||||
marginTop: "-5px",
|
||||
},
|
||||
});
|
||||
|
||||
export default function TweetSkeleton() {
|
||||
const classes = useStyles();
|
||||
return (
|
||||
<div>
|
||||
<Skeleton variant="text" />
|
||||
<Skeleton variant="circle" width={40} height={40} />
|
||||
<Skeleton variant="rect" width={210} height={118} />
|
||||
</div>
|
||||
<>
|
||||
<div className={classes.root}>
|
||||
<div className={classes.left}>
|
||||
<Skeleton variant="circle" width={60} height={60} />
|
||||
</div>
|
||||
<div className={classes.right}>
|
||||
<Skeleton variant="text" />
|
||||
<Skeleton variant="rect" width={250} height={118} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Divider />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -6,9 +6,16 @@ import TweetSkeleton from "./TweetSkeleton";
|
||||
export function TweetSkeletonList() {
|
||||
return (
|
||||
<List>
|
||||
{new Array(10).map(() => (
|
||||
<TweetSkeleton />
|
||||
))}
|
||||
<TweetSkeleton />
|
||||
<TweetSkeleton />
|
||||
<TweetSkeleton />
|
||||
<TweetSkeleton />
|
||||
<TweetSkeleton />
|
||||
<TweetSkeleton />
|
||||
<TweetSkeleton />
|
||||
<TweetSkeleton />
|
||||
<TweetSkeleton />
|
||||
<TweetSkeleton />
|
||||
</List>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useState, useEffect } from "react";
|
||||
import React, { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { makeStyles } from "@material-ui/core/styles";
|
||||
import { TextField } from "@material-ui/core";
|
||||
@@ -6,7 +6,6 @@ import TweetList from "./TweetList";
|
||||
|
||||
import Nui from "../../../os/nui-events/utils/Nui";
|
||||
import SearchButton from "./SearchButton";
|
||||
import { useTweets } from "../hooks/useTweets";
|
||||
import { useFilteredTweets } from "../hooks/useFilteredTweets";
|
||||
|
||||
const useStyles = makeStyles({
|
||||
@@ -27,10 +26,6 @@ function TwitterSearch() {
|
||||
const [searchValue, setSearchValue] = useState("");
|
||||
const { tweets, setTweets } = useFilteredTweets();
|
||||
|
||||
useEffect(() => {
|
||||
setTweets(null); // clear the filtered tweets on app load
|
||||
});
|
||||
|
||||
const handleChange = (e) => setSearchValue(e.target.value);
|
||||
|
||||
const handleSubmit = () => {
|
||||
|
||||
@@ -7,6 +7,8 @@ Config.KeyTakeCall = 38 -- E
|
||||
Config.PhoneAsItem = false
|
||||
|
||||
Config.twitter = {}
|
||||
Config.twitter.registerByName = true -- if users can register by first_name and last_name from the users table
|
||||
Config.twitter.registerByPhoneNumber = true -- if users can register by phone_number from the users table
|
||||
Config.twitter.characterLimit = 240
|
||||
Config.twitter.allowEdtiableProfileName = true
|
||||
Config.twitter.showAvatars = true
|
||||
|
||||
Reference in new issue
Block a user