-
-
-
-

+
+ {handleClick && (
+
+
+
+ )}
+
);
};
-export default MediaImage;
+export default Image;
diff --git a/phone/src/apps/twitter/components/ImageDisplay.js b/phone/src/apps/twitter/components/ImageDisplay.js
new file mode 100644
index 0000000..d8ff9a5
--- /dev/null
+++ b/phone/src/apps/twitter/components/ImageDisplay.js
@@ -0,0 +1,35 @@
+import React from "react";
+import { makeStyles } from "@material-ui/core/styles";
+
+import Image from "./Image";
+
+const useStyles = makeStyles((theme) => ({
+ root: {
+ margin: "2px 15px",
+ },
+}));
+
+export const ImageDisplay = ({ visible, images, removeImage, small }) => {
+ const classes = useStyles();
+ if (!visible || !images || images.length === 0) return null;
+
+ return (
+
+ {images.map((link) => (
+ removeImage(link) : null}
+ small={small}
+ />
+ ))}
+
+ );
+};
+
+ImageDisplay.defaultProps = {
+ removeImage: null,
+ small: false,
+};
+
+export default ImageDisplay;
diff --git a/phone/src/apps/twitter/components/MediaPrompt.js b/phone/src/apps/twitter/components/ImagePrompt.js
similarity index 82%
rename from phone/src/apps/twitter/components/MediaPrompt.js
rename to phone/src/apps/twitter/components/ImagePrompt.js
index 2bec2b0..d1eae2e 100644
--- a/phone/src/apps/twitter/components/MediaPrompt.js
+++ b/phone/src/apps/twitter/components/ImagePrompt.js
@@ -14,7 +14,7 @@ const useStyles = makeStyles((theme) => ({
},
}));
-export const MediaPrompt = ({ visible, value, handleChange }) => {
+export const ImagePrompt = ({ visible, value, handleChange }) => {
const { t } = useTranslation();
const classes = useStyles();
@@ -27,9 +27,9 @@ export const MediaPrompt = ({ visible, value, handleChange }) => {
onChange={handleChange}
multiline
size="small"
- placeholder={t("APPS_TWITTER_MEDIA_PLACEHOLDER")}
+ placeholder={t("APPS_TWITTER_IMAGE_PLACEHOLDER")}
/>
);
};
-export default MediaPrompt;
+export default ImagePrompt;
diff --git a/phone/src/apps/twitter/components/MediaDisplay.js b/phone/src/apps/twitter/components/MediaDisplay.js
deleted file mode 100644
index f0a46f6..0000000
--- a/phone/src/apps/twitter/components/MediaDisplay.js
+++ /dev/null
@@ -1,41 +0,0 @@
-import React from "react";
-import { makeStyles } from "@material-ui/core/styles";
-
-import types from "../types";
-
-const useStyles = makeStyles((theme) => ({
- root: {
- margin: "2px 15px",
- },
-}));
-
-import MediaImage from "./MediaImage";
-
-export const Media = ({ id, mediaType, mediaLink, handleClose }) => {
- switch (mediaType) {
- case types.IMAGE:
- case types.GIF:
- return
;
- default:
- return null;
- }
-};
-
-export const MediaDisplay = ({ visible, media, removeMedia }) => {
- const classes = useStyles();
- if (!visible || media.length === 0) return null;
-
- return (
-
- {media.map((mediaItem) => (
- removeMedia(mediaItem.id)}
- {...mediaItem}
- />
- ))}
-
- );
-};
-
-export default MediaDisplay;
diff --git a/phone/src/apps/twitter/components/Tweet.js b/phone/src/apps/twitter/components/Tweet.js
index 57076fe..32c8548 100644
--- a/phone/src/apps/twitter/components/Tweet.js
+++ b/phone/src/apps/twitter/components/Tweet.js
@@ -7,6 +7,7 @@ import ReplyIcon from "@material-ui/icons/Reply";
import QuoteIcon from "@material-ui/icons/FormatQuote";
import { ListItem } from "../../../ui/components/ListItem";
+import ImageDisplay from "./ImageDisplay";
const useStyles = makeStyles((theme) => ({
root: {
@@ -26,11 +27,14 @@ const useStyles = makeStyles((theme) => ({
},
}));
-export const Tweet = ({ message, media }) => {
+export const Tweet = (tweet) => {
+ const { message, images } = tweet;
const classes = useStyles();
+
return (
+