mirror of
https://github.com/maputnik/editor.git
synced 2026-07-14 01:47:27 +00:00
9c1499b805
## Launch Checklist See title, Also removed some "_" from some file names. This is a pure refactoring, no logic changes. - [x] Briefly describe the changes in this PR. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
35 lines
1007 B
TypeScript
35 lines
1007 B
TypeScript
import React from "react";
|
|
|
|
import latest from "@maplibre/maplibre-gl-style-spec/dist/latest.json";
|
|
import { Block } from "./Block";
|
|
import { InputNumber } from "./InputNumber";
|
|
import { type WithTranslation, withTranslation } from "react-i18next";
|
|
|
|
type FieldMinZoomInternalProps = {
|
|
value?: number
|
|
onChange(...args: unknown[]): unknown
|
|
error?: {message: string}
|
|
} & WithTranslation;
|
|
|
|
const FieldMinZoomInternal: React.FC<FieldMinZoomInternalProps> = (props) => {
|
|
const t = props.t;
|
|
return (
|
|
<Block label={t("Min Zoom")} fieldSpec={latest.layer.minzoom}
|
|
error={props.error}
|
|
data-wd-key="min-zoom"
|
|
>
|
|
<InputNumber
|
|
allowRange={true}
|
|
value={props.value}
|
|
onChange={props.onChange}
|
|
min={latest.layer.minzoom.minimum}
|
|
max={latest.layer.minzoom.maximum}
|
|
default={latest.layer.minzoom.minimum}
|
|
data-wd-key='min-zoom.input'
|
|
/>
|
|
</Block>
|
|
);
|
|
};
|
|
|
|
export const FieldMinZoom = withTranslation()(FieldMinZoomInternal);
|