mirror of
https://github.com/maputnik/editor.git
synced 2026-07-15 02:17: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
1014 B
TypeScript
35 lines
1014 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 FieldMaxZoomInternalProps = {
|
|
value?: number
|
|
onChange(value: number | undefined): unknown
|
|
error?: {message: string}
|
|
} & WithTranslation;
|
|
|
|
const FieldMaxZoomInternal: React.FC<FieldMaxZoomInternalProps> = (props) => {
|
|
const t = props.t;
|
|
return (
|
|
<Block label={t("Max Zoom")} fieldSpec={latest.layer.maxzoom}
|
|
error={props.error}
|
|
data-wd-key="max-zoom"
|
|
>
|
|
<InputNumber
|
|
allowRange={true}
|
|
value={props.value}
|
|
onChange={props.onChange}
|
|
min={latest.layer.maxzoom.minimum}
|
|
max={latest.layer.maxzoom.maximum}
|
|
default={latest.layer.maxzoom.maximum}
|
|
data-wd-key="max-zoom.input"
|
|
/>
|
|
</Block>
|
|
);
|
|
};
|
|
|
|
export const FieldMaxZoom = withTranslation()(FieldMaxZoomInternal);
|