Skip to content

Commit

Permalink
Merge pull request #425 from MandeepPaul/fix/#367-spacing/padding-iss…
Browse files Browse the repository at this point in the history
…ue-on-a-text-editor-popup

fix/#367-improved dialog styles on text-editor popup
  • Loading branch information
erenfn authored Dec 25, 2024
2 parents d41ff4d + 25e2693 commit f389418
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export const dialogStyles = {
paper: {
padding: 2,
borderRadius: "4px",
},
title: {
padding: 0,
},
content: {
padding: 0,
paddingBottom: 2,
overflow: "hidden",
},
actions: {
paddingBottom: 0,
paddingRight: 0,
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
} from "@mui/material";
import Button from "../../Button/Button";
import CustomTextField from "../../TextFieldComponents/CustomTextField/CustomTextField";
import { dialogStyles } from "./DialogStyles";

const LinkDialog = ({
open,
Expand All @@ -18,17 +19,25 @@ const LinkDialog = ({
handleOpenLink = () => {},
}) => {
return (
<Dialog open={open} onClose={handleClose}>
<DialogTitle>{isLinkActive ? "Edit Link" : "Add Link"}</DialogTitle>
<DialogContent>
<Dialog
PaperProps={{
sx: dialogStyles.paper,
}}
open={open}
onClose={handleClose}
>
<DialogTitle sx={dialogStyles.title}>
{isLinkActive ? "Edit link" : "Add link"}
</DialogTitle>
<DialogContent sx={dialogStyles.content}>
<CustomTextField
type="url"
placeholder="https://"
value={url}
onChange={(e) => setUrl(e.target.value)}
/>
</DialogContent>
<DialogActions>
<DialogActions sx={dialogStyles.actions}>
{isLinkActive && (
<Button
text="Open Link"
Expand All @@ -37,16 +46,17 @@ const LinkDialog = ({
onClick={handleOpenLink}
/>
)}
<Button
text={url ? "Insert/Update" : "Remove Link"}
onClick={handleInsertLink}
/>

<Button
text="Cancel"
buttonType="secondary"
variant="text"
onClick={handleClose}
/>
<Button
text={url ? "Insert/Update" : "Remove link"}
onClick={handleInsertLink}
/>
</DialogActions>
</Dialog>
);
Expand Down

0 comments on commit f389418

Please sign in to comment.