Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
'use client';

import AvatarGroup from '@node-core/ui-components/Common/AvatarGroup';
import AvatarGroupContainer from '@node-core/ui-components/Common/AvatarGroup';

import Link from '#site/components/Link';
import { getAuthors } from '#site/util/author';

import type { AuthorProps } from '#site/types';
import type { ComponentProps, FC } from 'react';

type WithAvatarGroupProps = Omit<
ComponentProps<typeof AvatarGroup>,
type AvatarGroupProps = Omit<
ComponentProps<typeof AvatarGroupContainer>,
'avatars' | 'as'
> &
AuthorProps;

const WithAvatarGroup: FC<WithAvatarGroupProps> = ({
const AvatarGroup: FC<AvatarGroupProps> = ({
usernames,
names,
clickable = true,
...props
}) => (
<AvatarGroup
<AvatarGroupContainer
avatars={getAuthors({
usernames,
names,
Expand All @@ -31,4 +31,4 @@ const WithAvatarGroup: FC<WithAvatarGroupProps> = ({
/>
);

export default WithAvatarGroup;
export default AvatarGroup;
4 changes: 2 additions & 2 deletions apps/site/components/Blog/BlogPostCard/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Preview from '@node-core/ui-components/Common/Preview';
import { useTranslations } from 'next-intl';

import AvatarGroup from '#site/components/AvatarGroup';
import FormattedTime from '#site/components/Common/FormattedTime';
import Link from '#site/components/Link';
import WithAvatarGroup from '#site/components/withAvatarGroup';
import { mapBlogCategoryToPreviewType } from '#site/util/blog';

import type { BlogCategory } from '#site/types';
Expand Down Expand Up @@ -49,7 +49,7 @@ const BlogPostCard: FC<BlogPostCardProps> = ({
{description && <p className={styles.description}>{description}</p>}

<footer className={styles.footer}>
<WithAvatarGroup names={authors} size="medium" clickable={false} />
<AvatarGroup names={authors} size="medium" clickable={false} />

<div className={styles.author}>
{authors && <p>{authors.join(', ')}</p>}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { mapAuthorToCardAuthors } from '#site/util/author';
import type { BlogPostsRSC } from '#site/types';
import type { ComponentProps, FC } from 'react';

type WithBlogCategoriesProps = {
type BlogCategoriesProps = {
categories: ComponentProps<typeof LinkTabs>['tabs'];
blogData: BlogPostsRSC & { category: string; page: number };
};
Expand All @@ -18,10 +18,7 @@ const mapPaginationPages = (category: string, pages: number) =>
url: `/blog/${category}/page/${page + 1}`,
}));

const WithBlogCategories: FC<WithBlogCategoriesProps> = ({
categories,
blogData,
}) => {
const BlogCategories: FC<BlogCategoriesProps> = ({ categories, blogData }) => {
const t = useTranslations();

return (
Expand Down Expand Up @@ -58,4 +55,4 @@ const WithBlogCategories: FC<WithBlogCategoriesProps> = ({
);
};

export default WithBlogCategories;
export default BlogCategories;
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { getBlogData } from '#site/util/blog';
import type { BlogCategory } from '#site/types';
import type { FC } from 'react';

const WithBlogCrossLinks: FC = () => {
const BlogCrossLinks: FC = () => {
const { pathname } = getClientContext();

// Extracts from the static URL the components used for the Blog Post slug
Expand Down Expand Up @@ -48,4 +48,4 @@ const WithBlogCrossLinks: FC = () => {
);
};

export default WithBlogCrossLinks;
export default BlogCrossLinks;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import Breadcrumbs from '@node-core/ui-components/Common/Breadcrumbs';
import BreadcrumbsContainer from '@node-core/ui-components/Common/Breadcrumbs';
import { useTranslations } from 'next-intl';

import Link from '#site/components/Link';
Expand All @@ -13,11 +13,11 @@ import type { NavigationKeys } from '#site/types';
import type { BreadcrumbLink } from '@node-core/ui-components/Common/Breadcrumbs';
import type { FC } from 'react';

type WithBreadcrumbsProps = {
type BreadcrumbsProps = {
navKeys?: Array<NavigationKeys>;
};

const WithBreadcrumbs: FC<WithBreadcrumbsProps> = ({ navKeys = [] }) => {
const Breadcrumbs: FC<BreadcrumbsProps> = ({ navKeys = [] }) => {
const { getSideNavigation } = useSiteNavigation();
const t = useTranslations();
const { pathname } = useClientContext();
Expand Down Expand Up @@ -64,7 +64,7 @@ const WithBreadcrumbs: FC<WithBreadcrumbsProps> = ({ navKeys = [] }) => {
};

return (
<Breadcrumbs
<BreadcrumbsContainer
links={getBreadcrumbs()}
maxLength={maxLength}
as={Link}
Expand All @@ -73,4 +73,4 @@ const WithBreadcrumbs: FC<WithBreadcrumbsProps> = ({ navKeys = [] }) => {
);
};

export default WithBreadcrumbs;
export default Breadcrumbs;
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import {
import type { NodeRelease, NodeReleaseStatus } from '../types';
import type { FC, PropsWithChildren } from 'react';

type WithDownloadSectionProps = PropsWithChildren<{
type DownloadSectionProps = PropsWithChildren<{
releases: Array<NodeRelease>;
}>;

const WithDownloadSection: FC<WithDownloadSectionProps> = async ({
const DownloadSection: FC<DownloadSectionProps> = async ({
releases,
children,
}) => {
Expand Down Expand Up @@ -56,4 +56,4 @@ const WithDownloadSection: FC<WithDownloadSectionProps> = async ({
);
};

export default WithDownloadSection;
export default DownloadSection;
4 changes: 2 additions & 2 deletions apps/site/components/Downloads/Release/ReleaseCodeBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { use, useMemo } from 'react';
import CodeBox from '#site/components/Common/CodeBox';
import LinkWithArrow from '#site/components/Common/LinkWithArrow';
import Link from '#site/components/Link';
import WithReleaseAlertBox from '#site/components/withReleaseAlertBox';
import ReleaseAlertBox from '#site/components/ReleaseAlertBox';
import {
ReleaseContext,
ReleasesContext,
Expand Down Expand Up @@ -149,7 +149,7 @@ const ReleaseCodeBox: FC = () => {
</noscript>

{/* Release status alert */}
<WithReleaseAlertBox release={context.release} releases={releases} />
<ReleaseAlertBox release={context.release} releases={releases} />

{/* Community platform notice */}
{platformInfo.exists && !platformInfo.recommended && (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import BadgeGroup from '@node-core/ui-components/Common/BadgeGroup';
import Footer from '@node-core/ui-components/Containers/Footer';
import FooterContainer from '@node-core/ui-components/Containers/Footer';
import { useTranslations } from 'next-intl';

import { getClientContext } from '#site/client-context';
Expand All @@ -8,10 +8,10 @@ import { siteNavigation } from '#site/next.json.mjs';

import type { FC } from 'react';

import WithLegal from './withLegal';
import FooterLegal from './FooterLegal';
import WithNodeRelease from './withNodeRelease';

const WithFooter: FC = () => {
const Footer: FC = () => {
const t = useTranslations();
const { pathname } = getClientContext();

Expand Down Expand Up @@ -54,10 +54,10 @@ const WithFooter: FC = () => {
</div>
);

const legal = <WithLegal footerLinks={navigation.footerLinks} />;
const legal = <FooterLegal footerLinks={navigation.footerLinks} />;

return (
<Footer
<FooterContainer
navigation={navigation}
as={Link}
pathname={pathname}
Expand All @@ -66,4 +66,4 @@ const WithFooter: FC = () => {
);
};

export default WithFooter;
export default Footer;
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const RICH_TRANSLATION_KEYS = [
'cookiePolicy',
];

const WithLegal: FC<LegalProps> = ({ footerLinks }) => {
const FooterLegal: FC<LegalProps> = ({ footerLinks }) => {
const t = useTranslations();

/**
Expand Down Expand Up @@ -81,4 +81,4 @@ const WithLegal: FC<LegalProps> = ({ footerLinks }) => {
);
};

export default WithLegal;
export default FooterLegal;
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ const layouts = {
article: ArticlePageLayout,
} satisfies Record<Layouts, FC>;

type WithLayoutProps<L = Layouts> = PropsWithChildren<{ layout: L }>;
type LayoutProps<L = Layouts> = PropsWithChildren<{ layout: L }>;

const WithLayout: FC<WithLayoutProps<Layouts>> = ({ layout, children }) => {
const Layout: FC<LayoutProps<Layouts>> = ({ layout, children }) => {
const LayoutComponent = layouts[layout] ?? DefaultLayout;

return <LayoutComponent>{children}</LayoutComponent>;
};

export default WithLayout;
export default Layout;
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
'use client';

import MetaBar from '@node-core/ui-components/Containers/MetaBar';
import MetaBarContainer from '@node-core/ui-components/Containers/MetaBar';
import GitHubIcon from '@node-core/ui-components/Icons/Social/GitHub';
import { defaultLocale } from '@node-core/website-i18n';
import { useFormatter, useLocale, useTranslations } from 'next-intl';

import AvatarGroup from '#site/components/AvatarGroup';
import Link from '#site/components/Link';
import WithAvatarGroup from '#site/components/withAvatarGroup';
import useClientContext from '#site/hooks/useClientContext';
import useMediaQuery from '#site/hooks/useMediaQuery';
import { DEFAULT_DATE_FORMAT } from '#site/next.calendar.constants.mjs';
Expand All @@ -15,7 +15,7 @@ import { getGitHubBlobUrl } from '#site/util/github';

import type { FC } from 'react';

const WithMetaBar: FC = () => {
const MetaBar: FC = () => {
const { headings, readingTime, frontmatter, filename } = useClientContext();
const formatter = useFormatter();
const lastUpdated = frontmatter.date
Expand All @@ -41,7 +41,7 @@ const WithMetaBar: FC = () => {
const isSmallerThanDesktop = useMediaQuery('(max-width: 1280px)');

return (
<MetaBar
<MetaBarContainer
heading={t('components.metabar.tableOfContents')}
as={Link}
aria-label={t('components.metabar.metadata')}
Expand All @@ -52,7 +52,7 @@ const WithMetaBar: FC = () => {
[t(
`components.metabar.${usernames.length > 1 ? 'authors' : 'author'}`
)]: (
<WithAvatarGroup
<AvatarGroup
usernames={usernames}
limit={isSmallerThanDesktop ? 5 : 8}
/>
Expand All @@ -78,4 +78,4 @@ const WithMetaBar: FC = () => {
);
};

export default WithMetaBar;
export default MetaBar;
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import LanguageDropdown from '@node-core/ui-components/Common/LanguageDropDown';
import Skeleton from '@node-core/ui-components/Common/Skeleton';
import SkipToContentButton from '@node-core/ui-components/Common/SkipToContentButton';
import NavBar from '@node-core/ui-components/Containers/NavBar';
import NavBarContainer from '@node-core/ui-components/Containers/NavBar';
// TODO(@AvivKeller): I don't like that we are importing styles from another module
import styles from '@node-core/ui-components/Containers/NavBar/index.module.css';
import GitHubIcon from '@node-core/ui-components/Icons/Social/GitHub';
Expand All @@ -13,9 +13,9 @@ import { useLocale, useTranslations } from 'next-intl';
import { useTheme } from 'next-themes';

import Link from '#site/components/Link';
import WithBanner from '#site/components/withBanner';
import WithNodejsLogo from '#site/components/withNodejsLogo';
import WithSearch from '#site/components/withSearch';
import Search from '#site/components/Search';
import SiteLogo from '#site/components/SiteLogo';
import WebsiteBanner from '#site/components/WebsiteBanner';
import useSiteNavigation from '#site/hooks/useSiteNavigation';
import { useRouter, usePathname } from '#site/navigation.mjs';

Expand All @@ -33,7 +33,7 @@ const ThemeToggle = dynamic(
}
);

const WithNavBar: FC = () => {
const NavBar: FC = () => {
const { navigationItems } = useSiteNavigation();
const { theme, setTheme } = useTheme();
const { replace } = useRouter();
Expand All @@ -51,9 +51,9 @@ const WithNavBar: FC = () => {
{t('components.common.skipToContent')}
</SkipToContentButton>

<WithBanner section="index" />
<WebsiteBanner section="index" />

<NavBar
<NavBarContainer
navItems={navigationItems.map(
([, { label, link, target, accent }]) => ({
link,
Expand All @@ -64,12 +64,12 @@ const WithNavBar: FC = () => {
)}
pathname={pathname}
as={Link}
Logo={WithNodejsLogo}
Logo={SiteLogo}
sidebarItemTogglerAriaLabel={t(
'components.containers.navBar.controls.toggle'
)}
>
<WithSearch />
<Search />

<ThemeToggle
onChange={setTheme}
Expand All @@ -96,9 +96,9 @@ const WithNavBar: FC = () => {
>
<GitHubIcon />
</Link>
</NavBar>
</NavBarContainer>
</div>
);
};

export default WithNavBar;
export default NavBar;
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@ import Link from '#site/components/Link';
import type { NodeRelease } from '#site/types';
import type { FC } from 'react';

type WithReleaseAlertBoxProps = {
type ReleaseAlertBoxProps = {
release: NodeRelease;
releases: Array<NodeRelease>;
};

const WithReleaseAlertBox: FC<WithReleaseAlertBoxProps> = ({
release,
releases,
}) => {
const ReleaseAlertBox: FC<ReleaseAlertBoxProps> = ({ release, releases }) => {
const t = useTranslations();

switch (release.status) {
Expand Down Expand Up @@ -75,4 +72,4 @@ const WithReleaseAlertBox: FC<WithReleaseAlertBoxProps> = ({
}
};

export default WithReleaseAlertBox;
export default ReleaseAlertBox;
Loading
Loading