diff --git a/src/features/posts/Post.css b/src/features/posts/Post.css index 3395be0..a10a34a 100644 --- a/src/features/posts/Post.css +++ b/src/features/posts/Post.css @@ -64,6 +64,19 @@ img, video { color: rgb(97, 49, 95); } +.gallery-statement { + color: rgb(228, 180, 226); +} + +.gallery-statement a { + color: white; + text-decoration: none; +} + +.gallery-statement a:active { + color:rgb(97, 49, 95); +} + .num-comments { display: inline-flex; background-color: #7196be; diff --git a/src/features/posts/Post.js b/src/features/posts/Post.js index 6aa6fd1..330f688 100644 --- a/src/features/posts/Post.js +++ b/src/features/posts/Post.js @@ -1,6 +1,7 @@ import React, { useState, useEffect } from "react"; // import { useDispatch } from "react-redux"; import Discussion from "../discussion/Discussion"; +import VideoPlayer from "../video/VideoPlayer"; import './Post.css'; export default function Post({data, key}) { @@ -14,11 +15,6 @@ export default function Post({data, key}) { let media = data.post_hint === 'image' && data.url; let permalink = data.permalink; let selftext = data.selftext; - let video = data.is_video ? `${data.url}/DASH_1080.mp4` : null; // to do: handle media edge cases, especially video - - // fallback_url: "https://v.redd.it/0rditq5l49g81/DASH_1080.mp4?source=fallback" - // url: "https://v.redd.it/0rditq5l49g81" - // id: "sm2wym" const limit = 300; const [body, setBody] = useState(selftext); @@ -90,6 +86,10 @@ export default function Post({data, key}) { return; } } + + // Render function below: + // Each is preceded by a conditional so the program does not throw an error + // before the fetch requests' promises are fulfilled. return ( <> @@ -99,17 +99,16 @@ export default function Post({data, key}) { {title} :
[untitled]
} - {media ?View the gallery of photos corresponding to this post here.
+View the gallery of photos corresponding to this post here.
: null} {data.is_video ? - +