Skip to content

Commit 2f26d12

Browse files
committed
Make language modal wider
1 parent 7ad1059 commit 2f26d12

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

src/components/EditorHeader/Modal/Language.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default function Language() {
77
const { i18n } = useTranslation();
88

99
return (
10-
<div className="grid grid-cols-3 gap-4">
10+
<div className="grid grid-cols-4 md:grid-cols-2 gap-4">
1111
{languages.map((l) => (
1212
<button
1313
key={l.code}

src/components/EditorHeader/Modal/Modal.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ import {
2121
} from "../../../hooks";
2222
import { saveAs } from "file-saver";
2323
import { Parser } from "node-sql-parser";
24-
import { getModalTitle, getOkText } from "../../../utils/modalTitles";
24+
import {
25+
getModalTitle,
26+
getModalWidth,
27+
getOkText,
28+
} from "../../../utils/modalData";
2529
import Rename from "./Rename";
2630
import Open from "./Open";
2731
import New from "./New";
@@ -363,7 +367,7 @@ export default function Modal({
363367
(modal === MODAL.IMPORT_SRC && importSource.src === ""),
364368
}}
365369
cancelText={t("cancel")}
366-
width={modal === MODAL.NEW || modal === MODAL.OPEN ? 740 : 600}
370+
width={getModalWidth(modal)}
367371
bodyStyle={{
368372
maxHeight: window.innerHeight - 280,
369373
overflow: "auto",

src/utils/modalTitles.js renamed to src/utils/modalData.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@ export const getModalTitle = (modal) => {
2828
}
2929
};
3030

31+
export const getModalWidth = (modal) => {
32+
switch (modal) {
33+
case MODAL.LANGUAGE:
34+
case MODAL.OPEN:
35+
case MODAL.NEW:
36+
return 740;
37+
default:
38+
return 600;
39+
}
40+
};
41+
3142
export const getOkText = (modal) => {
3243
switch (modal) {
3344
case MODAL.IMPORT:

0 commit comments

Comments
 (0)