Skip to content

Commit

Permalink
fix: improve window size management
Browse files Browse the repository at this point in the history
  • Loading branch information
stepan662 committed Jun 7, 2024
1 parent 862e83c commit e8c3c92
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ui/views/PageSetup/PageSetup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ import {
} from "@create-figma-plugin/ui";
import { Fragment, FunctionComponent, h } from "preact";
import { useState } from "preact/hooks";
import { useWindowSize } from "@/ui/hooks/useWindowSize";
import { COMPACT_SIZE } from "@/ui/state/sizes";

export const PageSetup: FunctionComponent = () => {
const config = useGlobalState((c) => c.config) || {};
const { setRoute, setConfig } = useGlobalActions();

useWindowSize(COMPACT_SIZE);

const [settings, setSettings] = useState<
Partial<CurrentPageSettings> | undefined
>({ language: "" });
Expand Down
3 changes: 3 additions & 0 deletions src/ui/views/Settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { TopBar } from "../../components/TopBar/TopBar";
import styles from "./Settings.css";
import { ProjectSettings } from "./ProjectSettings";
import { useQueryClient } from "react-query";
import { useWindowSize } from "@/ui/hooks/useWindowSize";

const DEFAULT_TOLGEE_URL = "https://app.tolgee.io";

Expand All @@ -46,6 +47,8 @@ export const Settings: FunctionComponent<Props> = ({ noNavigation }) => {
},
});

useWindowSize({ width: 500, height: 500 });

const [validated, setValidated] = useState(false);

const { setRoute, setConfig, resetConfig } = useGlobalActions();
Expand Down

0 comments on commit e8c3c92

Please sign in to comment.