Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RNMobile] Set native extension to media upload constant file #54928

Merged
merged 3 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Expand Up @@ -10,6 +10,5 @@ export const MEDIA_TYPE_ANY = 'any';

export const OPTION_TAKE_VIDEO = __( 'Take a Video' );
export const OPTION_TAKE_PHOTO = __( 'Take a Photo' );
export const OPTION_TAKE_PHOTO_OR_VIDEO = __( 'Take a Photo or Video' );
export const OPTION_INSERT_FROM_URL = __( 'Insert from URL' );
export const OPTION_WORDPRESS_MEDIA_LIBRARY = __( 'WordPress Media Library' );
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ import {
MEDIA_TYPE_VIDEO,
MEDIA_TYPE_AUDIO,
MEDIA_TYPE_ANY,
OPTION_TAKE_VIDEO,
OPTION_TAKE_PHOTO,
OPTION_INSERT_FROM_URL,
OPTION_WORDPRESS_MEDIA_LIBRARY,
} from './constants';
import styles from './style.scss';

Expand Down Expand Up @@ -93,7 +97,7 @@ export class MediaUpload extends Component {
const cameraImageSource = {
id: mediaSources.deviceCamera, // ID is the value sent to native.
value: mediaSources.deviceCamera + '-IMAGE', // This is needed to diferenciate image-camera from video-camera sources.
label: __( 'Take a Photo' ),
label: OPTION_TAKE_PHOTO,
requiresModal: true,
types: [ MEDIA_TYPE_IMAGE ],
icon: capturePhoto,
Expand All @@ -102,7 +106,7 @@ export class MediaUpload extends Component {
const cameraVideoSource = {
id: mediaSources.deviceCamera,
value: mediaSources.deviceCamera,
label: __( 'Take a Video' ),
label: OPTION_TAKE_VIDEO,
requiresModal: true,
types: [ MEDIA_TYPE_VIDEO ],
icon: captureVideo,
Expand All @@ -120,7 +124,7 @@ export class MediaUpload extends Component {
const siteLibrarySource = {
id: mediaSources.siteMediaLibrary,
value: mediaSources.siteMediaLibrary,
label: __( 'WordPress Media Library' ),
label: OPTION_WORDPRESS_MEDIA_LIBRARY,
requiresModal: true,
types: [
MEDIA_TYPE_IMAGE,
Expand All @@ -135,7 +139,7 @@ export class MediaUpload extends Component {
const urlSource = {
id: URL_MEDIA_SOURCE,
value: URL_MEDIA_SOURCE,
label: __( 'Insert from URL' ),
label: OPTION_INSERT_FROM_URL,
types: [ MEDIA_TYPE_AUDIO, MEDIA_TYPE_IMAGE, MEDIA_TYPE_VIDEO ],
icon: globe,
};
Expand Down Expand Up @@ -329,7 +333,7 @@ function URLInput( props ) {
autoCorrect={ false }
autoComplete={ Platform.isIOS ? 'url' : 'off' }
keyboardType="url"
label={ __( 'Insert from URL' ) }
label={ OPTION_INSERT_FROM_URL }
onChange={ props.onChange }
placeholder={ __( 'Type a URL' ) }
value={ props.value }
Expand Down
Loading