Skip to content

Commit

Permalink
Improve drop area design (#854)
Browse files Browse the repository at this point in the history
* Improve drop area design

* Shorter prop name
  • Loading branch information
apedroferreira authored Aug 26, 2022
1 parent 9927cf1 commit 50ce528
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import * as React from 'react';
import clsx from 'clsx';
import { styled } from '@mui/material';
import Typography from '@mui/material/Typography';
import AddCircleOutlineIcon from '@mui/icons-material/AddCircleOutline';

import { FlowDirection } from '../../../../types';
import * as appDom from '../../../../appDom';
Expand Down Expand Up @@ -102,10 +104,12 @@ const EmptySlot = styled('div')({
border: '1px dashed green',
color: 'green',
display: 'flex',
fontSize: 20,
flexDirection: 'column',
justifyContent: 'center',
position: 'absolute',
opacity: 0.75,
textAlign: 'center',
fontSize: 30,
});

function getChildNodeHighlightedZone(parentFlowDirection: FlowDirection): DropZone | null {
Expand Down Expand Up @@ -356,7 +360,10 @@ export default function NodeDropArea({
}}
/>
{isEmptySlot && slotRect ? (
<EmptySlot style={absolutePositionCss(slotRect)}>+</EmptySlot>
<EmptySlot style={absolutePositionCss(slotRect)}>
<AddCircleOutlineIcon fontSize="inherit" sx={{ mb: 0.2 }} />
<Typography variant="caption">Drop component here</Typography>
</EmptySlot>
) : null}
</React.Fragment>
);
Expand Down
3 changes: 1 addition & 2 deletions packages/toolpad-core/src/runtime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ function PlaceholderWrapper(props: PlaceholderWrapperProps) {
return (
<div
style={{
display: 'block',
minHeight: 40,
minHeight: 72,
minWidth: 200,
}}
/>
Expand Down

0 comments on commit 50ce528

Please sign in to comment.