style fixes

This commit is contained in:
Robin Appelman 2023-04-22 21:27:24 +02:00
commit 2dee28d022
4 changed files with 5 additions and 20 deletions

View file

@ -17,20 +17,6 @@ export interface AnalyseProps {
parser: AsyncParser;
}
export interface AnalyseState {
worldSize: {
width: number;
height: number;
}
backgroundBoundaries: WorldBoundaries;
tick: number;
playing: boolean;
scale: number;
error?: string;
isShared: boolean;
}
export const Analyser = (props: AnalyseProps) => {
const parser = props.parser;
const intervalPerTick = props.header.interval_per_tick;

View file

@ -1,5 +1,5 @@
import {Panner} from "../Panner/Panner";
import {createEffect, createSignal} from "solid-js";
import {createEffect, createSignal, ParentProps} from "solid-js";
export class MapContainerProps {
contentSize: {
@ -7,10 +7,9 @@ export class MapContainerProps {
height: number;
};
onScale?: (scale: number) => any;
children: Element;
}
export const MapContainer = ({children, contentSize, onScale}: MapContainerProps) => {
export const MapContainer = ({children, contentSize, onScale}: ParentProps<MapContainerProps>) => {
const [container, setContainer] = createSignal<Element>();
const scale = () => Math.min(
container().clientWidth / contentSize.width,

View file

@ -1,5 +1,5 @@
import {CenteredPanZoom} from './CenteredPanZoom';
import {createSignal} from "solid-js";
import {createSignal, ParentProps} from "solid-js";
export interface PannerProps {
width: number;
@ -10,10 +10,9 @@ export interface PannerProps {
height: number;
};
onScale?: (scale: number) => any;
children: Element;
}
export const Panner = (props: PannerProps) => {
export const Panner = (props: ParentProps<PannerProps>) => {
const [scale, setScale] = createSignal(0);
const [translateX, setTranslateX] = createSignal(0);
const [translateY, setTranslateY] = createSignal(0);