diff --git a/packages/blog-starter-kit/themes/hashnode/components/features-posts.tsx b/packages/blog-starter-kit/themes/hashnode/components/features-posts.tsx index 7628e7f61..821477d78 100644 --- a/packages/blog-starter-kit/themes/hashnode/components/features-posts.tsx +++ b/packages/blog-starter-kit/themes/hashnode/components/features-posts.tsx @@ -9,11 +9,11 @@ import { getDefaultPostCoverImageUrl } from '../utils/commonUtils'; import { DEFAULT_AVATAR, blurImageDimensions } from '../utils/const/images'; import { getBlurHash, kFormatter, resizeImage } from '../utils/image'; -import { Post, PostThumbnailFragment, RequiredPublicationFieldsFragment } from '../generated/graphql'; +import { Post, PostThumbnailFragment, PublicationFragment } from '../generated/graphql'; const FeaturedPosts = (props: { posts: Array; - publication: Pick & { + publication: Pick & { pinnedPost?: Pick | null; }; }) => { diff --git a/packages/blog-starter-kit/themes/hashnode/components/header-blog-search.tsx b/packages/blog-starter-kit/themes/hashnode/components/header-blog-search.tsx index 27cce0c27..96845779c 100644 --- a/packages/blog-starter-kit/themes/hashnode/components/header-blog-search.tsx +++ b/packages/blog-starter-kit/themes/hashnode/components/header-blog-search.tsx @@ -3,19 +3,13 @@ import { useState, useRef } from 'react'; import dynamic from 'next/dynamic'; import CommonHeaderIconBtn from './common-header-icon-btn'; -import { Preferences, Publication, PublicationNavbarItem, User } from '../generated/graphql'; +import { PublicationFragment } from '../generated/graphql'; import SearchSVG from './icons/svgs/SearchSvg'; const PublicationSearch = dynamic(() => import('./publication-search'), { ssr: false }); interface Props { - publication: Pick & { - author: Pick; - } & { - preferences: Omit & { - navbarItems: Array>; - }; - }; + publication: Pick } const HeaderBlogSearch = (props: Props) => { diff --git a/packages/blog-starter-kit/themes/hashnode/components/header-left-sidebar.tsx b/packages/blog-starter-kit/themes/hashnode/components/header-left-sidebar.tsx index e9dc13895..cd38a5075 100644 --- a/packages/blog-starter-kit/themes/hashnode/components/header-left-sidebar.tsx +++ b/packages/blog-starter-kit/themes/hashnode/components/header-left-sidebar.tsx @@ -2,7 +2,7 @@ import dynamic from 'next/dynamic'; import { useState, useRef } from 'react'; -import { Preferences, Publication, PublicationNavbarItem, User } from '../generated/graphql'; +import { PublicationFragment } from '../generated/graphql'; import { BarsSVG } from './icons/svgs'; import CommonHeaderIconBtn from './common-header-icon-btn'; @@ -11,13 +11,7 @@ const PublicationSidebar = dynamic(() => import('./publication-sidebar'), { }); interface Props { - publication: Pick & { - author: Pick; - } & { - preferences: Omit & { - navbarItems: Array>; - }; - }; + publication: Pick; } const LeftSidebarButton = (props: Props) => { diff --git a/packages/blog-starter-kit/themes/hashnode/components/magazine-blog-post-preview.tsx b/packages/blog-starter-kit/themes/hashnode/components/magazine-blog-post-preview.tsx index 1555c745d..412642b76 100644 --- a/packages/blog-starter-kit/themes/hashnode/components/magazine-blog-post-preview.tsx +++ b/packages/blog-starter-kit/themes/hashnode/components/magazine-blog-post-preview.tsx @@ -6,11 +6,11 @@ import { getDefaultPostCoverImageUrl } from '../utils/commonUtils'; import { blurImageDimensions } from '../utils/const/images'; import { getBlurHash, resizeImage } from '../utils/image'; import { kFormatter } from '../utils/image'; -import { PostThumbnailFragment, RequiredPublicationFieldsFragment } from '../generated/graphql'; +import { PostThumbnailFragment, PublicationFragment } from '../generated/graphql'; function BlogPostPreview(props: { post: PostThumbnailFragment; - publication: Pick; + publication: Pick; }) { const { post, publication } = props; const postURL = `/${post.slug}`; diff --git a/packages/blog-starter-kit/themes/hashnode/components/modern-layout-posts.tsx b/packages/blog-starter-kit/themes/hashnode/components/modern-layout-posts.tsx index c0f7ec002..de2335d8f 100644 --- a/packages/blog-starter-kit/themes/hashnode/components/modern-layout-posts.tsx +++ b/packages/blog-starter-kit/themes/hashnode/components/modern-layout-posts.tsx @@ -2,7 +2,7 @@ import { Waypoint } from 'react-waypoint'; import Button from './hn-button'; import { ChevronDownSVG } from './icons/svgs'; -import { PageInfo, RequiredPublicationFieldsFragment, PostThumbnailFragment } from '../generated/graphql'; +import { PageInfo, PublicationFragment, PostThumbnailFragment } from '../generated/graphql'; import BlogPostPreview from './magazine-blog-post-preview'; const PublicationPosts = (props: { @@ -13,7 +13,7 @@ const PublicationPosts = (props: { }>; pageInfo: Pick; }; - publication: Pick; + publication: Pick; fetchMore: () => void; fetching: boolean; fetchedOnce: boolean; diff --git a/packages/blog-starter-kit/themes/hashnode/components/post-page-navbar.tsx b/packages/blog-starter-kit/themes/hashnode/components/post-page-navbar.tsx index cb87d4a03..1b8fadafc 100644 --- a/packages/blog-starter-kit/themes/hashnode/components/post-page-navbar.tsx +++ b/packages/blog-starter-kit/themes/hashnode/components/post-page-navbar.tsx @@ -11,26 +11,12 @@ import { ChevronLeftSVG } from './icons/svgs/'; import PublicationSocialLinks from './publication-social-links'; import useStickyNavScroll from './use-sticky-nav-scroll'; -import { - Preferences, - PublicationNavbarItem, - RequiredPublicationFieldsFragment, - User, -} from '../generated/graphql'; +import { PublicationFragment } from '../generated/graphql'; import { Button } from './custom-button'; import PublicationLogo from './publication-logo'; type Props = { - publication: Pick< - RequiredPublicationFieldsFragment, - 'id' | 'title' | 'url' | 'links' | 'features' | 'isTeam' - > & { - author: Pick; - } & { - preferences: Omit & { - navbarItems: Array>; - }; - }; + publication: Pick; }; const PostPageNavbar = forwardRef((props, ref) => { diff --git a/packages/blog-starter-kit/themes/hashnode/components/publication-nav-links.tsx b/packages/blog-starter-kit/themes/hashnode/components/publication-nav-links.tsx index d34663237..989cc0021 100644 --- a/packages/blog-starter-kit/themes/hashnode/components/publication-nav-links.tsx +++ b/packages/blog-starter-kit/themes/hashnode/components/publication-nav-links.tsx @@ -5,8 +5,9 @@ import Link from 'next/link'; import PerfectScrollbar from 'react-perfect-scrollbar'; import * as DropdownPrimitive from '@radix-ui/react-dropdown-menu'; import { twJoin } from 'tailwind-merge'; -import { useAppContext } from './contexts/appContext'; import { ChevronDownV2SVG } from './icons/svgs'; +import { PublicationFragment } from '../generated/graphql'; +import { MAX_MAIN_NAV_LINKS } from '../utils/const'; const PublicationNavLinksDropdown = dynamic( () => import('./publication-nav-links-dropdown'), @@ -15,15 +16,10 @@ const PublicationNavLinksDropdown = dynamic( }, ); -import { Publication } from '../generated/graphql'; -import { MAX_MAIN_NAV_LINKS } from '../utils/const'; - type Props = { currentActiveMenuItemId?: string | null; isHome?: boolean | null; -} & Pick, 'enabledPages' | 'navbarItems'> & { - navbarItems: Omit; - }; +} & Pick, 'enabledPages' | 'navbarItems'>; function PublicationNavLinks(props: Props) { const { currentActiveMenuItemId, isHome, enabledPages, navbarItems } = props; diff --git a/packages/blog-starter-kit/themes/hashnode/components/publication-posts.tsx b/packages/blog-starter-kit/themes/hashnode/components/publication-posts.tsx index 850e7ac25..be20bf02d 100644 --- a/packages/blog-starter-kit/themes/hashnode/components/publication-posts.tsx +++ b/packages/blog-starter-kit/themes/hashnode/components/publication-posts.tsx @@ -5,12 +5,12 @@ import { ChevronDownSVG } from './icons/svgs'; import Button from './hn-button'; import PubLoaderComponent from './pub-loader-component'; -import { PageInfo, Preferences, RequiredPublicationFieldsFragment, PostThumbnailFragment } from '../generated/graphql'; +import { PageInfo, Preferences, PublicationFragment, PostThumbnailFragment } from '../generated/graphql'; import BlogPostPreview from './blog-post-preview'; -export type RequiredPublicationProps = Pick & { +export type RequiredPublicationProps = Pick & { preferences: Pick; }; diff --git a/packages/blog-starter-kit/themes/hashnode/components/publication-sidebar-nav-links.tsx b/packages/blog-starter-kit/themes/hashnode/components/publication-sidebar-nav-links.tsx index 8df7ca5bf..3365d982a 100644 --- a/packages/blog-starter-kit/themes/hashnode/components/publication-sidebar-nav-links.tsx +++ b/packages/blog-starter-kit/themes/hashnode/components/publication-sidebar-nav-links.tsx @@ -2,14 +2,14 @@ import Link from 'next/link'; import { twJoin } from 'tailwind-merge'; import { CheckSVG } from './icons/svgs'; -import { Publication } from '../generated/graphql'; +import { PublicationFragment } from '../generated/graphql'; type IPublicationSidebarNavLinks = { currentActiveMenuItemId?: string | null; isHome?: boolean | null; isBadge?: boolean | null; -} & Pick, 'enabledPages' | 'navbarItems'>; +} & Pick, 'enabledPages' | 'navbarItems'>; type IPublicationSidebarNavLinkItem = { href: string; @@ -40,9 +40,7 @@ const PublicationSidebarNavLinkItem = ({ function PublicationSidebarNavLinks(props: IPublicationSidebarNavLinks) { const { currentActiveMenuItemId, isHome, isBadge, enabledPages, navbarItems } = props; const isHomePage = !currentActiveMenuItemId && isHome; - const isBadgePage = !currentActiveMenuItemId && isBadge; const isNewsletterPage = currentActiveMenuItemId && currentActiveMenuItemId === 'newsletter'; - return (