diff --git a/phone/src/apps/twitter/components/AddTweetModal.js b/phone/src/apps/twitter/components/AddTweetModal.js
index e1b7af2..cd75644 100644
--- a/phone/src/apps/twitter/components/AddTweetModal.js
+++ b/phone/src/apps/twitter/components/AddTweetModal.js
@@ -25,7 +25,7 @@ const useStyles = makeStyles((theme) => ({
display: "flex",
flexFlow: "column nowrap",
position: "absolute",
- top: "35px",
+ top: "80px",
},
button: {
margin: 5,
diff --git a/phone/src/apps/twitter/components/Tweet.js b/phone/src/apps/twitter/components/Tweet.js
index 5b5dcdd..3f56a52 100644
--- a/phone/src/apps/twitter/components/Tweet.js
+++ b/phone/src/apps/twitter/components/Tweet.js
@@ -1,12 +1,12 @@
import React from "react";
import { useTranslation } from "react-i18next";
import { makeStyles } from "@material-ui/core/styles";
-import ListItemText from "@material-ui/core/ListItemText";
import ListItemAvatar from "@material-ui/core/ListItemAvatar";
import MuiAvatar from "@material-ui/core/Avatar";
import Button from "@material-ui/core/Button";
import Typography from "@material-ui/core/Typography";
import FavoriteBorderIcon from "@material-ui/icons/FavoriteBorder";
+import MoreIcon from "@material-ui/icons/MoreVert";
import { ListItem } from "../../../ui/components/ListItem";
import { secondsToHumanReadable } from "../utils/time";
@@ -30,8 +30,14 @@ const useStyles = makeStyles(() => ({
flexFlow: "column nowrap",
width: "100%",
},
+ primary: {
+ display: "flex",
+ flexFlow: "row nowrap",
+ width: "100%",
+ alignItems: "flex-end",
+ },
profile: {
- fontSize: "24px",
+ fontSize: "22px",
fontWeight: "bold",
},
date: {
@@ -40,6 +46,7 @@ const useStyles = makeStyles(() => ({
},
message: {
fontSize: "20px",
+ color: "rgba(255, 255, 255, 0.7)",
},
buttonContainer: {
display: "flex",
@@ -47,6 +54,7 @@ const useStyles = makeStyles(() => ({
justifyContent: "space-between",
width: "100%",
marginLeft: "-20px", // easier to do this here than override the MUI styles
+ marginTop: "3px",
},
}));
@@ -61,32 +69,9 @@ export const Tweet = (tweet) => {
const classes = useStyles();
const { t } = useTranslation();
- const Primary = () => (
- <>
- {`@${profile_name}`}
-
- {secondsToHumanReadable(t, seconds_since_tweet)}
-
- >
- );
-
// this is a workaround to transfer string new lines and returns that
// are stored into the database into html for the UI to render
const formattedMessage = message.replace(/\n\r?/g, "
");
- const Message = () => (
- <>
-
-
- >
- );
return (
@@ -96,13 +81,31 @@ export const Tweet = (tweet) => {
-
} secondary={
} />
+
+
{`@${profile_name}`}
+
+ {secondsToHumanReadable(t, seconds_since_tweet)}
+
+
+
+
+
diff --git a/phone/src/apps/twitter/components/TweetListContainer.js b/phone/src/apps/twitter/components/TweetListContainer.js
index 19b842d..bd31a93 100644
--- a/phone/src/apps/twitter/components/TweetListContainer.js
+++ b/phone/src/apps/twitter/components/TweetListContainer.js
@@ -2,9 +2,11 @@ import React from "react";
import { useTweets } from "../hooks/useTweets";
import TweetList from "./TweetList";
+import TweetSkeletonList from "./TweetSkeletonList";
export function TweetListContainer() {
const { tweets } = useTweets();
+ if (1 || !tweets) return ;
return ;
}
diff --git a/phone/src/apps/twitter/components/TweetSkeleton.js b/phone/src/apps/twitter/components/TweetSkeleton.js
new file mode 100644
index 0000000..2749229
--- /dev/null
+++ b/phone/src/apps/twitter/components/TweetSkeleton.js
@@ -0,0 +1,12 @@
+import React from "react";
+import Skeleton from "@material-ui/lab/Skeleton";
+
+export default function TweetSkeleton() {
+ return (
+
+
+
+
+
+ );
+}
diff --git a/phone/src/apps/twitter/components/TweetSkeletonList.js b/phone/src/apps/twitter/components/TweetSkeletonList.js
new file mode 100644
index 0000000..2baaf55
--- /dev/null
+++ b/phone/src/apps/twitter/components/TweetSkeletonList.js
@@ -0,0 +1,16 @@
+import React from "react";
+
+import { List } from "../../../ui/components/List";
+import TweetSkeleton from "./TweetSkeleton";
+
+export function TweetSkeletonList() {
+ return (
+
+ {new Array(10).map(() => (
+
+ ))}
+
+ );
+}
+
+export default TweetSkeletonList;
diff --git a/phone/src/apps/twitter/components/TwitterApp.js b/phone/src/apps/twitter/components/TwitterApp.js
index c00e668..ed6df07 100644
--- a/phone/src/apps/twitter/components/TwitterApp.js
+++ b/phone/src/apps/twitter/components/TwitterApp.js
@@ -39,7 +39,7 @@ const PAGE_COMPONENT_MAPPING = {
1: ,
2: ,
};
-const MINIMUM_LOAD_TIME = 750;
+const MINIMUM_LOAD_TIME = 500;
const TWEETS_REFRESH_RATE = 50000000; // TODO move this to twitter config
export const TwitterApp = () => {
@@ -48,8 +48,6 @@ export const TwitterApp = () => {
const [minimumLoadPassed, setMimimumLoadPassed] = useState(false);
const [activePage, setActivePage] = useState(0);
const { profile } = useProfile();
- const { tweets } = useTweets();
-
useEffect(() => {
Nui.send("phone:getOrCreateTwitterProfile", {});
Nui.send("phone:fetchTweets", {});
@@ -80,11 +78,9 @@ export const TwitterApp = () => {
// we add a minimum (but short) load time here so that
// there isn't a quick flash of loading and immediately
// another flash to the tweets screen.
- const hasLoaded = tweets && profile && minimumLoadPassed;
+ const hasLoaded = profile && minimumLoadPassed;
const showTweetButton = hasLoaded && activePage === 0;
- if (!hasLoaded) return ;
-
return (