Skip to content

Commit 53d777b

Browse files
MattIPv4Copilot
andauthored
chore: rename With... components (#9251)
* refactor(site): rename WithAvatarGroup to AvatarGroup Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * refactor(site): rename WithBadgeGroup to WebsiteBadge Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * refactor(site): rename WithBanner to WebsiteBanner Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * refactor(site): rename WithBlogCategories to BlogCategories Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * refactor(site): rename WithBlogCrossLinks to BlogCrossLinks Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * refactor(site): rename WithBreadcrumbs to Breadcrumbs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * refactor(site): rename WithDownloadSection to DownloadSection Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * refactor(site): rename WithLegal to FooterLegal Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * refactor(site): rename WithLayout to Layout Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * refactor(site): rename WithMetaBar to MetaBar Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * refactor(site): rename WithNodejsLogo to SiteLogo Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * refactor(site): rename WithSearch to Search Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * refactor(site): rename WithNavBar to NavBar Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * refactor(site): rename WithFooter to Footer Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * refactor(site): rename WithReleaseAlertBox to ReleaseAlertBox Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * refactor(site): rename WithReleaseSelect to ReleaseSelect Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * refactor(site): rename WithSidebar to Sidebar Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * refactor(site): rename WithSupporters to Supporters Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent bc4348d commit 53d777b

62 files changed

Lines changed: 191 additions & 199 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
'use client';
22

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

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

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

11-
type WithAvatarGroupProps = Omit<
12-
ComponentProps<typeof AvatarGroup>,
11+
type AvatarGroupProps = Omit<
12+
ComponentProps<typeof AvatarGroupContainer>,
1313
'avatars' | 'as'
1414
> &
1515
AuthorProps;
1616

17-
const WithAvatarGroup: FC<WithAvatarGroupProps> = ({
17+
const AvatarGroup: FC<AvatarGroupProps> = ({
1818
usernames,
1919
names,
2020
clickable = true,
2121
...props
2222
}) => (
23-
<AvatarGroup
23+
<AvatarGroupContainer
2424
avatars={getAuthors({
2525
usernames,
2626
names,
@@ -31,4 +31,4 @@ const WithAvatarGroup: FC<WithAvatarGroupProps> = ({
3131
/>
3232
);
3333

34-
export default WithAvatarGroup;
34+
export default AvatarGroup;

‎apps/site/components/Blog/BlogPostCard/index.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import Preview from '@node-core/ui-components/Common/Preview';
22
import { useTranslations } from 'next-intl';
33

4+
import AvatarGroup from '#site/components/AvatarGroup';
45
import FormattedTime from '#site/components/Common/FormattedTime';
56
import Link from '#site/components/Link';
6-
import WithAvatarGroup from '#site/components/withAvatarGroup';
77
import { mapBlogCategoryToPreviewType } from '#site/util/blog';
88

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

5151
<footer className={styles.footer}>
52-
<WithAvatarGroup names={authors} size="medium" clickable={false} />
52+
<AvatarGroup names={authors} size="medium" clickable={false} />
5353

5454
<div className={styles.author}>
5555
{authors && <p>{authors.join(', ')}</p>}

apps/site/components/withBlogCategories.tsx renamed to apps/site/components/BlogCategories.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { mapAuthorToCardAuthors } from '#site/util/author';
88
import type { BlogPostsRSC } from '#site/types';
99
import type { ComponentProps, FC } from 'react';
1010

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

21-
const WithBlogCategories: FC<WithBlogCategoriesProps> = ({
22-
categories,
23-
blogData,
24-
}) => {
21+
const BlogCategories: FC<BlogCategoriesProps> = ({ categories, blogData }) => {
2522
const t = useTranslations();
2623

2724
return (
@@ -58,4 +55,4 @@ const WithBlogCategories: FC<WithBlogCategoriesProps> = ({
5855
);
5956
};
6057

61-
export default WithBlogCategories;
58+
export default BlogCategories;

apps/site/components/withBlogCrossLinks.tsx renamed to apps/site/components/BlogCrossLinks.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { getBlogData } from '#site/util/blog';
55
import type { BlogCategory } from '#site/types';
66
import type { FC } from 'react';
77

8-
const WithBlogCrossLinks: FC = () => {
8+
const BlogCrossLinks: FC = () => {
99
const { pathname } = getClientContext();
1010

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

51-
export default WithBlogCrossLinks;
51+
export default BlogCrossLinks;
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client';
22

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

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

16-
type WithBreadcrumbsProps = {
16+
type BreadcrumbsProps = {
1717
navKeys?: Array<NavigationKeys>;
1818
};
1919

20-
const WithBreadcrumbs: FC<WithBreadcrumbsProps> = ({ navKeys = [] }) => {
20+
const Breadcrumbs: FC<BreadcrumbsProps> = ({ navKeys = [] }) => {
2121
const { getSideNavigation } = useSiteNavigation();
2222
const t = useTranslations();
2323
const { pathname } = useClientContext();
@@ -64,7 +64,7 @@ const WithBreadcrumbs: FC<WithBreadcrumbsProps> = ({ navKeys = [] }) => {
6464
};
6565

6666
return (
67-
<Breadcrumbs
67+
<BreadcrumbsContainer
6868
links={getBreadcrumbs()}
6969
maxLength={maxLength}
7070
as={Link}
@@ -73,4 +73,4 @@ const WithBreadcrumbs: FC<WithBreadcrumbsProps> = ({ navKeys = [] }) => {
7373
);
7474
};
7575

76-
export default WithBreadcrumbs;
76+
export default Breadcrumbs;

apps/site/components/withDownloadSection.tsx renamed to apps/site/components/DownloadSection.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ import {
1212
import type { NodeRelease, NodeReleaseStatus } from '../types';
1313
import type { FC, PropsWithChildren } from 'react';
1414

15-
type WithDownloadSectionProps = PropsWithChildren<{
15+
type DownloadSectionProps = PropsWithChildren<{
1616
releases: Array<NodeRelease>;
1717
}>;
1818

19-
const WithDownloadSection: FC<WithDownloadSectionProps> = async ({
19+
const DownloadSection: FC<DownloadSectionProps> = async ({
2020
releases,
2121
children,
2222
}) => {
@@ -56,4 +56,4 @@ const WithDownloadSection: FC<WithDownloadSectionProps> = async ({
5656
);
5757
};
5858

59-
export default WithDownloadSection;
59+
export default DownloadSection;

‎apps/site/components/Downloads/Release/ReleaseCodeBox.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { use, useMemo } from 'react';
99
import CodeBox from '#site/components/Common/CodeBox';
1010
import LinkWithArrow from '#site/components/Common/LinkWithArrow';
1111
import Link from '#site/components/Link';
12-
import WithReleaseAlertBox from '#site/components/withReleaseAlertBox';
12+
import ReleaseAlertBox from '#site/components/ReleaseAlertBox';
1313
import {
1414
ReleaseContext,
1515
ReleasesContext,
@@ -149,7 +149,7 @@ const ReleaseCodeBox: FC = () => {
149149
</noscript>
150150

151151
{/* Release status alert */}
152-
<WithReleaseAlertBox release={context.release} releases={releases} />
152+
<ReleaseAlertBox release={context.release} releases={releases} />
153153

154154
{/* Community platform notice */}
155155
{platformInfo.exists && !platformInfo.recommended && (
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import BadgeGroup from '@node-core/ui-components/Common/BadgeGroup';
2-
import Footer from '@node-core/ui-components/Containers/Footer';
2+
import FooterContainer from '@node-core/ui-components/Containers/Footer';
33
import { useTranslations } from 'next-intl';
44

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

99
import type { FC } from 'react';
1010

11-
import WithLegal from './withLegal';
11+
import FooterLegal from './FooterLegal';
1212
import WithNodeRelease from './withNodeRelease';
1313

14-
const WithFooter: FC = () => {
14+
const Footer: FC = () => {
1515
const t = useTranslations();
1616
const { pathname } = getClientContext();
1717

@@ -54,10 +54,10 @@ const WithFooter: FC = () => {
5454
</div>
5555
);
5656

57-
const legal = <WithLegal footerLinks={navigation.footerLinks} />;
57+
const legal = <FooterLegal footerLinks={navigation.footerLinks} />;
5858

5959
return (
60-
<Footer
60+
<FooterContainer
6161
navigation={navigation}
6262
as={Link}
6363
pathname={pathname}
@@ -66,4 +66,4 @@ const WithFooter: FC = () => {
6666
);
6767
};
6868

69-
export default WithFooter;
69+
export default Footer;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const RICH_TRANSLATION_KEYS = [
3131
'cookiePolicy',
3232
];
3333

34-
const WithLegal: FC<LegalProps> = ({ footerLinks }) => {
34+
const FooterLegal: FC<LegalProps> = ({ footerLinks }) => {
3535
const t = useTranslations();
3636

3737
/**
@@ -81,4 +81,4 @@ const WithLegal: FC<LegalProps> = ({ footerLinks }) => {
8181
);
8282
};
8383

84-
export default WithLegal;
84+
export default FooterLegal;
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ const layouts = {
2121
article: ArticlePageLayout,
2222
} satisfies Record<Layouts, FC>;
2323

24-
type WithLayoutProps<L = Layouts> = PropsWithChildren<{ layout: L }>;
24+
type LayoutProps<L = Layouts> = PropsWithChildren<{ layout: L }>;
2525

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

2929
return <LayoutComponent>{children}</LayoutComponent>;
3030
};
3131

32-
export default WithLayout;
32+
export default Layout;

0 commit comments

Comments
 (0)