From 359031c1df344a2eea81c571b1fceb60bca453e1 Mon Sep 17 00:00:00 2001 From: "plebeius.eth" Date: Mon, 6 May 2024 22:49:23 +0200 Subject: [PATCH 01/12] fix(post form): close after publish, reset fields --- src/components/post-form/post-form.tsx | 32 ++++++++++++++++++-------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/src/components/post-form/post-form.tsx b/src/components/post-form/post-form.tsx index 2a58b31f..eb384f4a 100644 --- a/src/components/post-form/post-form.tsx +++ b/src/components/post-form/post-form.tsx @@ -58,17 +58,30 @@ const LinkTypePreviewer = ({ link }: { link: string }) => { return isValidURL(link) ? mediaInfo?.type : 'Invalid URL'; }; -const PostFormTable = () => { +const PostFormTable = ({ closeForm }: { closeForm: () => void }) => { const { t } = useTranslation(); const account = useAccount(); const { displayName } = account?.author || {}; - const [url, setUrl] = useState(''); - const { title, content, link, publishCommentOptions, setSubmitStore, resetSubmitStore } = useSubmitStore(); - const { index, publishComment } = usePublishComment(publishCommentOptions); + const textRef = useRef(null); + const urlRef = useRef(null); + const subjectRef = useRef(null); + + const resetFields = () => { + if (textRef.current) { + textRef.current.value = ''; + } + if (urlRef.current) { + urlRef.current.value = ''; + } + if (subjectRef.current) { + subjectRef.current.value = ''; + } + }; + const onPublishPost = () => { if (!title && !content && !link) { alert(`Cannot post empty comment`); @@ -96,6 +109,7 @@ const PostFormTable = () => { useEffect(() => { if (typeof index === 'number') { resetSubmitStore(); + resetFields(); navigate(`/profile/${index}`); } }, [index, resetSubmitStore, navigate]); @@ -106,9 +120,6 @@ const PostFormTable = () => { const cid = params?.commentCid as string; const { setContent, resetContent, replyIndex, publishReply } = useReply({ cid, subplebbitAddress }); - const textRef = useRef(null); - const urlRef = useRef(null); - const onPublishReply = () => { const currentContent = textRef.current?.value || ''; const currentUrl = urlRef.current?.value || ''; @@ -128,6 +139,8 @@ const PostFormTable = () => { useEffect(() => { if (typeof replyIndex === 'number') { resetContent(); + resetFields(); + closeForm(); } }, [replyIndex, resetContent]); @@ -152,6 +165,7 @@ const PostFormTable = () => { { setSubmitStore({ title: e.target.value }); }} @@ -234,7 +248,7 @@ const PostForm = () => { ] ) : ( - + setShowForm(false)} /> )}
@@ -249,7 +263,7 @@ const PostForm = () => { - {showForm && } + {showForm && setShowForm(false)} />} )}
From b785d00ec429214d6ca805941367b8e5b1c3c25d Mon Sep 17 00:00:00 2001 From: "plebeius.eth" Date: Mon, 6 May 2024 22:49:55 +0200 Subject: [PATCH 02/12] fix(post): don't show replies in pending post page --- src/components/post/post.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/post/post.tsx b/src/components/post/post.tsx index 7762c7fa..de9d69da 100644 --- a/src/components/post/post.tsx +++ b/src/components/post/post.tsx @@ -5,7 +5,7 @@ import { Role, useAccount, useSubplebbit } from '@plebbit/plebbit-react-hooks'; import Plebbit from '@plebbit/plebbit-js/dist/browser/index.js'; import { getCommentMediaInfo, getHasThumbnail } from '../../lib/utils/media-utils'; import { getFormattedDate } from '../../lib/utils/time-utils'; -import { isPostPageView } from '../../lib/utils/view-utils'; +import { isPendingPostView, isPostPageView } from '../../lib/utils/view-utils'; import useCountLinksInReplies from '../../hooks/use-count-links-in-replies'; import useReplies from '../../hooks/use-replies'; import useStateString from '../../hooks/use-state-string'; @@ -39,6 +39,7 @@ const PostDesktop = ({ openReplyModal, post, roles, showAllReplies }: PostProps) const params = useParams(); const location = useLocation(); const isInPostPage = isPostPageView(location.pathname, params); + const isPendingPostPage = isPendingPostView(location.pathname, params); const displayTitle = title && title.length > 75 ? title?.slice(0, 75) + '...' : title; const displayContent = content && !isInPostPage && content.length > 1000 ? content?.slice(0, 1000) + '(...)' : content; @@ -212,6 +213,7 @@ const PostDesktop = ({ openReplyModal, post, roles, showAllReplies }: PostProps) )} {!(pinned && !isInPostPage) && + !isPendingPostPage && !isDescription && !isRules && replies && @@ -373,6 +375,7 @@ const PostMobile = ({ openReplyModal, post, roles, showAllReplies }: PostProps) const params = useParams(); const location = useLocation(); const isInPostPage = isPostPageView(location.pathname, params); + const isPendingPostPage = isPendingPostView(location.pathname, params); const linksCount = useCountLinksInReplies(post); const displayTitle = title && title.length > 30 ? title?.slice(0, 30) + '(...)' : title; @@ -488,6 +491,7 @@ const PostMobile = ({ openReplyModal, post, roles, showAllReplies }: PostProps) )} {!(pinned && !isInPostPage) && + !isPendingPostPage && !isDescription && !isRules && replies && From 436858960cec684290791be64eddbf645c0a536f Mon Sep 17 00:00:00 2001 From: "plebeius.eth" Date: Tue, 7 May 2024 14:11:27 +0200 Subject: [PATCH 03/12] chore(translations): challenge counter --- public/translations/ar/default.json | 3 ++- public/translations/bn/default.json | 3 ++- public/translations/cs/default.json | 3 ++- public/translations/da/default.json | 3 ++- public/translations/de/default.json | 3 ++- public/translations/el/default.json | 3 ++- public/translations/en/default.json | 3 ++- public/translations/es/default.json | 3 ++- public/translations/fa/default.json | 3 ++- public/translations/fi/default.json | 3 ++- public/translations/fil/default.json | 3 ++- public/translations/fr/default.json | 3 ++- public/translations/he/default.json | 3 ++- public/translations/hi/default.json | 3 ++- public/translations/hu/default.json | 3 ++- public/translations/id/default.json | 3 ++- public/translations/it/default.json | 3 ++- public/translations/ja/default.json | 3 ++- public/translations/ko/default.json | 3 ++- public/translations/mr/default.json | 3 ++- public/translations/nl/default.json | 3 ++- public/translations/no/default.json | 3 ++- public/translations/pl/default.json | 3 ++- public/translations/pt/default.json | 3 ++- public/translations/ro/default.json | 3 ++- public/translations/ru/default.json | 3 ++- public/translations/sq/default.json | 3 ++- public/translations/sv/default.json | 3 ++- public/translations/te/default.json | 3 ++- public/translations/th/default.json | 3 ++- public/translations/tr/default.json | 3 ++- public/translations/uk/default.json | 3 ++- public/translations/ur/default.json | 3 ++- public/translations/vi/default.json | 3 ++- public/translations/zh/default.json | 3 ++- 35 files changed, 70 insertions(+), 35 deletions(-) diff --git a/public/translations/ar/default.json b/public/translations/ar/default.json index 7a53b264..28b32d7e 100644 --- a/public/translations/ar/default.json +++ b/public/translations/ar/default.json @@ -72,5 +72,6 @@ "interests": "اهتمامات", "random": "عشوائي", "international": "دولية", - "projects": "مشاريع" + "projects": "مشاريع", + "challenge_counter": "{{index}} من {{total}}" } \ No newline at end of file diff --git a/public/translations/bn/default.json b/public/translations/bn/default.json index ab94bcbc..54d5c53e 100644 --- a/public/translations/bn/default.json +++ b/public/translations/bn/default.json @@ -72,5 +72,6 @@ "interests": "আগ্রহসমূহ", "random": "এলোমেলো", "international": "আন্তর্জাতিক", - "projects": "প্রকল্পসমূহ" + "projects": "প্রকল্পসমূহ", + "challenge_counter": "{{index}} থেকে {{total}}" } \ No newline at end of file diff --git a/public/translations/cs/default.json b/public/translations/cs/default.json index ff5945af..c735ef9c 100644 --- a/public/translations/cs/default.json +++ b/public/translations/cs/default.json @@ -72,5 +72,6 @@ "interests": "zájmy", "random": "náhodný", "international": "mezinárodní", - "projects": "projekty" + "projects": "projekty", + "challenge_counter": "{{index}} z {{total}}" } \ No newline at end of file diff --git a/public/translations/da/default.json b/public/translations/da/default.json index 34d267b5..2871ee00 100644 --- a/public/translations/da/default.json +++ b/public/translations/da/default.json @@ -72,5 +72,6 @@ "interests": "interesser", "random": "tilfældig", "international": "internationale", - "projects": "projekter" + "projects": "projekter", + "challenge_counter": "{{index}} af {{total}}" } \ No newline at end of file diff --git a/public/translations/de/default.json b/public/translations/de/default.json index 5f548b59..b4313271 100644 --- a/public/translations/de/default.json +++ b/public/translations/de/default.json @@ -72,5 +72,6 @@ "interests": "Interessen", "random": "zufällig", "international": "internationale", - "projects": "Projekte" + "projects": "Projekte", + "challenge_counter": "{{index}} von {{total}}" } \ No newline at end of file diff --git a/public/translations/el/default.json b/public/translations/el/default.json index d77b3dc0..3b306ea5 100644 --- a/public/translations/el/default.json +++ b/public/translations/el/default.json @@ -72,5 +72,6 @@ "interests": "ενδιαφέροντα", "random": "τυχαίος", "international": "διεθνείς", - "projects": "έργα" + "projects": "έργα", + "challenge_counter": "{{index}} από {{total}}" } \ No newline at end of file diff --git a/public/translations/en/default.json b/public/translations/en/default.json index c7ac71ba..c4541e82 100644 --- a/public/translations/en/default.json +++ b/public/translations/en/default.json @@ -72,5 +72,6 @@ "interests": "interests", "random": "random", "international": "international", - "projects": "projects" + "projects": "projects", + "challenge_counter": "{{index}} of {{total}}" } \ No newline at end of file diff --git a/public/translations/es/default.json b/public/translations/es/default.json index 6fb3afa9..a110bd55 100644 --- a/public/translations/es/default.json +++ b/public/translations/es/default.json @@ -72,5 +72,6 @@ "interests": "intereses", "random": "aleatorio", "international": "internacionales", - "projects": "proyectos" + "projects": "proyectos", + "challenge_counter": "{{index}} de {{total}}" } \ No newline at end of file diff --git a/public/translations/fa/default.json b/public/translations/fa/default.json index 868c0f79..6e950947 100644 --- a/public/translations/fa/default.json +++ b/public/translations/fa/default.json @@ -72,5 +72,6 @@ "interests": "علایق", "random": "تصادفی", "international": "بین‌المللی", - "projects": "پروژه‌ها" + "projects": "پروژه‌ها", + "challenge_counter": "{{index}} از {{total}}" } \ No newline at end of file diff --git a/public/translations/fi/default.json b/public/translations/fi/default.json index 8f0c9bc6..b028c75a 100644 --- a/public/translations/fi/default.json +++ b/public/translations/fi/default.json @@ -72,5 +72,6 @@ "interests": "kiinnostuksen kohteet", "random": "satunnainen", "international": "kansainväliset", - "projects": "projektit" + "projects": "projektit", + "challenge_counter": "{{index}} / {{total}}" } \ No newline at end of file diff --git a/public/translations/fil/default.json b/public/translations/fil/default.json index 01bbb983..afd2be7f 100644 --- a/public/translations/fil/default.json +++ b/public/translations/fil/default.json @@ -72,5 +72,6 @@ "interests": "mga interes", "random": "random", "international": "internasyonal", - "projects": "mga proyekto" + "projects": "mga proyekto", + "challenge_counter": "{{index}} ng {{total}}" } \ No newline at end of file diff --git a/public/translations/fr/default.json b/public/translations/fr/default.json index 2d1ee80a..349edda3 100644 --- a/public/translations/fr/default.json +++ b/public/translations/fr/default.json @@ -72,5 +72,6 @@ "interests": "intérêts", "random": "aléatoire", "international": "internationaux", - "projects": "projets" + "projects": "projets", + "challenge_counter": "{{index}} sur {{total}}" } \ No newline at end of file diff --git a/public/translations/he/default.json b/public/translations/he/default.json index c5298a88..90fc0867 100644 --- a/public/translations/he/default.json +++ b/public/translations/he/default.json @@ -72,5 +72,6 @@ "interests": "עניינים", "random": "אקראי", "international": "בינלאומיים", - "projects": "פרויקטים" + "projects": "פרויקטים", + "challenge_counter": "{{index}} מתוך {{total}}" } \ No newline at end of file diff --git a/public/translations/hi/default.json b/public/translations/hi/default.json index 4ae7c70c..4e1cbe51 100644 --- a/public/translations/hi/default.json +++ b/public/translations/hi/default.json @@ -72,5 +72,6 @@ "interests": "रुचियाँ", "random": "यादृच्छिक", "international": "अंतरराष्ट्रीय", - "projects": "परियोजनाएं" + "projects": "परियोजनाएं", + "challenge_counter": "{{index}} में से {{total}}" } \ No newline at end of file diff --git a/public/translations/hu/default.json b/public/translations/hu/default.json index 6d8bc944..930ebf82 100644 --- a/public/translations/hu/default.json +++ b/public/translations/hu/default.json @@ -72,5 +72,6 @@ "interests": "érdeklődési körök", "random": "véletlenszerű", "international": "nemzetközi", - "projects": "projektek" + "projects": "projektek", + "challenge_counter": "{{index}} a(z) {{total}}-ból/ből" } \ No newline at end of file diff --git a/public/translations/id/default.json b/public/translations/id/default.json index bf5a314d..5bbcd711 100644 --- a/public/translations/id/default.json +++ b/public/translations/id/default.json @@ -72,5 +72,6 @@ "interests": "minat", "random": "acak", "international": "internasional", - "projects": "proyek" + "projects": "proyek", + "challenge_counter": "{{index}} dari {{total}}" } \ No newline at end of file diff --git a/public/translations/it/default.json b/public/translations/it/default.json index 82d1ab86..aae953b7 100644 --- a/public/translations/it/default.json +++ b/public/translations/it/default.json @@ -72,5 +72,6 @@ "interests": "interessi", "random": "casuale", "international": "internazionali", - "projects": "progetti" + "projects": "progetti", + "challenge_counter": "{{index}} di {{total}}" } \ No newline at end of file diff --git a/public/translations/ja/default.json b/public/translations/ja/default.json index e941e377..54e2194d 100644 --- a/public/translations/ja/default.json +++ b/public/translations/ja/default.json @@ -72,5 +72,6 @@ "interests": "興味", "random": "ランダム", "international": "国際的な", - "projects": "プロジェクト" + "projects": "プロジェクト", + "challenge_counter": "{{index}} / {{total}}" } \ No newline at end of file diff --git a/public/translations/ko/default.json b/public/translations/ko/default.json index d97bee07..d6ce8cf0 100644 --- a/public/translations/ko/default.json +++ b/public/translations/ko/default.json @@ -72,5 +72,6 @@ "interests": "관심사", "random": "랜덤", "international": "국제적인", - "projects": "프로젝트" + "projects": "프로젝트", + "challenge_counter": "{{index}} 중 {{total}}" } \ No newline at end of file diff --git a/public/translations/mr/default.json b/public/translations/mr/default.json index fdf80ef7..db5184b6 100644 --- a/public/translations/mr/default.json +++ b/public/translations/mr/default.json @@ -72,5 +72,6 @@ "interests": "आवडी", "random": "यादृच्छ", "international": "आंतरराष्ट्रीय", - "projects": "प्रकल्प" + "projects": "प्रकल्प", + "challenge_counter": "{{index}} पैकी {{total}}" } \ No newline at end of file diff --git a/public/translations/nl/default.json b/public/translations/nl/default.json index 5271ad27..daf638b7 100644 --- a/public/translations/nl/default.json +++ b/public/translations/nl/default.json @@ -72,5 +72,6 @@ "interests": "interesses", "random": "willekeurig", "international": "internationale", - "projects": "projecten" + "projects": "projecten", + "challenge_counter": "{{index}} van {{total}}" } \ No newline at end of file diff --git a/public/translations/no/default.json b/public/translations/no/default.json index aa238531..c942b84f 100644 --- a/public/translations/no/default.json +++ b/public/translations/no/default.json @@ -72,5 +72,6 @@ "interests": "interesser", "random": "tilfeldig", "international": "internasjonale", - "projects": "prosjekter" + "projects": "prosjekter", + "challenge_counter": "{{index}} av {{total}}" } \ No newline at end of file diff --git a/public/translations/pl/default.json b/public/translations/pl/default.json index 93125ac4..41e2921b 100644 --- a/public/translations/pl/default.json +++ b/public/translations/pl/default.json @@ -72,5 +72,6 @@ "interests": "zainteresowania", "random": "losowy", "international": "międzynarodowe", - "projects": "projekty" + "projects": "projekty", + "challenge_counter": "{{index}} z {{total}}" } \ No newline at end of file diff --git a/public/translations/pt/default.json b/public/translations/pt/default.json index 8a7c9f00..1c57754d 100644 --- a/public/translations/pt/default.json +++ b/public/translations/pt/default.json @@ -72,5 +72,6 @@ "interests": "interesses", "random": "aleatório", "international": "internacionais", - "projects": "projetos" + "projects": "projetos", + "challenge_counter": "{{index}} de {{total}}" } \ No newline at end of file diff --git a/public/translations/ro/default.json b/public/translations/ro/default.json index f55be867..b0448b53 100644 --- a/public/translations/ro/default.json +++ b/public/translations/ro/default.json @@ -72,5 +72,6 @@ "interests": "interese", "random": "aleator", "international": "internaționale", - "projects": "proiecte" + "projects": "proiecte", + "challenge_counter": "{{index}} din {{total}}" } \ No newline at end of file diff --git a/public/translations/ru/default.json b/public/translations/ru/default.json index c5a3e800..f0a97b37 100644 --- a/public/translations/ru/default.json +++ b/public/translations/ru/default.json @@ -72,5 +72,6 @@ "interests": "интересы", "random": "случайный", "international": "международные", - "projects": "проекты" + "projects": "проекты", + "challenge_counter": "{{index}} из {{total}}" } \ No newline at end of file diff --git a/public/translations/sq/default.json b/public/translations/sq/default.json index 1cc1ed01..93ccd97f 100644 --- a/public/translations/sq/default.json +++ b/public/translations/sq/default.json @@ -72,5 +72,6 @@ "interests": "interesat", "random": "i rastësishëm", "international": "ndërkombëtare", - "projects": "projekte" + "projects": "projekte", + "challenge_counter": "{{index}} nga {{total}}" } \ No newline at end of file diff --git a/public/translations/sv/default.json b/public/translations/sv/default.json index 35cb5552..0d87c64e 100644 --- a/public/translations/sv/default.json +++ b/public/translations/sv/default.json @@ -72,5 +72,6 @@ "interests": "intressen", "random": "slumpmässig", "international": "internationella", - "projects": "projekt" + "projects": "projekt", + "challenge_counter": "{{index}} av {{total}}" } \ No newline at end of file diff --git a/public/translations/te/default.json b/public/translations/te/default.json index 7925028d..8f490f66 100644 --- a/public/translations/te/default.json +++ b/public/translations/te/default.json @@ -72,5 +72,6 @@ "interests": "ఆసక్తులు", "random": "యాదృచ్ఛిక", "international": "అంతర్జాతీయ", - "projects": "ప్రాజెక్టులు" + "projects": "ప్రాజెక్టులు", + "challenge_counter": "{{index}} లో {{total}}" } \ No newline at end of file diff --git a/public/translations/th/default.json b/public/translations/th/default.json index 7ed717cf..486b8b78 100644 --- a/public/translations/th/default.json +++ b/public/translations/th/default.json @@ -72,5 +72,6 @@ "interests": "ความสนใจ", "random": "สุ่ม", "international": "นานาชาติ", - "projects": "โครงการ" + "projects": "โครงการ", + "challenge_counter": "{{index}} จาก {{total}}" } \ No newline at end of file diff --git a/public/translations/tr/default.json b/public/translations/tr/default.json index 6e0b557a..ad487e96 100644 --- a/public/translations/tr/default.json +++ b/public/translations/tr/default.json @@ -72,5 +72,6 @@ "interests": "ilgi alanları", "random": "rastgele", "international": "uluslararası", - "projects": "projeler" + "projects": "projeler", + "challenge_counter": "{{index}} / {{total}}" } \ No newline at end of file diff --git a/public/translations/uk/default.json b/public/translations/uk/default.json index 27d0e1ad..b6112113 100644 --- a/public/translations/uk/default.json +++ b/public/translations/uk/default.json @@ -72,5 +72,6 @@ "interests": "інтереси", "random": "випадковий", "international": "міжнародні", - "projects": "проекти" + "projects": "проекти", + "challenge_counter": "{{index}} з {{total}}" } \ No newline at end of file diff --git a/public/translations/ur/default.json b/public/translations/ur/default.json index a830d99b..d6701ff3 100644 --- a/public/translations/ur/default.json +++ b/public/translations/ur/default.json @@ -72,5 +72,6 @@ "interests": "دلچسپیاں", "random": "بے ترتیب", "international": "بین الاقوامی", - "projects": "منصوبے" + "projects": "منصوبے", + "challenge_counter": "{{index}} میں سے {{total}}" } \ No newline at end of file diff --git a/public/translations/vi/default.json b/public/translations/vi/default.json index da3a6a0e..5c016a7e 100644 --- a/public/translations/vi/default.json +++ b/public/translations/vi/default.json @@ -72,5 +72,6 @@ "interests": "sở thích", "random": "ngẫu nhiên", "international": "quốc tế", - "projects": "dự án" + "projects": "dự án", + "challenge_counter": "{{index}} trong {{total}}" } \ No newline at end of file diff --git a/public/translations/zh/default.json b/public/translations/zh/default.json index 8a6a207c..3266e6aa 100644 --- a/public/translations/zh/default.json +++ b/public/translations/zh/default.json @@ -72,5 +72,6 @@ "interests": "兴趣", "random": "随机", "international": "国际的", - "projects": "项目" + "projects": "项目", + "challenge_counter": "{{index}} / {{total}}" } \ No newline at end of file From 1a57d3ae536cfb54a4df1a6833cd8c48b083b7c3 Mon Sep 17 00:00:00 2001 From: "plebeius.eth" Date: Tue, 7 May 2024 14:11:43 +0200 Subject: [PATCH 04/12] fix undefined --- src/components/post/post.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/post/post.tsx b/src/components/post/post.tsx index de9d69da..0cdaf091 100644 --- a/src/components/post/post.tsx +++ b/src/components/post/post.tsx @@ -344,7 +344,7 @@ const ReplyDesktop = ({ reply, roles, openReplyModal }: PostProps) => { {isReplyingToReply && ( <> - {`c/${Plebbit.getShortCid(parentCid)}`} + {`c/${parentCid && Plebbit.getShortCid(parentCid)}`}
@@ -576,7 +576,7 @@ const ReplyMobile = ({ reply, roles, openReplyModal }: PostProps) => { {isReplyingToReply && ( <> - {`c/${Plebbit.getShortCid(parentCid)}`} + {`c/${parentCid && Plebbit.getShortCid(parentCid)}`}
From fc459d9533505cd911760fb36e92a70e42d45c1d Mon Sep 17 00:00:00 2001 From: "plebeius.eth" Date: Tue, 7 May 2024 16:08:02 +0200 Subject: [PATCH 05/12] fix(post): prioritize 'failed' state over 'pending' --- src/components/post/post.module.css | 1 - src/components/post/post.tsx | 20 ++++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/components/post/post.module.css b/src/components/post/post.module.css index 60adcd93..84459b42 100644 --- a/src/components/post/post.module.css +++ b/src/components/post/post.module.css @@ -77,7 +77,6 @@ } .postDesktop .postNumLink a:hover, .postDesktop .postNumLink span:hover, .replyDesktop .postNumLink a:hover, .replyDesktop .postNumLink span:hover { - cursor: pointer; color: var(--button-desktop-text-color-hover); } diff --git a/src/components/post/post.tsx b/src/components/post/post.tsx index 0cdaf091..fa52a35b 100644 --- a/src/components/post/post.tsx +++ b/src/components/post/post.tsx @@ -142,7 +142,7 @@ const PostDesktop = ({ openReplyModal, post, roles, showAllReplies }: PostProps) c/ {!cid ? ( - {state === 'failed' ? 'Failed' : 'Pending'} + {state === 'failed' || stateString === 'Failed' ? 'Failed' : 'Pending'} ) : ( openReplyModal && openReplyModal(cid)}> {shortCid} @@ -187,7 +187,7 @@ const PostDesktop = ({ openReplyModal, post, roles, showAllReplies }: PostProps) }} /> )} - {!cid && state === 'pending' && ( + {!cid && state === 'pending' && stateString !== 'Failed' && ( <>
{loadingString} @@ -195,7 +195,7 @@ const PostDesktop = ({ openReplyModal, post, roles, showAllReplies }: PostProps) )} )} - {!isDescription && !isRules && (replies.length > 5 || (pinned && replies.length > 0)) && !isInPostPage && ( + {!isDescription && !isRules && !isPendingPostPage && (replies.length > 5 || (pinned && replies.length > 0)) && !isInPostPage && ( @@ -274,7 +274,7 @@ const ReplyDesktop = ({ reply, roles, openReplyModal }: PostProps) => { c/ {!cid ? ( - {state === 'failed' ? 'Failed' : 'Pending'} + {state === 'failed' || stateString === 'Failed' ? 'Failed' : 'Pending'} ) : ( openReplyModal && openReplyModal(cid)}> {shortCid} @@ -350,7 +350,7 @@ const ReplyDesktop = ({ reply, roles, openReplyModal }: PostProps) => { )} - {!cid && state === 'pending' && ( + {!cid && state === 'pending' && stateString !== 'Failed' && ( <>
{loadingString} @@ -439,7 +439,7 @@ const PostMobile = ({ openReplyModal, post, roles, showAllReplies }: PostProps) c/ {!cid ? ( - {state === 'failed' ? 'Failed' : 'Pending'} + {state === 'failed' || stateString === 'Failed' ? 'Failed' : 'Pending'} ) : ( openReplyModal && openReplyModal(cid)}> {shortCid} @@ -469,7 +469,7 @@ const PostMobile = ({ openReplyModal, post, roles, showAllReplies }: PostProps) }} /> )} - {!cid && state === 'pending' && ( + {!cid && state === 'pending' && stateString !== 'Failed' && ( <>
{loadingString} @@ -478,7 +478,7 @@ const PostMobile = ({ openReplyModal, post, roles, showAllReplies }: PostProps) )} - {!isInPostPage && ( + {!isInPostPage && !isPendingPostPage && (
{replyCount > 0 && `${replyCount} Replies`} @@ -553,7 +553,7 @@ const ReplyMobile = ({ reply, roles, openReplyModal }: PostProps) => { {!cid ? ( - {state === 'failed' ? 'Failed' : 'Pending'} + {state === 'failed' || stateString === 'Failed' ? 'Failed' : 'Pending'} ) : ( openReplyModal && openReplyModal(cid)}> {shortCid} @@ -582,7 +582,7 @@ const ReplyMobile = ({ reply, roles, openReplyModal }: PostProps) => { )} - {!cid && state === 'pending' && ( + {!cid && state === 'pending' && stateString !== 'Failed' && ( <>
{loadingString} From 5e8d7436f9b09b39d1a5b5e8e1e2d03292a2d6c8 Mon Sep 17 00:00:00 2001 From: "plebeius.eth" Date: Tue, 7 May 2024 22:09:00 +0200 Subject: [PATCH 06/12] fix(not found): force yotsuba theme with ref, not with params in app because they can't be detected in app --- src/app.tsx | 8 ++-- src/views/not-found/not-found.module.css | 6 +-- src/views/not-found/not-found.tsx | 55 ++++++++++++++++-------- 3 files changed, 43 insertions(+), 26 deletions(-) diff --git a/src/app.tsx b/src/app.tsx index 872a9576..41ebdb41 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -1,6 +1,6 @@ import { useEffect } from 'react'; import { Outlet, Route, Routes, useLocation, useParams } from 'react-router-dom'; -import { isHomeView, isNotFoundView } from './lib/utils/view-utils'; +import { isHomeView } from './lib/utils/view-utils'; import useTheme from './hooks/use-theme'; import styles from './app.module.css'; import Board from './views/board'; @@ -47,16 +47,14 @@ const BoardLayout = () => { const App = () => { const location = useLocation(); - const params = useParams(); const isInHomeView = isHomeView(location.pathname); - const isInNotFoundPage = isNotFoundView(location.pathname, params); const [theme] = useTheme(); useEffect(() => { document.body.classList.forEach((className) => document.body.classList.remove(className)); - const classToAdd = isInHomeView || isInNotFoundPage ? 'yotsuba' : theme; + const classToAdd = isInHomeView ? 'yotsuba' : theme; document.body.classList.add(classToAdd); - }, [theme, isInHomeView, isInNotFoundPage]); + }, [theme, isInHomeView]); const globalLayout = ( <> diff --git a/src/views/not-found/not-found.module.css b/src/views/not-found/not-found.module.css index df9c1f1a..8702f52c 100644 --- a/src/views/not-found/not-found.module.css +++ b/src/views/not-found/not-found.module.css @@ -1,8 +1,8 @@ .content { margin: auto; - text-align: left; - width: 57.69em; - min-width: 750px; + text-align: left; + width: 57.69em; + min-width: 750px; } .boxOuter { diff --git a/src/views/not-found/not-found.tsx b/src/views/not-found/not-found.tsx index 0e2be030..35b00a6f 100644 --- a/src/views/not-found/not-found.tsx +++ b/src/views/not-found/not-found.tsx @@ -1,8 +1,9 @@ -import { useState } from 'react'; +import { useEffect, useState, useRef } from 'react'; import { Link, useParams } from 'react-router-dom'; import { HomeLogo } from '../home'; import styles from './not-found.module.css'; import Plebbit from '@plebbit/plebbit-js/dist/browser/index.js'; +import useTheme from '../../hooks/use-theme'; const totalNotFoundImages = 2; @@ -19,24 +20,42 @@ const NotFoundImage = () => { const NotFound = () => { const { subplebbitAddress } = useParams(); + const [theme, setTheme] = useTheme(); + const previousThemeRef = useRef(theme); + + useEffect(() => { + if (theme !== 'yotsuba') { + previousThemeRef.current = theme; + setTheme('yotsuba'); + } + + return () => { + if (theme === 'yotsuba') { + setTheme(previousThemeRef.current); + } + }; + }, [theme, setTheme]); + return ( -
- -
-
-
-

404 Not Found

-
-
- - {subplebbitAddress && ( - <> -
-
- [Back to p/{Plebbit.getShortAddress(subplebbitAddress)}] -
- - )} +
+
+ +
+
+
+

404 Not Found

+
+
+ + {subplebbitAddress && ( + <> +
+
+ [Back to p/{Plebbit.getShortAddress(subplebbitAddress)}] +
+ + )} +
From ccb75fcf3a6057a0a09e1fcd0456654a1af1bc00 Mon Sep 17 00:00:00 2001 From: "plebeius.eth" Date: Tue, 7 May 2024 22:23:49 +0200 Subject: [PATCH 07/12] feat(post form): replace single return with double return on submit, because markdown is mandatory on plebbit, but a user from 4chan won't know that --- src/components/post-form/post-form.tsx | 3 ++- src/components/reply-modal/reply-modal.tsx | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/post-form/post-form.tsx b/src/components/post-form/post-form.tsx index eb384f4a..b008f362 100644 --- a/src/components/post-form/post-form.tsx +++ b/src/components/post-form/post-form.tsx @@ -183,7 +183,8 @@ const PostFormTable = ({ closeForm }: { closeForm: () => void }) => { wrap='soft' ref={textRef} onChange={(e) => { - isInPostPage ? setContent.content(e.target.value) : setSubmitStore({ content: e.target.value }); + const content = e.target.value.replace(/\n/g, '\n\n'); + isInPostPage ? setContent.content(content) : setSubmitStore({ content }); }} /> diff --git a/src/components/reply-modal/reply-modal.tsx b/src/components/reply-modal/reply-modal.tsx index d992e893..0b0a069c 100644 --- a/src/components/reply-modal/reply-modal.tsx +++ b/src/components/reply-modal/reply-modal.tsx @@ -95,7 +95,10 @@ const ReplyModal = ({ closeModal, parentCid, scrollY }: ReplyModalProps) => { wrap='soft' ref={textRef} placeholder={_.capitalize(t('comment'))} - onChange={(e) => setContent.content(e.target.value)} + onChange={(e) => { + const content = e.target.value.replace(/\n/g, '\n\n'); + setContent.content(content); + }} autoFocus={!isMobile} // autofocus causes auto scroll to top on mobile />
From 6bfa899722f7f2e627d823a11edcbb0a8b288d28 Mon Sep 17 00:00:00 2001 From: "plebeius.eth" Date: Wed, 8 May 2024 11:10:43 +0200 Subject: [PATCH 08/12] feat(post): add embed button and media to links in post content detected as valid embed links --- src/components/markdown/markdown.module.css | 10 +++++ src/components/markdown/markdown.tsx | 43 +++++++++++++++++++-- 2 files changed, 50 insertions(+), 3 deletions(-) diff --git a/src/components/markdown/markdown.module.css b/src/components/markdown/markdown.module.css index b894ce63..8c12a714 100644 --- a/src/components/markdown/markdown.module.css +++ b/src/components/markdown/markdown.module.css @@ -19,3 +19,13 @@ .hrWrapper hr { margin: 0; } + +.embedButton { + color: var(--button-desktop-text-color); + text-transform: capitalize; +} + +.embedButton:hover { + cursor: pointer; + color: var(--button-desktop-text-color-hover); +} \ No newline at end of file diff --git a/src/components/markdown/markdown.tsx b/src/components/markdown/markdown.tsx index ec4ef6ec..31542885 100644 --- a/src/components/markdown/markdown.tsx +++ b/src/components/markdown/markdown.tsx @@ -1,9 +1,12 @@ -import React, { useMemo } from 'react'; -import styles from './markdown.module.css'; +import React, { useMemo, useState } from 'react'; import ReactMarkdown from 'react-markdown'; -import rehypeSanitize, { defaultSchema } from 'rehype-sanitize'; import remarkGfm from 'remark-gfm'; import supersub from 'remark-supersub'; +import rehypeSanitize, { defaultSchema } from 'rehype-sanitize'; +import styles from './markdown.module.css'; +import { useTranslation } from 'react-i18next'; +import { getLinkMediaInfo, getHasThumbnail } from '../../lib/utils/media-utils'; +import CommentMedia from '../comment-media'; interface MarkdownProps { content: string; @@ -55,6 +58,9 @@ const Markdown = ({ content }: MarkdownProps) => { remarkPlugins.push([blockquoteToGreentext]); + const { t } = useTranslation(); + const [showMedia, setShowMedia] = useState(false); + return ( {
), + a: ({ href, children }) => { + if (href) { + const linkMediaInfo = getLinkMediaInfo(href); + if (getHasThumbnail(linkMediaInfo, href)) { + return ( + <> + + {children} + {' '} + [ + setShowMedia(!showMedia)}> + {showMedia ? t('remove') : t('embed')} + + ] + {showMedia && ( + <> +
+ + + )} + + ); + } else { + return ( + + {children} + + ); + } + } + }, }} /> From 5125cdbea0fb09866d913fb3c75293fefe015c52 Mon Sep 17 00:00:00 2001 From: "plebeius.eth" Date: Wed, 8 May 2024 11:10:53 +0200 Subject: [PATCH 09/12] chore(translations): embed, remove --- public/translations/ar/default.json | 4 +++- public/translations/bn/default.json | 4 +++- public/translations/cs/default.json | 4 +++- public/translations/da/default.json | 4 +++- public/translations/de/default.json | 4 +++- public/translations/el/default.json | 4 +++- public/translations/en/default.json | 4 +++- public/translations/es/default.json | 4 +++- public/translations/fa/default.json | 4 +++- public/translations/fi/default.json | 4 +++- public/translations/fil/default.json | 4 +++- public/translations/fr/default.json | 4 +++- public/translations/he/default.json | 4 +++- public/translations/hi/default.json | 4 +++- public/translations/hu/default.json | 4 +++- public/translations/id/default.json | 4 +++- public/translations/it/default.json | 4 +++- public/translations/ja/default.json | 4 +++- public/translations/ko/default.json | 4 +++- public/translations/mr/default.json | 4 +++- public/translations/nl/default.json | 4 +++- public/translations/no/default.json | 4 +++- public/translations/pl/default.json | 4 +++- public/translations/pt/default.json | 4 +++- public/translations/ro/default.json | 4 +++- public/translations/ru/default.json | 4 +++- public/translations/sq/default.json | 4 +++- public/translations/sv/default.json | 4 +++- public/translations/te/default.json | 4 +++- public/translations/th/default.json | 4 +++- public/translations/tr/default.json | 4 +++- public/translations/uk/default.json | 4 +++- public/translations/ur/default.json | 4 +++- public/translations/vi/default.json | 4 +++- public/translations/zh/default.json | 4 +++- 35 files changed, 105 insertions(+), 35 deletions(-) diff --git a/public/translations/ar/default.json b/public/translations/ar/default.json index 28b32d7e..9e1e58b1 100644 --- a/public/translations/ar/default.json +++ b/public/translations/ar/default.json @@ -73,5 +73,7 @@ "random": "عشوائي", "international": "دولية", "projects": "مشاريع", - "challenge_counter": "{{index}} من {{total}}" + "challenge_counter": "{{index}} من {{total}}", + "embed": "تضمين", + "remove": "إزالة" } \ No newline at end of file diff --git a/public/translations/bn/default.json b/public/translations/bn/default.json index 54d5c53e..ebee908b 100644 --- a/public/translations/bn/default.json +++ b/public/translations/bn/default.json @@ -73,5 +73,7 @@ "random": "এলোমেলো", "international": "আন্তর্জাতিক", "projects": "প্রকল্পসমূহ", - "challenge_counter": "{{index}} থেকে {{total}}" + "challenge_counter": "{{index}} থেকে {{total}}", + "embed": "এম্বেড", + "remove": "অপসারণ" } \ No newline at end of file diff --git a/public/translations/cs/default.json b/public/translations/cs/default.json index c735ef9c..bed95533 100644 --- a/public/translations/cs/default.json +++ b/public/translations/cs/default.json @@ -73,5 +73,7 @@ "random": "náhodný", "international": "mezinárodní", "projects": "projekty", - "challenge_counter": "{{index}} z {{total}}" + "challenge_counter": "{{index}} z {{total}}", + "embed": "vložit", + "remove": "odstranit" } \ No newline at end of file diff --git a/public/translations/da/default.json b/public/translations/da/default.json index 2871ee00..31a43329 100644 --- a/public/translations/da/default.json +++ b/public/translations/da/default.json @@ -73,5 +73,7 @@ "random": "tilfældig", "international": "internationale", "projects": "projekter", - "challenge_counter": "{{index}} af {{total}}" + "challenge_counter": "{{index}} af {{total}}", + "embed": "integrer", + "remove": "fjern" } \ No newline at end of file diff --git a/public/translations/de/default.json b/public/translations/de/default.json index b4313271..1d8b555b 100644 --- a/public/translations/de/default.json +++ b/public/translations/de/default.json @@ -73,5 +73,7 @@ "random": "zufällig", "international": "internationale", "projects": "Projekte", - "challenge_counter": "{{index}} von {{total}}" + "challenge_counter": "{{index}} von {{total}}", + "embed": "einbetten", + "remove": "entfernen" } \ No newline at end of file diff --git a/public/translations/el/default.json b/public/translations/el/default.json index 3b306ea5..efb58bcb 100644 --- a/public/translations/el/default.json +++ b/public/translations/el/default.json @@ -73,5 +73,7 @@ "random": "τυχαίος", "international": "διεθνείς", "projects": "έργα", - "challenge_counter": "{{index}} από {{total}}" + "challenge_counter": "{{index}} από {{total}}", + "embed": "ενσωμάτωση", + "remove": "αφαίρεση" } \ No newline at end of file diff --git a/public/translations/en/default.json b/public/translations/en/default.json index c4541e82..cfe60bbf 100644 --- a/public/translations/en/default.json +++ b/public/translations/en/default.json @@ -73,5 +73,7 @@ "random": "random", "international": "international", "projects": "projects", - "challenge_counter": "{{index}} of {{total}}" + "challenge_counter": "{{index}} of {{total}}", + "embed": "embed", + "remove": "remove" } \ No newline at end of file diff --git a/public/translations/es/default.json b/public/translations/es/default.json index a110bd55..9a434c2d 100644 --- a/public/translations/es/default.json +++ b/public/translations/es/default.json @@ -73,5 +73,7 @@ "random": "aleatorio", "international": "internacionales", "projects": "proyectos", - "challenge_counter": "{{index}} de {{total}}" + "challenge_counter": "{{index}} de {{total}}", + "embed": "incrustar", + "remove": "eliminar" } \ No newline at end of file diff --git a/public/translations/fa/default.json b/public/translations/fa/default.json index 6e950947..03448fd9 100644 --- a/public/translations/fa/default.json +++ b/public/translations/fa/default.json @@ -73,5 +73,7 @@ "random": "تصادفی", "international": "بین‌المللی", "projects": "پروژه‌ها", - "challenge_counter": "{{index}} از {{total}}" + "challenge_counter": "{{index}} از {{total}}", + "embed": "جاسازی", + "remove": "حذف" } \ No newline at end of file diff --git a/public/translations/fi/default.json b/public/translations/fi/default.json index b028c75a..c7428224 100644 --- a/public/translations/fi/default.json +++ b/public/translations/fi/default.json @@ -73,5 +73,7 @@ "random": "satunnainen", "international": "kansainväliset", "projects": "projektit", - "challenge_counter": "{{index}} / {{total}}" + "challenge_counter": "{{index}} / {{total}}", + "embed": "upota", + "remove": "poista" } \ No newline at end of file diff --git a/public/translations/fil/default.json b/public/translations/fil/default.json index afd2be7f..b52d12fe 100644 --- a/public/translations/fil/default.json +++ b/public/translations/fil/default.json @@ -73,5 +73,7 @@ "random": "random", "international": "internasyonal", "projects": "mga proyekto", - "challenge_counter": "{{index}} ng {{total}}" + "challenge_counter": "{{index}} ng {{total}}", + "embed": "i-embed", + "remove": "alisin" } \ No newline at end of file diff --git a/public/translations/fr/default.json b/public/translations/fr/default.json index 349edda3..31f76089 100644 --- a/public/translations/fr/default.json +++ b/public/translations/fr/default.json @@ -73,5 +73,7 @@ "random": "aléatoire", "international": "internationaux", "projects": "projets", - "challenge_counter": "{{index}} sur {{total}}" + "challenge_counter": "{{index}} sur {{total}}", + "embed": "intégrer", + "remove": "supprimer" } \ No newline at end of file diff --git a/public/translations/he/default.json b/public/translations/he/default.json index 90fc0867..bfc65cfa 100644 --- a/public/translations/he/default.json +++ b/public/translations/he/default.json @@ -73,5 +73,7 @@ "random": "אקראי", "international": "בינלאומיים", "projects": "פרויקטים", - "challenge_counter": "{{index}} מתוך {{total}}" + "challenge_counter": "{{index}} מתוך {{total}}", + "embed": "הטמע", + "remove": "הסר" } \ No newline at end of file diff --git a/public/translations/hi/default.json b/public/translations/hi/default.json index 4e1cbe51..12c9727d 100644 --- a/public/translations/hi/default.json +++ b/public/translations/hi/default.json @@ -73,5 +73,7 @@ "random": "यादृच्छिक", "international": "अंतरराष्ट्रीय", "projects": "परियोजनाएं", - "challenge_counter": "{{index}} में से {{total}}" + "challenge_counter": "{{index}} में से {{total}}", + "embed": "एम्बेड", + "remove": "हटाएं" } \ No newline at end of file diff --git a/public/translations/hu/default.json b/public/translations/hu/default.json index 930ebf82..3d4dfc2c 100644 --- a/public/translations/hu/default.json +++ b/public/translations/hu/default.json @@ -73,5 +73,7 @@ "random": "véletlenszerű", "international": "nemzetközi", "projects": "projektek", - "challenge_counter": "{{index}} a(z) {{total}}-ból/ből" + "challenge_counter": "{{index}} a(z) {{total}}-ból/ből", + "embed": "beágyaz", + "remove": "eltávolít" } \ No newline at end of file diff --git a/public/translations/id/default.json b/public/translations/id/default.json index 5bbcd711..86bc00f3 100644 --- a/public/translations/id/default.json +++ b/public/translations/id/default.json @@ -73,5 +73,7 @@ "random": "acak", "international": "internasional", "projects": "proyek", - "challenge_counter": "{{index}} dari {{total}}" + "challenge_counter": "{{index}} dari {{total}}", + "embed": "sematkan", + "remove": "hapus" } \ No newline at end of file diff --git a/public/translations/it/default.json b/public/translations/it/default.json index aae953b7..413e714b 100644 --- a/public/translations/it/default.json +++ b/public/translations/it/default.json @@ -73,5 +73,7 @@ "random": "casuale", "international": "internazionali", "projects": "progetti", - "challenge_counter": "{{index}} di {{total}}" + "challenge_counter": "{{index}} di {{total}}", + "embed": "incorpora", + "remove": "rimuovi" } \ No newline at end of file diff --git a/public/translations/ja/default.json b/public/translations/ja/default.json index 54e2194d..20f031b5 100644 --- a/public/translations/ja/default.json +++ b/public/translations/ja/default.json @@ -73,5 +73,7 @@ "random": "ランダム", "international": "国際的な", "projects": "プロジェクト", - "challenge_counter": "{{index}} / {{total}}" + "challenge_counter": "{{index}} / {{total}}", + "embed": "埋め込み", + "remove": "削除" } \ No newline at end of file diff --git a/public/translations/ko/default.json b/public/translations/ko/default.json index d6ce8cf0..e2830237 100644 --- a/public/translations/ko/default.json +++ b/public/translations/ko/default.json @@ -73,5 +73,7 @@ "random": "랜덤", "international": "국제적인", "projects": "프로젝트", - "challenge_counter": "{{index}} 중 {{total}}" + "challenge_counter": "{{index}} 중 {{total}}", + "embed": "임베드", + "remove": "제거" } \ No newline at end of file diff --git a/public/translations/mr/default.json b/public/translations/mr/default.json index db5184b6..7d5a181a 100644 --- a/public/translations/mr/default.json +++ b/public/translations/mr/default.json @@ -73,5 +73,7 @@ "random": "यादृच्छ", "international": "आंतरराष्ट्रीय", "projects": "प्रकल्प", - "challenge_counter": "{{index}} पैकी {{total}}" + "challenge_counter": "{{index}} पैकी {{total}}", + "embed": "एम्बेड", + "remove": "काढा" } \ No newline at end of file diff --git a/public/translations/nl/default.json b/public/translations/nl/default.json index daf638b7..bcec2048 100644 --- a/public/translations/nl/default.json +++ b/public/translations/nl/default.json @@ -73,5 +73,7 @@ "random": "willekeurig", "international": "internationale", "projects": "projecten", - "challenge_counter": "{{index}} van {{total}}" + "challenge_counter": "{{index}} van {{total}}", + "embed": "insluiten", + "remove": "verwijderen" } \ No newline at end of file diff --git a/public/translations/no/default.json b/public/translations/no/default.json index c942b84f..e71387c1 100644 --- a/public/translations/no/default.json +++ b/public/translations/no/default.json @@ -73,5 +73,7 @@ "random": "tilfeldig", "international": "internasjonale", "projects": "prosjekter", - "challenge_counter": "{{index}} av {{total}}" + "challenge_counter": "{{index}} av {{total}}", + "embed": "bygg inn", + "remove": "fjern" } \ No newline at end of file diff --git a/public/translations/pl/default.json b/public/translations/pl/default.json index 41e2921b..b14ce7dc 100644 --- a/public/translations/pl/default.json +++ b/public/translations/pl/default.json @@ -73,5 +73,7 @@ "random": "losowy", "international": "międzynarodowe", "projects": "projekty", - "challenge_counter": "{{index}} z {{total}}" + "challenge_counter": "{{index}} z {{total}}", + "embed": "osadź", + "remove": "usuń" } \ No newline at end of file diff --git a/public/translations/pt/default.json b/public/translations/pt/default.json index 1c57754d..805873fe 100644 --- a/public/translations/pt/default.json +++ b/public/translations/pt/default.json @@ -73,5 +73,7 @@ "random": "aleatório", "international": "internacionais", "projects": "projetos", - "challenge_counter": "{{index}} de {{total}}" + "challenge_counter": "{{index}} de {{total}}", + "embed": "embutir", + "remove": "remover" } \ No newline at end of file diff --git a/public/translations/ro/default.json b/public/translations/ro/default.json index b0448b53..48b8f2a5 100644 --- a/public/translations/ro/default.json +++ b/public/translations/ro/default.json @@ -73,5 +73,7 @@ "random": "aleator", "international": "internaționale", "projects": "proiecte", - "challenge_counter": "{{index}} din {{total}}" + "challenge_counter": "{{index}} din {{total}}", + "embed": "încorpora", + "remove": "elimina" } \ No newline at end of file diff --git a/public/translations/ru/default.json b/public/translations/ru/default.json index f0a97b37..26de8087 100644 --- a/public/translations/ru/default.json +++ b/public/translations/ru/default.json @@ -73,5 +73,7 @@ "random": "случайный", "international": "международные", "projects": "проекты", - "challenge_counter": "{{index}} из {{total}}" + "challenge_counter": "{{index}} из {{total}}", + "embed": "встроить", + "remove": "удалить" } \ No newline at end of file diff --git a/public/translations/sq/default.json b/public/translations/sq/default.json index 93ccd97f..af007ab9 100644 --- a/public/translations/sq/default.json +++ b/public/translations/sq/default.json @@ -73,5 +73,7 @@ "random": "i rastësishëm", "international": "ndërkombëtare", "projects": "projekte", - "challenge_counter": "{{index}} nga {{total}}" + "challenge_counter": "{{index}} nga {{total}}", + "embed": "integro", + "remove": "hiq" } \ No newline at end of file diff --git a/public/translations/sv/default.json b/public/translations/sv/default.json index 0d87c64e..f54c76e6 100644 --- a/public/translations/sv/default.json +++ b/public/translations/sv/default.json @@ -73,5 +73,7 @@ "random": "slumpmässig", "international": "internationella", "projects": "projekt", - "challenge_counter": "{{index}} av {{total}}" + "challenge_counter": "{{index}} av {{total}}", + "embed": "bädda in", + "remove": "ta bort" } \ No newline at end of file diff --git a/public/translations/te/default.json b/public/translations/te/default.json index 8f490f66..3ada3f40 100644 --- a/public/translations/te/default.json +++ b/public/translations/te/default.json @@ -73,5 +73,7 @@ "random": "యాదృచ్ఛిక", "international": "అంతర్జాతీయ", "projects": "ప్రాజెక్టులు", - "challenge_counter": "{{index}} లో {{total}}" + "challenge_counter": "{{index}} లో {{total}}", + "embed": "ఎంబెడ్", + "remove": "తొలగించు" } \ No newline at end of file diff --git a/public/translations/th/default.json b/public/translations/th/default.json index 486b8b78..f24fe1f5 100644 --- a/public/translations/th/default.json +++ b/public/translations/th/default.json @@ -73,5 +73,7 @@ "random": "สุ่ม", "international": "นานาชาติ", "projects": "โครงการ", - "challenge_counter": "{{index}} จาก {{total}}" + "challenge_counter": "{{index}} จาก {{total}}", + "embed": "ฝัง", + "remove": "ลบ" } \ No newline at end of file diff --git a/public/translations/tr/default.json b/public/translations/tr/default.json index ad487e96..feeaf0f9 100644 --- a/public/translations/tr/default.json +++ b/public/translations/tr/default.json @@ -73,5 +73,7 @@ "random": "rastgele", "international": "uluslararası", "projects": "projeler", - "challenge_counter": "{{index}} / {{total}}" + "challenge_counter": "{{index}} / {{total}}", + "embed": "göm", + "remove": "kaldır" } \ No newline at end of file diff --git a/public/translations/uk/default.json b/public/translations/uk/default.json index b6112113..3bfdfa37 100644 --- a/public/translations/uk/default.json +++ b/public/translations/uk/default.json @@ -73,5 +73,7 @@ "random": "випадковий", "international": "міжнародні", "projects": "проекти", - "challenge_counter": "{{index}} з {{total}}" + "challenge_counter": "{{index}} з {{total}}", + "embed": "вбудувати", + "remove": "видалити" } \ No newline at end of file diff --git a/public/translations/ur/default.json b/public/translations/ur/default.json index d6701ff3..54f8afe9 100644 --- a/public/translations/ur/default.json +++ b/public/translations/ur/default.json @@ -73,5 +73,7 @@ "random": "بے ترتیب", "international": "بین الاقوامی", "projects": "منصوبے", - "challenge_counter": "{{index}} میں سے {{total}}" + "challenge_counter": "{{index}} میں سے {{total}}", + "embed": "ایمبیڈ", + "remove": "ہٹائیں" } \ No newline at end of file diff --git a/public/translations/vi/default.json b/public/translations/vi/default.json index 5c016a7e..07195945 100644 --- a/public/translations/vi/default.json +++ b/public/translations/vi/default.json @@ -73,5 +73,7 @@ "random": "ngẫu nhiên", "international": "quốc tế", "projects": "dự án", - "challenge_counter": "{{index}} trong {{total}}" + "challenge_counter": "{{index}} trong {{total}}", + "embed": "nhúng", + "remove": "xóa" } \ No newline at end of file diff --git a/public/translations/zh/default.json b/public/translations/zh/default.json index 3266e6aa..145855da 100644 --- a/public/translations/zh/default.json +++ b/public/translations/zh/default.json @@ -73,5 +73,7 @@ "random": "随机", "international": "国际的", "projects": "项目", - "challenge_counter": "{{index}} / {{total}}" + "challenge_counter": "{{index}} / {{total}}", + "embed": "嵌入", + "remove": "移除" } \ No newline at end of file From 5f3ff17eccf3bf875493d1b1a0f4d4723f046f32 Mon Sep 17 00:00:00 2001 From: "plebeius.eth" Date: Wed, 8 May 2024 12:23:18 +0200 Subject: [PATCH 10/12] feat(reply modal): add c/parentCid above textarea, fix tomorrow theme --- src/components/post-form/post-form.module.css | 1 - .../reply-modal/reply-modal.module.css | 17 ++++++++++++++--- src/components/reply-modal/reply-modal.tsx | 3 +++ src/themes.css | 11 ++++++++--- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/components/post-form/post-form.module.css b/src/components/post-form/post-form.module.css index b90ea32e..71e01e1a 100644 --- a/src/components/post-form/post-form.module.css +++ b/src/components/post-form/post-form.module.css @@ -57,7 +57,6 @@ outline: var(--post-form-field-input-outline, revert); background-color: var(--post-form-field-input-background-color, revert); color: var(--post-form-field-input-color, revert); - filter: var(--filter80); padding: 2px 4px 3px; font-size: 10pt; } diff --git a/src/components/reply-modal/reply-modal.module.css b/src/components/reply-modal/reply-modal.module.css index 00c02f7a..ead7f8c3 100644 --- a/src/components/reply-modal/reply-modal.module.css +++ b/src/components/reply-modal/reply-modal.module.css @@ -39,18 +39,21 @@ } .container input[type="text"], .container textarea { - border: var(--post-form-field-input-border, revert); + border: var(--post-form-field-input-focus-border, revert); font-family: var(--post-form-field-font-family, revert); + appearance: var(--post-form-field-input-appearance, revert); + outline: var(--post-form-field-input-outline, revert); + background-color: var(--post-form-field-input-background-color, revert); + color: var(--post-form-field-input-color, revert); font-size: 10pt; outline: var(--post-form-field-input-outline, revert); width: 298px; - filter: var(--filter80); padding: 2px; margin-bottom: 1px; } .container input[type="text"]:focus, .container textarea:focus { - border: var(--post-form-field-input-focus-border, revert); + border: var(--reply-modal-field-border-focus, revert); } .content textarea { @@ -63,6 +66,14 @@ cursor: pointer; } +.parentCid input[type="text"] { + margin-bottom: -1px !important; +} + +.parentCid input[type="text"]:focus { + border: var(--post-form-field-input-focus-border) !important; +} + @media (max-width: 640px) { .container { position: absolute; diff --git a/src/components/reply-modal/reply-modal.tsx b/src/components/reply-modal/reply-modal.tsx index 0b0a069c..fae5fedb 100644 --- a/src/components/reply-modal/reply-modal.tsx +++ b/src/components/reply-modal/reply-modal.tsx @@ -88,6 +88,9 @@ const ReplyModal = ({ closeModal, parentCid, scrollY }: ReplyModalProps) => {
setContent.link(e.target.value)} />
+
+ +