diff --git a/app/assets/images/icons/move-handle.svg b/app/assets/images/icons/move-handle.svg new file mode 100644 index 000000000..1e809fbc4 --- /dev/null +++ b/app/assets/images/icons/move-handle.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/assets/stylesheets/new_design/icons.scss b/app/assets/stylesheets/new_design/icons.scss index 359641530..19c858ac7 100644 --- a/app/assets/stylesheets/new_design/icons.scss +++ b/app/assets/stylesheets/new_design/icons.scss @@ -131,4 +131,8 @@ &.delete { background-image: image-url("icons/trash.svg"); } + + &.move-handle { + background-image: image-url("icons/move-handle.svg"); + } } diff --git a/app/assets/stylesheets/new_design/procedure_champs_editor.scss b/app/assets/stylesheets/new_design/procedure_champs_editor.scss index 917b2d561..0e13037b2 100644 --- a/app/assets/stylesheets/new_design/procedure_champs_editor.scss +++ b/app/assets/stylesheets/new_design/procedure_champs_editor.scss @@ -2,24 +2,64 @@ @import "constants"; .type-de-champ { - background-color: $white; + width: 100%; + background-color: #FAFDFF; border: 1px solid $border-grey; border-radius: 5px; - margin-bottom: 10px; - width: 100%; + margin-bottom: $default-padding * 2; + box-shadow: 0px 2px 4px -4px; + overflow: hidden; - .handle { - cursor: ns-resize; - margin-right: 10px; + .handle.icon { + width: 32px; + height: 32px; + background-size: 32px; + margin-left: 7px; + margin-right: 16px; + align-self: center; + cursor: grab; + opacity: 0.8; + + &:hover { + opacity: 0.4; + } } .move { + height: 44px; + border-radius: 25px; margin-right: 10px; - margin-bottom: 5px; + + &:first-of-type { + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + margin-bottom: -1px; + } + + &:last-of-type { + border-top-left-radius: 0; + border-top-right-radius: 0; + } + } + + .head { + background-color: #D9ECFF; + + select { + margin-bottom: 0px; + } } &.type-header-section { - background-color: $blue; + &, + .head { + background-color: $blue; + } + + .head .icon { + filter: contrast(0%) brightness(200%); + opacity: 0.9; + } label { color: $light-grey; @@ -36,6 +76,7 @@ border-bottom: 1px solid $border-grey; &.head { + border-bottom: 1px solid #D4E5F5; padding-bottom: 10px; } } @@ -44,12 +85,6 @@ margin-left: 55px; } - &.head { - select { - margin-bottom: 0px; - } - } - &.delete { flex-grow: 1; display: flex; @@ -88,21 +123,24 @@ .champs-editor { .footer { - margin-bottom: 40px; + margin-bottom: 50px; } .buttons { display: flex; justify-content: space-between; - margin: 0px; + margin-left: -30px; position: fixed; bottom: 0px; background-color: $white; - max-width: $page-width; + max-width: 1100px; width: 100%; border: 1px solid $border-grey; - padding: 10px; + padding: 30px; border-top-left-radius: 5px; border-top-right-radius: 5px; + border-bottom: none; + padding-bottom: 15px; + padding-top: 15px; } } diff --git a/app/javascript/components/TypesDeChampEditor/components/MoveButton.js b/app/javascript/components/TypesDeChampEditor/components/MoveButton.js index 3d70b034e..5aa94f983 100644 --- a/app/javascript/components/TypesDeChampEditor/components/MoveButton.js +++ b/app/javascript/components/TypesDeChampEditor/components/MoveButton.js @@ -2,20 +2,23 @@ import React from 'react'; import PropTypes from 'prop-types'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -function MoveButton({ isVisible, icon, onClick }) { - if (isVisible) { - return ( - - ); - } - return null; +function MoveButton({ isEnabled, icon, title, onClick }) { + return ( + + ); } MoveButton.propTypes = { - isVisible: PropTypes.bool, + isEnabled: PropTypes.bool, icon: PropTypes.string, + title: PropTypes.string, onClick: PropTypes.func }; diff --git a/app/javascript/components/TypesDeChampEditor/components/TypeDeChamp.js b/app/javascript/components/TypesDeChampEditor/components/TypeDeChamp.js index e9c5f7bd3..9038a1424 100644 --- a/app/javascript/components/TypesDeChampEditor/components/TypeDeChamp.js +++ b/app/javascript/components/TypesDeChampEditor/components/TypeDeChamp.js @@ -76,8 +76,9 @@ const TypeDeChamp = sortableElement( >