Skip to content

Commit 732bbac

Browse files
committed
Code refactoring
1 parent 6a56f3d commit 732bbac

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ export const MEDIA_TYPES = [
2121
];
2222

2323
export const MAX_SOURCES = 5;
24+
export const MIN_MEDIA_VALUE = 100;
25+
export const MAX_MEDIA_VALUE = 2000;

src/source-editor.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import type { Media, Source } from './types';
2323
/**
2424
* Internal dependencies
2525
*/
26-
import { DEFAULT_MEDIA_VALUE, MEDIA_TYPES } from './constants';
26+
import { DEFAULT_MEDIA_VALUE, MEDIA_TYPES, MIN_MEDIA_VALUE, MAX_MEDIA_VALUE } from './constants';
2727

2828
type Props = {
2929
source?: Source;
@@ -213,8 +213,8 @@ export default function SourceEditor( {
213213
label={ __( 'Media query value', 'enable-responsive-image' ) }
214214
value={ mediaValue || DEFAULT_MEDIA_VALUE }
215215
onChange={ onChangeMediaValue }
216-
min={ 100 }
217-
max={ 2000 }
216+
min={ MIN_MEDIA_VALUE }
217+
max={ MAX_MEDIA_VALUE }
218218
allowReset
219219
initialPosition={ DEFAULT_MEDIA_VALUE }
220220
/>

0 commit comments

Comments
 (0)