Skip to content

Commit

Permalink
Code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hamano committed Oct 15, 2023
1 parent 6a56f3d commit 732bbac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ export const MEDIA_TYPES = [
];

export const MAX_SOURCES = 5;
export const MIN_MEDIA_VALUE = 100;
export const MAX_MEDIA_VALUE = 2000;
6 changes: 3 additions & 3 deletions src/source-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import type { Media, Source } from './types';
/**
* Internal dependencies
*/
import { DEFAULT_MEDIA_VALUE, MEDIA_TYPES } from './constants';
import { DEFAULT_MEDIA_VALUE, MEDIA_TYPES, MIN_MEDIA_VALUE, MAX_MEDIA_VALUE } from './constants';

type Props = {
source?: Source;
Expand Down Expand Up @@ -213,8 +213,8 @@ export default function SourceEditor( {
label={ __( 'Media query value', 'enable-responsive-image' ) }
value={ mediaValue || DEFAULT_MEDIA_VALUE }
onChange={ onChangeMediaValue }
min={ 100 }
max={ 2000 }
min={ MIN_MEDIA_VALUE }
max={ MAX_MEDIA_VALUE }
allowReset
initialPosition={ DEFAULT_MEDIA_VALUE }
/>
Expand Down

0 comments on commit 732bbac

Please sign in to comment.