From 4266964323d8804005be4f8b18c0caa7bea3a928 Mon Sep 17 00:00:00 2001 From: "plebeius.eth" Date: Thu, 18 Jan 2024 12:01:37 +0100 Subject: [PATCH 01/11] feat(sidebar): add desktop app banner --- src/components/sidebar/sidebar.module.css | 21 +++++++++++++++++++-- src/components/sidebar/sidebar.tsx | 13 ++++++++++++- src/themes.css | 2 ++ 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/components/sidebar/sidebar.module.css b/src/components/sidebar/sidebar.module.css index 96cfa2f8..3729c946 100644 --- a/src/components/sidebar/sidebar.module.css +++ b/src/components/sidebar/sidebar.module.css @@ -258,7 +258,7 @@ a { } .footer { - font-family: arial, verdana, helvetica, sans-serif; + font: normal x-small verdana, arial, helvetica, sans-serif; } .footer ul { @@ -286,11 +286,28 @@ a { } .version { - margin: 14px 0 24px 0; + margin: 7px 0 24px 0; text-align: center; font-size: 10px; } .unstable a { color: var(--yellow); +} + +.desktopAd { + margin-top: 10px; + padding: 5px 0 15px 0; +} + +.desktopAdSubtitle { + font: normal x-small verdana, arial, helvetica, sans-serif; + font-size: 10px; + color: var(--gray-strong); +} + +.desktopAdMascot img { + height: 40px; + margin: 5px 10px 0 0; + float: left; } \ No newline at end of file diff --git a/src/components/sidebar/sidebar.tsx b/src/components/sidebar/sidebar.tsx index 06c1d18e..1679f974 100644 --- a/src/components/sidebar/sidebar.tsx +++ b/src/components/sidebar/sidebar.tsx @@ -224,9 +224,20 @@ const Sidebar = ({ address, cid, createdAt, description, downvoteCount = 0, role +
+ + seedit mascot + + +
+ ...each community's data needs to be seeded! +
+ ...seed it automatically with the desktop app. +
+
- seedit {commitRef ? 'development build ' + commitRef : window.electron && window.electron.isElectron ? 'desktop' : 'web'} v{version} - GPL 2.0 + seedit {commitRef ? 'dev build (unstable) ' + commitRef : window.electron && window.electron.isElectron ? 'desktop' : 'web'} v{version} - GPL 2.0
diff --git a/src/themes.css b/src/themes.css index d2b628fb..36f95c1c 100644 --- a/src/themes.css +++ b/src/themes.css @@ -9,6 +9,7 @@ --code-background: #fcfcfb; --code-border: #e6e6de; --red: red; + --gray-strong: dimgray; --gray-footer: #777; --gray-contrast: #888; --gray-overlay: #F7F7F7; @@ -68,6 +69,7 @@ --code-background: rgb(19, 19, 13); --code-border: rgb(52, 58, 60); --red: rgb(200, 0, 0); + --gray-strong: rgb(168, 160, 147); --gray-footer: rgb(158, 149, 136); --gray-contrast: #c7c7c7; --gray-overlay: #1f1f1f; From e1e28b94909149ecd9ebd92e7241a93918f74cd7 Mon Sep 17 00:00:00 2001 From: "plebeius.eth" Date: Thu, 18 Jan 2024 12:25:13 +0100 Subject: [PATCH 02/11] feat: add mobile about page to home, p/all --- src/app.tsx | 3 +++ src/components/header/header.tsx | 10 +++++++--- src/components/sidebar/sidebar.tsx | 5 +++-- src/lib/utils/view-utils.ts | 10 ++++++++++ 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/app.tsx b/src/app.tsx index 14f1b7ef..c7ff5e8d 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -80,6 +80,9 @@ function App() { } /> + } /> + + } /> } /> } /> diff --git a/src/components/header/header.tsx b/src/components/header/header.tsx index 1bf589a6..0addc432 100644 --- a/src/components/header/header.tsx +++ b/src/components/header/header.tsx @@ -7,10 +7,12 @@ import { getAboutLink, isAboutView, isAllView, + isAllAboutView, isAuthorView, isAuthorCommentsView, isAuthorSubmittedView, isProfileDownvotedView, + isHomeAboutView, isHomeView, isInboxView, isPendingView, @@ -235,6 +237,7 @@ const HeaderTabs = () => { const location = useLocation(); const isInAllView = isAllView(location.pathname); const isInAuthorView = isAuthorView(location.pathname); + const isInHomeAboutView = isHomeAboutView(location.pathname); const isInHomeView = isHomeView(location.pathname, params); const isInInboxView = isInboxView(location.pathname); const isInPendingView = isPendingView(location.pathname, params); @@ -247,7 +250,7 @@ const HeaderTabs = () => { if (isInPostView) { return ; - } else if (isInHomeView || (isInSubplebbitView && !isInSubplebbitSubmitView && !isInSubplebbitSettingsView) || isInAllView) { + } else if (isInHomeView || isInHomeAboutView || (isInSubplebbitView && !isInSubplebbitSubmitView && !isInSubplebbitSettingsView) || isInAllView) { return ; } else if ((isInProfileView || isInAuthorView) && !isInPendingView) { return ; @@ -321,6 +324,7 @@ const Header = () => { const isMobile = window.innerWidth < 768; const isInAboutView = isAboutView(location.pathname); + const isInAllAboutView = isAllAboutView(location.pathname); const isInAllView = isAllView(location.pathname); const isInAuthorView = isAuthorView(location.pathname); const isInHomeView = isHomeView(location.pathname, params); @@ -343,7 +347,7 @@ const Header = () => { isInHomeView || (isInSubplebbitView && !isInSubplebbitSubmitView && !isInSubplebbitSettingsView && !isInPostView && !isInAboutView) || (isInProfileView && !isInAboutView) || - isInAllView || + (isInAllView && !isInAllAboutView) || (isInAuthorView && !isInAboutView); const logoSrc = isInSubplebbitView ? suggested?.avatarUrl : isInProfileView ? imageUrl : 'assets/logo/seedit.png'; const logoIsAvatar = (isInSubplebbitView && suggested?.avatarUrl) || (isInProfileView && imageUrl); @@ -385,7 +389,7 @@ const Header = () => {
    - {(isInSubplebbitView || isInSubplebbitSubmitView || isInPostView) && } + {(isInHomeView || isInAllView || isInAboutView || isInSubplebbitView || isInSubplebbitSubmitView || isInPostView) && }
)} diff --git a/src/components/sidebar/sidebar.tsx b/src/components/sidebar/sidebar.tsx index 1679f974..77cadbf2 100644 --- a/src/components/sidebar/sidebar.tsx +++ b/src/components/sidebar/sidebar.tsx @@ -5,7 +5,7 @@ import { useAccount, useBlock, Role, useSubplebbitStats, useAccountComment } fro import styles from './sidebar.module.css'; import { getFormattedDate, getFormattedTimeDuration, getFormattedTimeAgo } from '../../lib/utils/time-utils'; import { findSubplebbitCreator } from '../../lib/utils/user-utils'; -import { isAboutView, isAllView, isHomeView, isPendingView, isPostView, isSubplebbitSettingsView, isSubplebbitsView } from '../../lib/utils/view-utils'; +import { isAboutView, isAllView, isHomeAboutView, isHomeView, isPendingView, isPostView, isSubplebbitSettingsView, isSubplebbitsView } from '../../lib/utils/view-utils'; import Markdown from '../markdown'; import SearchBar from '../search-bar'; import SubscribeButton from '../subscribe-button'; @@ -109,6 +109,7 @@ const Sidebar = ({ address, cid, createdAt, description, downvoteCount = 0, role const params = useParams(); const isInAboutView = isAboutView(location.pathname); const isInAllView = isAllView(location.pathname); + const isInHomeAboutView = isHomeAboutView(location.pathname); const isInHomeView = isHomeView(location.pathname, params); const isInPendingView = isPendingView(location.pathname, params); const isInPostView = isPostView(location.pathname, params); @@ -158,7 +159,7 @@ const Sidebar = ({ address, cid, createdAt, description, downvoteCount = 0, role
- {!isInHomeView && !isInAllView && !isInPendingView && !isInSubplebbitsView && ( + {!isInHomeView && !isInHomeAboutView && !isInAllView && !isInPendingView && !isInSubplebbitsView && (
{address} diff --git a/src/lib/utils/view-utils.ts b/src/lib/utils/view-utils.ts index 1363125a..ca0c3967 100644 --- a/src/lib/utils/view-utils.ts +++ b/src/lib/utils/view-utils.ts @@ -21,6 +21,8 @@ export const getAboutLink = (pathname: string, params: ParamsType): string => { return '/profile/about'; } else if (pathname.startsWith('/u/')) { return `/u/${params.authorAddress}/c/${params.commentCid}/about`; + } else if (pathname.startsWith('/p/all')) { + return '/p/all/about'; } else { return '/about'; } @@ -34,6 +36,10 @@ export const isAllView = (pathname: string): boolean => { return pathname.startsWith('/p/all'); }; +export const isAllAboutView = (pathname: string): boolean => { + return pathname === '/p/all/about'; +}; + export const isAuthorView = (pathname: string): boolean => { return pathname.startsWith('/u/'); }; @@ -54,6 +60,10 @@ export const isHomeView = (pathname: string, params: ParamsType): boolean => { return pathname === '/' || sortTypes.includes(pathname) || (timeFilterNames.includes(params.timeFilterName as TimeFilterKey) && !pathname.startsWith('/p/all')); }; +export const isHomeAboutView = (pathname: string): boolean => { + return pathname === '/about'; +}; + export const isInboxView = (pathname: string): boolean => { return pathname.startsWith('/inbox'); }; From 97c7b1c012d23d310c47f3fab5a8825c5733a7b3 Mon Sep 17 00:00:00 2001 From: "plebeius.eth" Date: Thu, 18 Jan 2024 13:20:22 +0100 Subject: [PATCH 03/11] Update sidebar.tsx --- src/components/sidebar/sidebar.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/sidebar/sidebar.tsx b/src/components/sidebar/sidebar.tsx index 77cadbf2..c52c647d 100644 --- a/src/components/sidebar/sidebar.tsx +++ b/src/components/sidebar/sidebar.tsx @@ -231,9 +231,9 @@ const Sidebar = ({ address, cid, createdAt, description, downvoteCount = 0, role
- ...each community's data needs to be seeded! + ...each community's data needs to be seeded.
- ...seed it automatically with the desktop app. + ...use the desktop app to seed it automatically!
From feba4ed6857e9146fb47e9e87eb9a54f0f0eae22 Mon Sep 17 00:00:00 2001 From: "plebeius.eth" Date: Thu, 18 Jan 2024 13:34:49 +0100 Subject: [PATCH 04/11] Update sidebar.tsx --- src/components/sidebar/sidebar.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/sidebar/sidebar.tsx b/src/components/sidebar/sidebar.tsx index c52c647d..743a9e45 100644 --- a/src/components/sidebar/sidebar.tsx +++ b/src/components/sidebar/sidebar.tsx @@ -119,7 +119,8 @@ const Sidebar = ({ address, cid, createdAt, description, downvoteCount = 0, role const subplebbitCreator = findSubplebbitCreator(roles); const creatorAddress = subplebbitCreator === 'anonymous' ? 'anonymous' : `${getShortAddress(subplebbitCreator)}`; - const submitRoute = isInHomeView || isInAllView ? '/submit' : isInPendingView ? `/p/${pendingPost?.subplebbitAddress}/submit` : `/p/${address}/submit`; + const submitRoute = + isInHomeView || isInHomeAboutView || isInAllView ? '/submit' : isInPendingView ? `/p/${pendingPost?.subplebbitAddress}/submit` : `/p/${address}/submit`; const { blocked, unblock, block } = useBlock({ address }); From 90f9d3546c4fcd1d03fdcdcd3e8c5b7b26e13c35 Mon Sep 17 00:00:00 2001 From: "plebeius.eth" Date: Thu, 18 Jan 2024 13:48:18 +0100 Subject: [PATCH 05/11] fix(subplebbit): selecting the time filter would bug the header title and topbar --- src/lib/utils/view-utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/utils/view-utils.ts b/src/lib/utils/view-utils.ts index ca0c3967..d8d11b6d 100644 --- a/src/lib/utils/view-utils.ts +++ b/src/lib/utils/view-utils.ts @@ -57,7 +57,7 @@ export const isProfileDownvotedView = (pathname: string): boolean => { }; export const isHomeView = (pathname: string, params: ParamsType): boolean => { - return pathname === '/' || sortTypes.includes(pathname) || (timeFilterNames.includes(params.timeFilterName as TimeFilterKey) && !pathname.startsWith('/p/all')); + return pathname === '/' || sortTypes.includes(pathname) || (timeFilterNames.includes(params.timeFilterName as TimeFilterKey) && !pathname.startsWith('/p/')); }; export const isHomeAboutView = (pathname: string): boolean => { From cf6f7d99470ff4b0f9154a4c5fe965cecf929fc8 Mon Sep 17 00:00:00 2001 From: "plebeius.eth" Date: Thu, 18 Jan 2024 15:07:18 +0100 Subject: [PATCH 06/11] feat(sidebar): version footer links to specific version changelog --- src/components/sidebar/sidebar.module.css | 2 +- src/components/sidebar/sidebar.tsx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/sidebar/sidebar.module.css b/src/components/sidebar/sidebar.module.css index 3729c946..0afc9422 100644 --- a/src/components/sidebar/sidebar.module.css +++ b/src/components/sidebar/sidebar.module.css @@ -306,7 +306,7 @@ a { color: var(--gray-strong); } -.desktopAdMascot img { +.desktopAdLogo img { height: 40px; margin: 5px 10px 0 0; float: left; diff --git a/src/components/sidebar/sidebar.tsx b/src/components/sidebar/sidebar.tsx index 743a9e45..1778c9de 100644 --- a/src/components/sidebar/sidebar.tsx +++ b/src/components/sidebar/sidebar.tsx @@ -227,18 +227,18 @@ const Sidebar = ({ address, cid, createdAt, description, downvoteCount = 0, role
- + seedit mascot
- ...each community's data needs to be seeded. + ...each community needs to be seeded.
- ...use the desktop app to seed it automatically! + ...the desktop app seeds automatically!
From dbd2f348fbcf7009f6e0abacb7eb30423e32adf7 Mon Sep 17 00:00:00 2001 From: "plebeius.eth" Date: Thu, 18 Jan 2024 21:07:16 +0100 Subject: [PATCH 07/11] fix(topbar): subscriptions were showing in default sub list --- package.json | 6 +++--- src/components/sidebar/sidebar.tsx | 2 +- src/components/topbar/topbar.tsx | 10 +++++----- yarn.lock | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 2178f056..fe6750e3 100644 --- a/package.json +++ b/package.json @@ -27,12 +27,12 @@ "react": "18.2.0", "react-dom": "18.2.0", "react-i18next": "13.2.2", - "react-markdown": "^9.0.1", + "react-markdown": "9.0.1", "react-router-dom": "6.16.0", "react-scripts": "5.0.1", "react-virtuoso": "4.6.0", - "rehype-sanitize": "^6.0.0", - "remark-gfm": "^4.0.0", + "rehype-sanitize": "6.0.0", + "remark-gfm": "4.0.0", "tcp-port-used": "1.0.2", "typescript": "5.2.2", "zustand": "4.4.3" diff --git a/src/components/sidebar/sidebar.tsx b/src/components/sidebar/sidebar.tsx index 1778c9de..ddc366d4 100644 --- a/src/components/sidebar/sidebar.tsx +++ b/src/components/sidebar/sidebar.tsx @@ -204,7 +204,7 @@ const Sidebar = ({ address, cid, createdAt, description, downvoteCount = 0, role {roles && }