Skip to content

A full-featured CRM built with React, shadcn/ui, and Supabase.

Adjust deal dialog position

François Zaninottoa5b2f9531ac6
diff --git a/src/deals/DealEdit.tsx b/src/deals/DealEdit.tsx
index 10d7aa2d..79b2f9bd 100644
--- a/src/deals/DealEdit.tsx
+++ b/src/deals/DealEdit.tsx
@@ -30,7 +30,17 @@ export const DealEdit = ({ open, id }: { open: boolean; id?: string }) => {
};
return (
- <Dialog open={open} onClose={handleClose} fullWidth maxWidth="md">
+ <Dialog
+ open={open}
+ onClose={handleClose}
+ fullWidth
+ maxWidth="md"
+ sx={{
+ '& .MuiDialog-container': {
+ alignItems: 'flex-start',
+ },
+ }}
+ >
{!!id ? (
<EditBase
id={id}
@@ -94,7 +104,11 @@ function EditHeader() {
</Stack>
<Stack direction="row" spacing={1} sx={{ pr: 3 }}>
- <Button component={Link} to={`/deals/${deal.id}/show`}>
+ <Button
+ component={Link}
+ to={`/deals/${deal.id}/show`}
+ size="small"
+ >
Back to deal
</Button>
</Stack>
diff --git a/src/deals/DealShow.tsx b/src/deals/DealShow.tsx
index 2d10fadd..54f97835 100644
--- a/src/deals/DealShow.tsx
+++ b/src/deals/DealShow.tsx
@@ -42,7 +42,17 @@ export const DealShow = ({ open, id }: { open: boolean; id?: string }) => {
};
return (
- <Dialog open={open} onClose={handleClose} fullWidth maxWidth="md">
+ <Dialog
+ open={open}
+ onClose={handleClose}
+ fullWidth
+ maxWidth="md"
+ sx={{
+ '& .MuiDialog-container': {
+ alignItems: 'flex-start',
+ },
+ }}
+ >
<DialogContent sx={{ padding: 0 }}>
{!!id ? (
<ShowBase id={id}>
@@ -65,14 +75,18 @@ const DealShowContent = ({ handleClose }: { handleClose: () => void }) => {
<DialogCloseButton
onClose={handleClose}
top={record.archived_at ? CLOSE_TOP_WITH_ARCHIVED : 16}
- right={20}
+ right={10}
color={record.archived_at ? 'white' : undefined}
/>
<Stack gap={1}>
{record.archived_at ? <ArchivedTitle /> : null}
<Box display="flex" p={2}>
- <Box ml={2} flex="1">
- <Stack direction="row" justifyContent="space-between">
+ <Box flex="1">
+ <Stack
+ direction="row"
+ justifyContent="space-between"
+ mb={4}
+ >
<Stack direction="row" alignItems="center" gap={2}>
<ReferenceField
source="company_id"
@@ -88,7 +102,7 @@ const DealShowContent = ({ handleClose }: { handleClose: () => void }) => {
<Stack
gap={1}
direction="row"
- pr={record.archived_at ? 0 : 4}
+ pr={record.archived_at ? 0 : 6}
>
{record.archived_at ? (
<>
@@ -104,7 +118,7 @@ const DealShowContent = ({ handleClose }: { handleClose: () => void }) => {
</Stack>
</Stack>
- <Box display="flex" mb={2} mt={2}>
+ <Box display="flex" m={2}>
<Box display="flex" mr={5} flexDirection="column">
<Typography
color="textSecondary"
@@ -192,7 +206,7 @@ const DealShowContent = ({ handleClose }: { handleClose: () => void }) => {
</Box>
{!!record.contact_ids?.length && (
- <Box mb={2}>
+ <Box m={2}>
<Box
display="flex"
mr={5}
@@ -216,7 +230,7 @@ const DealShowContent = ({ handleClose }: { handleClose: () => void }) => {
)}
{record.description && (
- <Box mt={2} mb={2} sx={{ whiteSpace: 'pre-line' }}>
+ <Box m={2} sx={{ whiteSpace: 'pre-line' }}>
<Typography
color="textSecondary"
variant="caption"
@@ -229,9 +243,8 @@ const DealShowContent = ({ handleClose }: { handleClose: () => void }) => {
</Box>
)}
- <Divider />
-
- <Box mt={2}>
+ <Box m={2}>
+ <Divider />
<ReferenceManyField
target="deal_id"
reference="dealNotes"
diff --git a/src/notes/NotesIterator.tsx b/src/notes/NotesIterator.tsx
index 2029d00a..036855b9 100644
--- a/src/notes/NotesIterator.tsx
+++ b/src/notes/NotesIterator.tsx
@@ -15,7 +15,7 @@ export const NotesIterator = ({
const { data, error, isPending } = useListContext();
if (isPending || error) return null;
return (
- <Box mt={4}>
+ <Box mt={2}>
<NoteCreate showStatus={showStatus} reference={reference} />
{data && (
<Stack mt={2} gap={1}>