Skip to content

Commit

Permalink
Merge pull request #3162 from ingef/change-dropzone-between-elements-…
Browse files Browse the repository at this point in the history
…design

Change top for last and first DropzoneBetweenElements and change timing for hover
  • Loading branch information
fabian-bizfactory authored Sep 4, 2023
2 parents 15dbe56 + b1b24ee commit ab43b3d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions frontend/src/js/external-forms/form-components/DropzoneList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,16 @@ const Row = styled("div")`
const ConceptContainer = styled("div")`
position: relative;
`;
const SxDropzoneBetweenElements = styled(DropzoneBetweenElements)`

const SxDropzoneBetweenElements = styled(DropzoneBetweenElements)<{
index: number;
}>`
${({ index }) => (index === 0 ? "top: 3px;" : "")}
`;

const SxLastDropzoneBetweenElements = styled(DropzoneBetweenElements)`
height: 15px;
top: -5px;
`;

interface PropsT<DroppableObject> {
Expand Down Expand Up @@ -102,9 +110,10 @@ const DropzoneList = <DroppableObject extends PossibleDroppableObject>(
{items.map((item, i) => (
<ConceptContainer key={i}>
{!disallowMultipleColumns && (
<DropzoneBetweenElements
<SxDropzoneBetweenElements
acceptedDropTypes={acceptedDropTypes}
onDrop={dropBetween(i)}
index={i}
/>
)}
<ListItem>
Expand All @@ -115,7 +124,7 @@ const DropzoneList = <DroppableObject extends PossibleDroppableObject>(
))}
<ConceptContainer>
{!disallowMultipleColumns && (
<SxDropzoneBetweenElements
<SxLastDropzoneBetweenElements
acceptedDropTypes={acceptedDropTypes}
onDrop={dropBetween(items.length)}
/>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/js/small-tab-navigation/HoverNavigatable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const Root = styled("div")<{
`;

// estimated to feel responsive, but not too quick
const TIME_UNTIL_NAVIGATE = 1000;
const TIME_UNTIL_NAVIGATE = 1300;

export const HoverNavigatable = ({
triggerNavigate,
Expand Down

0 comments on commit ab43b3d

Please sign in to comment.