Skip to content

Commit

Permalink
[RNMobile] Set native extension to media upload constant file (#54928)
Browse files Browse the repository at this point in the history
* Set native extension to media upload constants file

* Remove unused constant of media upload options

* Use media option constants in `MediaUpload` component
  • Loading branch information
fluiddot authored Sep 29, 2023
1 parent a612795 commit a0e89fa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
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

0 comments on commit a0e89fa

Please sign in to comment.