From e239abf031d3b9d66a528c9fc23ef79960afa727 Mon Sep 17 00:00:00 2001 From: MTG2000 Date: Mon, 15 Aug 2022 10:08:52 +0300 Subject: [PATCH 1/2] fix: remove default padding form edit-profile card --- .../EditProfilePage/UpdateMyProfileTab/UpdateMyProfileTab.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/Profiles/pages/EditProfilePage/UpdateMyProfileTab/UpdateMyProfileTab.tsx b/src/features/Profiles/pages/EditProfilePage/UpdateMyProfileTab/UpdateMyProfileTab.tsx index 42fda77..9f354a6 100644 --- a/src/features/Profiles/pages/EditProfilePage/UpdateMyProfileTab/UpdateMyProfileTab.tsx +++ b/src/features/Profiles/pages/EditProfilePage/UpdateMyProfileTab/UpdateMyProfileTab.tsx @@ -111,7 +111,7 @@ export default function UpdateMyProfileTab({ data, onClose }: Props) { return (
- +
From 3c9af29efc9dce844b391c0a7880057553536741 Mon Sep 17 00:00:00 2001 From: MTG2000 Date: Tue, 16 Aug 2022 15:49:51 +0300 Subject: [PATCH 2/2] fix: profile menu alignment, lazy load comments section, remove log from trimFunc --- src/Components/Navbar/NavDesktop.tsx | 2 ++ src/Components/Navbar/NavMobile.tsx | 2 ++ src/Components/Navbar/Navbar.tsx | 1 + src/features/Posts/Components/Comments/index.tsx | 2 +- .../QuestionPageContent/QuestionPageContent.tsx | 3 ++- .../Posts/pages/PostDetailsPage/PostDetailsPage.tsx | 13 +++++++++---- src/utils/helperFunctions.tsx | 2 -- 7 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/Components/Navbar/NavDesktop.tsx b/src/Components/Navbar/NavDesktop.tsx index 2b2d625..5bbc318 100644 --- a/src/Components/Navbar/NavDesktop.tsx +++ b/src/Components/Navbar/NavDesktop.tsx @@ -166,6 +166,8 @@ export default function NavDesktop() { {curUser !== undefined && (curUser ? }> }> import("src/features/Posts/Components/Comments")) interface Props { question: Question diff --git a/src/features/Posts/pages/PostDetailsPage/PostDetailsPage.tsx b/src/features/Posts/pages/PostDetailsPage/PostDetailsPage.tsx index 06c9417..a8875ee 100644 --- a/src/features/Posts/pages/PostDetailsPage/PostDetailsPage.tsx +++ b/src/features/Posts/pages/PostDetailsPage/PostDetailsPage.tsx @@ -4,15 +4,17 @@ import { useParams } from 'react-router-dom' import NotFoundPage from 'src/features/Shared/pages/NotFoundPage/NotFoundPage' import { Post_Type, usePostDetailsQuery } from 'src/graphql' import { capitalize } from 'src/utils/helperFunctions' -import { CommentsSection } from '../../Components/Comments' import ScrollToTop from 'src/utils/routing/scrollToTop' -import TrendingCard from '../../Components/TrendingCard/TrendingCard' +import TrendingCard from 'src/features/Posts/Components/TrendingCard/TrendingCard' import AuthorCard from './Components/AuthorCard/AuthorCard' import PageContent from './Components/PageContent/PageContent' import PostActions from './Components/PostActions/PostActions' import PostDetailsPageSkeleton from './PostDetailsPage.skeleton' import styles from './styles.module.scss' +import { lazy, Suspense } from 'react' +import { RotatingLines } from 'react-loader-spinner' +const CommentsSection = lazy(() => import("src/features/Posts/Components/Comments")) export default function PostDetailsPage() { const { type: _type, id } = useParams(); @@ -60,8 +62,11 @@ export default function PostDetailsPage() {
- - +
+ }> + +
diff --git a/src/utils/helperFunctions.tsx b/src/utils/helperFunctions.tsx index 1703ba0..f842ac8 100644 --- a/src/utils/helperFunctions.tsx +++ b/src/utils/helperFunctions.tsx @@ -62,8 +62,6 @@ export function lazyModal> } export function trimText(text: string | undefined | null, length: number) { - console.log(text); - if (!text) return ''; return text.slice(0, length) + (text.length > length ? "..." : "") }