From c61a46a95327d4145641418723a923805ec07055 Mon Sep 17 00:00:00 2001 From: smolgrrr Date: Thu, 5 Sep 2024 13:40:30 +1000 Subject: [PATCH] add hashtags bar to feeds --- client/src/components/modals/HashtagBar.tsx | 16 +++++++++++ client/src/components/modals/MediaRender.tsx | 28 ++++++++++---------- client/src/components/routes/HashtagPage.tsx | 2 ++ client/src/components/routes/Home.tsx | 2 ++ client/src/components/routes/Thread.tsx | 2 +- 5 files changed, 35 insertions(+), 15 deletions(-) create mode 100644 client/src/components/modals/HashtagBar.tsx diff --git a/client/src/components/modals/HashtagBar.tsx b/client/src/components/modals/HashtagBar.tsx new file mode 100644 index 0000000..4bba51b --- /dev/null +++ b/client/src/components/modals/HashtagBar.tsx @@ -0,0 +1,16 @@ +const DefaultHashtags = ['asknostr', 'kinostr', 'technology']; + +export default function HashtagBar() { + + return ( +
+ +
+ ); +} diff --git a/client/src/components/modals/MediaRender.tsx b/client/src/components/modals/MediaRender.tsx index 66e7d54..670f821 100644 --- a/client/src/components/modals/MediaRender.tsx +++ b/client/src/components/modals/MediaRender.tsx @@ -22,20 +22,20 @@ const checkMedia = async (url: string) => { }); const nsfwResult = await nsfwResponse.json(); - // PicPurify gore check - const picpurifyResponse = await fetch('https://www.picpurify.com/analyse/1.1', { - method: 'POST', - body: new URLSearchParams({ - 'API_KEY': picpurifyApiKey, - 'task': 'gore_moderation', - 'url_image': url - }) - }); - const picpurifyResult = await picpurifyResponse.json(); + // // PicPurify gore check + // const picpurifyResponse = await fetch('https://www.picpurify.com/analyse/1.1', { + // method: 'POST', + // body: new URLSearchParams({ + // 'API_KEY': picpurifyApiKey, + // 'task': 'gore_moderation', + // 'url_image': url + // }) + // }); + // const picpurifyResult = await picpurifyResponse.json(); return { nsfw: nsfwResult, - gore: picpurifyResult + // gore: picpurifyResult }; } catch (error) { console.error("Error checking media:", error); @@ -63,7 +63,7 @@ const RenderMedia = ({ files }: { files: string[] }) => { ...prev, [file]: { nsfwLabel: result.nsfw?.data?.predictedLabel, - goreContent: result.gore?.gore_moderation?.gore_content + // goreContent: result.gore?.gore_moderation?.gore_content } })); } else { @@ -85,7 +85,7 @@ const RenderMedia = ({ files }: { files: string[] }) => { const mediaCheckResult = mediaCheckResults[file]; // Check for both NSFW and gore content - if (mediaCheckResult && (mediaCheckResult.nsfwLabel !== 'neutral' || mediaCheckResult.goreContent)) { + if (mediaCheckResult && (mediaCheckResult.nsfwLabel !== 'neutral')) { return (

Attached media has been flagged as not safe for work or contains gore.

@@ -93,7 +93,7 @@ const RenderMedia = ({ files }: { files: string[] }) => { ); } - if (file && (file.endsWith(".mp4") || file.endsWith(".webm")) && mediaCheckResult && mediaCheckResult.nsfwLabel === 'neutral') { + if (file && (file.endsWith(".mp4") || file.endsWith(".webm"))) { return (