Skip to content

Commit

Permalink
rename gifmedia comp; remove tenormedia comp; update commentrevisionc…
Browse files Browse the repository at this point in the history
…ontainer
  • Loading branch information
kabeaty committed Sep 30, 2024
1 parent 65e9696 commit 400c4c0
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface Props {
url: string | null;
}

const GiphyMedia: FunctionComponent<Props> = ({
const GifMedia: FunctionComponent<Props> = ({
still,
title,
width,
Expand Down Expand Up @@ -111,4 +111,4 @@ const GiphyMedia: FunctionComponent<Props> = ({
);
};

export default GiphyMedia;
export default GifMedia;
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { withFragmentContainer } from "coral-framework/lib/relay";
import { MediaContainer_comment } from "coral-admin/__generated__/MediaContainer_comment.graphql";

import ExternalMedia from "./ExternalMedia";
import GiphyMedia from "./GiphyMedia";
import GifMedia from "./GifMedia";
import TwitterMedia from "./TwitterMedia";
import YouTubeMedia from "./YouTubeMedia";

Expand All @@ -23,7 +23,7 @@ const MediaContainer: FunctionComponent<Props> = ({ comment }) => {
switch (media.__typename) {
case "GiphyMedia":
return (
<GiphyMedia
<GifMedia
still={media.still}
video={media.video}
title={media.title}
Expand Down Expand Up @@ -60,7 +60,7 @@ const MediaContainer: FunctionComponent<Props> = ({ comment }) => {
);
case "TenorMedia":
return (
<GiphyMedia
<GifMedia
still={media.tenorStill}
video={media.tenorVideo}
title={media.title}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { default as MediaContainer } from "./MediaContainer";
export { default as GiphyMedia } from "./GiphyMedia";
export { default as GifMedia } from "./GifMedia";
export { default as TwitterMedia } from "./TwitterMedia";
export { default as YouTubeMedia } from "./YouTubeMedia";
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ import { graphql } from "react-relay";
import { withFragmentContainer } from "coral-framework/lib/relay";
import { HorizontalGutter, Timestamp } from "coral-ui/components/v2";
import ExternalMedia from "../MediaContainer/ExternalMedia";
import GiphyMedia from "../MediaContainer/GiphyMedia";
import GifMedia from "../MediaContainer/GifMedia";
import TwitterMedia from "../MediaContainer/TwitterMedia";
import YouTubeMedia from "../MediaContainer/YouTubeMedia";

import { CommentRevisionContainer_comment as CommentData } from "coral-admin/__generated__/CommentRevisionContainer_comment.graphql";

import { CommentContent } from "../Comment";
import TenorMedia from "../MediaContainer/TenorMedia";

interface Props {
comment: CommentData;
Expand All @@ -33,12 +32,13 @@ const CommentRevisionContainer: FunctionComponent<Props> = ({ comment }) => {
<Timestamp>{c.createdAt}</Timestamp>
<CommentContent>{c.body ? c.body : ""}</CommentContent>
{c.media && c.media.__typename === "GiphyMedia" && (
<GiphyMedia
<GifMedia
still={c.media.still}
video={c.media.video}
title={c.media.title}
width={c.media.width}
height={c.media.height}
url={c.media.url}
/>
)}
{c.media && c.media.__typename === "ExternalMedia" && (
Expand All @@ -65,7 +65,14 @@ const CommentRevisionContainer: FunctionComponent<Props> = ({ comment }) => {
/>
)}
{c.media && c.media.__typename === "TenorMedia" && (
<TenorMedia url={c.media.url} title={c.media.title} />
<GifMedia
still={c.media.tenorStill}
video={c.media.tenorVideo}
title={c.media.title}
width={c.media.width}
height={c.media.height}
url={c.media.url}
/>
)}
</div>
))}
Expand Down Expand Up @@ -100,6 +107,10 @@ const enhanced = withFragmentContainer<Props>({
... on TenorMedia {
url
title
width
height
tenorStill: still
tenorVideo: video
}
... on TwitterMedia {
url
Expand Down

0 comments on commit 400c4c0

Please sign in to comment.