From 2c18df6dd50a0992521ae9a8cee68dd8074afa73 Mon Sep 17 00:00:00 2001 From: Sasi Date: Mon, 13 Nov 2023 16:01:00 +0530 Subject: [PATCH] chore: cleanup (#1136) --- apps/api/lib/getPublicationOembed.ts | 2 +- apps/embed/package.json | 2 +- .../src/components/Bangers/RenderBanger.tsx | 9 +++++--- apps/web/src/components/Bytes/ByteActions.tsx | 6 ++--- .../Common/{EmbedVideo.tsx => EmbedMedia.tsx} | 23 +++++++++++++------ ...{MirrorVideo.tsx => MirrorPublication.tsx} | 8 +++---- .../Common/Publication/PublicationActions.tsx | 16 ++++++------- .../src/components/Common/VideoCard/Share.tsx | 10 ++++---- 8 files changed, 43 insertions(+), 33 deletions(-) rename apps/web/src/components/Common/{EmbedVideo.tsx => EmbedMedia.tsx} (74%) rename apps/web/src/components/Common/{MirrorVideo.tsx => MirrorPublication.tsx} (97%) diff --git a/apps/api/lib/getPublicationOembed.ts b/apps/api/lib/getPublicationOembed.ts index 46612548f..8926b3310 100644 --- a/apps/api/lib/getPublicationOembed.ts +++ b/apps/api/lib/getPublicationOembed.ts @@ -79,7 +79,7 @@ const getPublicationOembed = async (publicationId: string, format: string) => { + }" title="${TAPE_APP_NAME} player" frameborder="0" allow="accelerometer; autoplay; clipboard-write;" allowfullscreen="true"> ` } diff --git a/apps/embed/package.json b/apps/embed/package.json index 23ccb006e..30e4446ab 100644 --- a/apps/embed/package.json +++ b/apps/embed/package.json @@ -1,6 +1,6 @@ { "name": "@tape.xyz/embed", - "description": "Embed Video Player", + "description": "Embed Player", "version": "0.0.0", "private": true, "scripts": { diff --git a/apps/web/src/components/Bangers/RenderBanger.tsx b/apps/web/src/components/Bangers/RenderBanger.tsx index 32610d90f..a688a825d 100644 --- a/apps/web/src/components/Bangers/RenderBanger.tsx +++ b/apps/web/src/components/Bangers/RenderBanger.tsx @@ -1,5 +1,5 @@ import SignOutline from '@components/Common/Icons/SignOutline' -import MirrorVideo from '@components/Common/MirrorVideo' +import MirrorPublication from '@components/Common/MirrorPublication' import PublicationReaction from '@components/Common/Publication/PublicationReaction' import { getDateString, getRelativeTime } from '@lib/formatTime' import { Button, Text } from '@radix-ui/themes' @@ -30,14 +30,17 @@ const RenderBanger = ({ post }: { post: PrimaryPublication }) => {
- +
-
+
{getRelativeTime(post.createdAt)} diff --git a/apps/web/src/components/Bytes/ByteActions.tsx b/apps/web/src/components/Bytes/ByteActions.tsx index f5ee07308..934b00df1 100644 --- a/apps/web/src/components/Bytes/ByteActions.tsx +++ b/apps/web/src/components/Bytes/ByteActions.tsx @@ -2,7 +2,7 @@ import CollectOutline from '@components/Common/Icons/CollectOutline' import CommentOutline from '@components/Common/Icons/CommentOutline' import MirrorOutline from '@components/Common/Icons/MirrorOutline' import TimesOutline from '@components/Common/Icons/TimesOutline' -import MirrorVideo from '@components/Common/MirrorVideo' +import MirrorPublication from '@components/Common/MirrorPublication' import PublicationOptions from '@components/Common/Publication/PublicationOptions' import PublicationReaction from '@components/Common/Publication/PublicationReaction' import OpenActions from '@components/Watch/OpenActions' @@ -65,7 +65,7 @@ const ByteActions: FC = ({ video }) => {
- + - +
diff --git a/apps/web/src/components/Common/EmbedVideo.tsx b/apps/web/src/components/Common/EmbedMedia.tsx similarity index 74% rename from apps/web/src/components/Common/EmbedVideo.tsx rename to apps/web/src/components/Common/EmbedMedia.tsx index e4fa85b69..c6225c7d6 100644 --- a/apps/web/src/components/Common/EmbedVideo.tsx +++ b/apps/web/src/components/Common/EmbedMedia.tsx @@ -3,6 +3,7 @@ import { Card, Dialog, Flex, IconButton } from '@radix-ui/themes' import { useCopyToClipboard } from '@tape.xyz/browser' import { TAPE_APP_NAME, TAPE_EMBED_URL } from '@tape.xyz/constants' import { EVENTS, Tower } from '@tape.xyz/generic' +import clsx from 'clsx' import type { FC } from 'react' import React from 'react' @@ -11,13 +12,18 @@ import CopyOutline from './Icons/CopyOutline' import TimesOutline from './Icons/TimesOutline' type Props = { - videoId: string + publicationId: string + isAudio: boolean } -const EmbedVideo: FC = ({ videoId }) => { +const EmbedMedia: FC = ({ publicationId, isAudio }) => { const [copy] = useCopyToClipboard() - const iframeCode = `` + let iframeCode = `` + + if (isAudio) { + iframeCode = `` + } const onCopyCode = () => { copy(iframeCode) @@ -54,9 +60,12 @@ const EmbedVideo: FC = ({ videoId }) => {