Make language modal wider

This commit is contained in:
1ilit 2024-08-07 23:00:19 +03:00
parent 7ad1059990
commit 2f26d12f6a
3 changed files with 18 additions and 3 deletions

View File

@ -7,7 +7,7 @@ export default function Language() {
const { i18n } = useTranslation(); const { i18n } = useTranslation();
return ( return (
<div className="grid grid-cols-3 gap-4"> <div className="grid grid-cols-4 md:grid-cols-2 gap-4">
{languages.map((l) => ( {languages.map((l) => (
<button <button
key={l.code} key={l.code}

View File

@ -21,7 +21,11 @@ import {
} from "../../../hooks"; } from "../../../hooks";
import { saveAs } from "file-saver"; import { saveAs } from "file-saver";
import { Parser } from "node-sql-parser"; import { Parser } from "node-sql-parser";
import { getModalTitle, getOkText } from "../../../utils/modalTitles"; import {
getModalTitle,
getModalWidth,
getOkText,
} from "../../../utils/modalData";
import Rename from "./Rename"; import Rename from "./Rename";
import Open from "./Open"; import Open from "./Open";
import New from "./New"; import New from "./New";
@ -363,7 +367,7 @@ export default function Modal({
(modal === MODAL.IMPORT_SRC && importSource.src === ""), (modal === MODAL.IMPORT_SRC && importSource.src === ""),
}} }}
cancelText={t("cancel")} cancelText={t("cancel")}
width={modal === MODAL.NEW || modal === MODAL.OPEN ? 740 : 600} width={getModalWidth(modal)}
bodyStyle={{ bodyStyle={{
maxHeight: window.innerHeight - 280, maxHeight: window.innerHeight - 280,
overflow: "auto", overflow: "auto",

View File

@ -28,6 +28,17 @@ export const getModalTitle = (modal) => {
} }
}; };
export const getModalWidth = (modal) => {
switch (modal) {
case MODAL.LANGUAGE:
case MODAL.OPEN:
case MODAL.NEW:
return 740;
default:
return 600;
}
};
export const getOkText = (modal) => { export const getOkText = (modal) => {
switch (modal) { switch (modal) {
case MODAL.IMPORT: case MODAL.IMPORT: