Skip to content

Commit c504db2

Browse files
committed
Rename path
1 parent 20bdaae commit c504db2

File tree

10 files changed

+26
-26
lines changed

10 files changed

+26
-26
lines changed

projects/js-packages/publicize-components/src/components/form/share-post-form.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import useSocialMediaMessage from '../../hooks/use-social-media-message';
55
import { features } from '../../utils/constants';
66
import { useIsSocialNote } from '../../utils/use-is-social-note';
77
import MediaSection from '../media-section';
8+
import MediaSectionV2 from '../media-section-v2';
89
import MessageBoxControl from '../message-box-control';
9-
import NewMediaSection from '../new-media-section';
1010
import SocialImageGeneratorPanel from '../social-image-generator/panel';
1111
import styles from './styles.module.scss';
1212
import type { FC } from 'react';
@@ -43,7 +43,7 @@ export const SharePostForm: FC< SharePostFormProps > = ( { analyticsData = null
4343
) }
4444
{ siteHasFeature( features.UNIFIED_UI_V1 ) ? (
4545
<div className={ styles[ 'share-post-form__media-section' ] }>
46-
<NewMediaSection analyticsData={ analyticsData } />
46+
<MediaSectionV2 analyticsData={ analyticsData } />
4747
</div>
4848
) : (
4949
<>

projects/js-packages/publicize-components/src/components/new-media-section/index.tsx renamed to projects/js-packages/publicize-components/src/components/media-section-v2/index.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* NewMediaSection component
2+
* MediaSectionV2 component
33
* Unified media selection interface for social posts
44
*/
55

@@ -19,7 +19,7 @@ import CustomMediaToggle from './custom-media-toggle';
1919
import MediaPreview from './media-preview';
2020
import MediaSourceMenu, { getMediaSourceDescription } from './media-source-menu';
2121
import styles from './styles.module.scss';
22-
import { MediaSourceType, NewMediaSectionProps, MediaPreviewData, WPMediaObject } from './types';
22+
import { MediaSourceType, MediaSectionV2Props, MediaPreviewData, WPMediaObject } from './types';
2323

2424
/**
2525
* Detect the current media source based on existing data (for backward compatibility)
@@ -62,17 +62,17 @@ function detectMediaSource(
6262
}
6363

6464
/**
65-
* NewMediaSection component
65+
* MediaSectionV2 component
6666
*
6767
* @param {object} props - Component props
6868
* @param {object} props.analyticsData - Analytics data
6969
* @param {boolean} props.disabled - Whether the section is disabled
70-
* @return {object} NewMediaSection component
70+
* @return {object} MediaSectionV2 component
7171
*/
72-
export default function NewMediaSection( {
72+
export default function MediaSectionV2( {
7373
analyticsData = {},
7474
disabled = false,
75-
}: NewMediaSectionProps ) {
75+
}: MediaSectionV2Props ) {
7676
const { recordEvent } = useAnalytics();
7777
const featuredImageId = useFeaturedImage();
7878
const { isEnabled: sigEnabled } = useImageGeneratorConfig();
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { render, screen } from '@testing-library/react';
22
import userEvent from '@testing-library/user-event';
3-
import NewMediaSection from '..';
3+
import MediaSectionV2 from '..';
44
import useFeaturedImage from '../../../hooks/use-featured-image';
55
import useImageGeneratorConfig from '../../../hooks/use-image-generator-config';
66
import useMediaDetails from '../../../hooks/use-media-details';
@@ -76,26 +76,26 @@ jest.mock( '@wordpress/block-editor', () => ( {
7676
},
7777
} ) );
7878

79-
describe( 'NewMediaSection', () => {
79+
describe( 'MediaSectionV2', () => {
8080
beforeEach( () => {
8181
jest.clearAllMocks();
8282
} );
8383

8484
describe( 'Initial rendering', () => {
8585
it( 'should render the Media label', () => {
86-
render( <NewMediaSection /> );
86+
render( <MediaSectionV2 /> );
8787

8888
expect( screen.getByText( 'Media' ) ).toBeInTheDocument();
8989
} );
9090

9191
it( 'should show featured image description when featured image is detected', () => {
92-
render( <NewMediaSection /> );
92+
render( <MediaSectionV2 /> );
9393

9494
expect( screen.getByText( 'You are using your post featured image' ) ).toBeInTheDocument();
9595
} );
9696

9797
it( 'should show featured image preview', () => {
98-
render( <NewMediaSection /> );
98+
render( <MediaSectionV2 /> );
9999

100100
const img = screen.getByRole( 'img' );
101101
expect( img ).toBeInTheDocument();
@@ -120,13 +120,13 @@ describe( 'NewMediaSection', () => {
120120
} );
121121

122122
it( 'should show "no image" description when no media source is selected', () => {
123-
render( <NewMediaSection /> );
123+
render( <MediaSectionV2 /> );
124124

125125
expect( screen.getByText( "Your post won't show an image." ) ).toBeInTheDocument();
126126
} );
127127

128128
it( 'should show Select button when no media', () => {
129-
render( <NewMediaSection /> );
129+
render( <MediaSectionV2 /> );
130130

131131
expect( screen.getByRole( 'button', { name: 'Select' } ) ).toBeInTheDocument();
132132
} );
@@ -158,7 +158,7 @@ describe( 'NewMediaSection', () => {
158158
} );
159159

160160
it( 'should show custom image description when attached media exists', () => {
161-
render( <NewMediaSection /> );
161+
render( <MediaSectionV2 /> );
162162

163163
expect( screen.getByText( 'You are using a custom image.' ) ).toBeInTheDocument();
164164
} );
@@ -180,13 +180,13 @@ describe( 'NewMediaSection', () => {
180180
} );
181181

182182
it( 'should show SIG description when SIG is enabled', () => {
183-
render( <NewMediaSection /> );
183+
render( <MediaSectionV2 /> );
184184

185185
expect( screen.getByText( 'You are using the template' ) ).toBeInTheDocument();
186186
} );
187187

188188
it( 'should show SIG preview image', () => {
189-
render( <NewMediaSection /> );
189+
render( <MediaSectionV2 /> );
190190

191191
const img = screen.getByRole( 'img' );
192192
expect( img ).toHaveAttribute( 'src', 'https://example.com/sig-preview.jpg' );
@@ -198,7 +198,7 @@ describe( 'NewMediaSection', () => {
198198
isLoading: true,
199199
} );
200200

201-
render( <NewMediaSection /> );
201+
render( <MediaSectionV2 /> );
202202

203203
// When SIG is loading, the preview image should not be visible yet
204204
expect( screen.queryByRole( 'img' ) ).not.toBeInTheDocument();
@@ -215,7 +215,7 @@ describe( 'NewMediaSection', () => {
215215
it( 'should call updateJetpackSocialOptions when selecting SIG', async () => {
216216
const user = userEvent.setup();
217217

218-
render( <NewMediaSection /> );
218+
render( <MediaSectionV2 /> );
219219

220220
// Open dropdown
221221
await user.click( screen.getByRole( 'button', { name: 'Replace' } ) );
@@ -239,7 +239,7 @@ describe( 'NewMediaSection', () => {
239239
setIsEnabled: jest.fn(),
240240
} );
241241

242-
render( <NewMediaSection /> );
242+
render( <MediaSectionV2 /> );
243243

244244
// Open dropdown
245245
await user.click( screen.getByRole( 'button', { name: 'Replace' } ) );
@@ -263,7 +263,7 @@ describe( 'NewMediaSection', () => {
263263
it( 'should record analytics event when source is changed', async () => {
264264
const user = userEvent.setup();
265265

266-
render( <NewMediaSection analyticsData={ { test: 'data' } } /> );
266+
render( <MediaSectionV2 analyticsData={ { test: 'data' } } /> );
267267

268268
// Open dropdown
269269
await user.click( screen.getByRole( 'button', { name: 'Replace' } ) );
@@ -282,7 +282,7 @@ describe( 'NewMediaSection', () => {
282282
it( 'should clear media and record event when Remove is clicked', async () => {
283283
const user = userEvent.setup();
284284

285-
render( <NewMediaSection analyticsData={ { test: 'data' } } /> );
285+
render( <MediaSectionV2 analyticsData={ { test: 'data' } } /> );
286286

287287
await user.click( screen.getByRole( 'button', { name: 'Remove' } ) );
288288

@@ -300,7 +300,7 @@ describe( 'NewMediaSection', () => {
300300

301301
describe( 'Disabled state', () => {
302302
it( 'should disable buttons when disabled prop is true', () => {
303-
render( <NewMediaSection disabled={ true } /> );
303+
render( <MediaSectionV2 disabled={ true } /> );
304304

305305
expect( screen.getByRole( 'button', { name: 'Replace' } ) ).toBeDisabled();
306306
expect( screen.getByRole( 'button', { name: 'Remove' } ) ).toBeDisabled();

projects/js-packages/publicize-components/src/components/new-media-section/types.ts renamed to projects/js-packages/publicize-components/src/components/media-section-v2/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ export interface MediaPreviewData {
4545
}
4646

4747
/**
48-
* Props for NewMediaSection component
48+
* Props for MediaSectionV2 component
4949
*/
50-
export interface NewMediaSectionProps {
50+
export interface MediaSectionV2Props {
5151
/**
5252
* Analytics data to be passed to tracking events
5353
*/

0 commit comments

Comments
 (0)