Skip to content

Commit

Permalink
Remove the drag when we have one question
Browse files Browse the repository at this point in the history
  • Loading branch information
hadijahkyampeire committed Jul 21, 2023
1 parent a56dece commit f3ad849
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ export const DraggableQuestion: React.FC<DraggableQuestionProps> = ({
cursor: isDragging ? "grabbing" : "grab",
};

const dragStyles = isDragging ? styles.isDragged : styles.normal;
const dragStyles =
isDragging || questionLength > 1 ? styles.isDraggable : styles.normal;
return (
<div className={dragStyles}>
<div className={styles.questionContainer}>
Expand Down
13 changes: 6 additions & 7 deletions src/components/interactive-builder/draggable-question.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
align-items: center;
}

.isDragged, .normal {
.isDraggable, .normal {
display: flex;
height: 3rem;
justify-content: space-between;
Expand All @@ -21,20 +21,19 @@
width: 100%;
}

.normal:hover {

.isDraggable:hover {
background-color: $ui-03;
}
.isDragged {
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
background-color: $ui-03;
}

.draggableIconWrapper {
margin-top: 0.25rem;
margin-right: spacing.$spacing-03;
border: none;
background-color: transparent;

:hover {
background-color: $ui-03;
}
}
.draggableIcon {
color: $ui-04;
Expand Down

0 comments on commit f3ad849

Please sign in to comment.