Hover state for form placement component
[MAILPOET-2738]
This commit is contained in:
@@ -123,10 +123,21 @@ $form-placement-option-oval-border: #969ca1;
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin: 0 16px 16px 0;
|
margin: 0 16px 16px 0;
|
||||||
padding: 6px;
|
padding: 6px;
|
||||||
|
position: relative;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width: 116px;
|
width: 116px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.form-placement-settings-overlay {
|
||||||
|
background-color: rgba(0, 0, 0, .3);
|
||||||
|
height: 142px;
|
||||||
|
left: 0;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
width: 116px;
|
||||||
|
z-index: 3;
|
||||||
|
}
|
||||||
|
|
||||||
.form-placement-option-label {
|
.form-placement-option-label {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
color: $form-placement-option-text-color;
|
color: $form-placement-option-text-color;
|
||||||
@@ -135,6 +146,7 @@ $form-placement-option-oval-border: #969ca1;
|
|||||||
height: 40px;
|
height: 40px;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
z-index: 2;
|
||||||
|
|
||||||
p {
|
p {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
@@ -147,6 +159,7 @@ $form-placement-option-oval-border: #969ca1;
|
|||||||
height: 25px;
|
height: 25px;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
z-index: 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-placement-settings-oval {
|
.form-placement-settings-oval {
|
||||||
@@ -163,6 +176,13 @@ $form-placement-option-oval-border: #969ca1;
|
|||||||
}
|
}
|
||||||
height: 14px;
|
height: 14px;
|
||||||
width: 14px;
|
width: 14px;
|
||||||
|
z-index: 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-placement-settings-icon-hover {
|
||||||
|
svg {
|
||||||
|
fill: white;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-placement-option-icon {
|
.form-placement-option-icon {
|
||||||
@@ -176,4 +196,5 @@ $form-placement-option-oval-border: #969ca1;
|
|||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
width: 76px;
|
width: 76px;
|
||||||
|
z-index: 2;
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
import React from 'react';
|
import React, { useState } from 'react';
|
||||||
|
import classnames from 'classnames';
|
||||||
|
|
||||||
import SettingsIcon from './settings_icon';
|
import SettingsIcon from './settings_icon';
|
||||||
|
|
||||||
@@ -7,24 +8,44 @@ type Props = {
|
|||||||
icon: JSX.Element,
|
icon: JSX.Element,
|
||||||
}
|
}
|
||||||
|
|
||||||
const FormPlacementOption = ({ label, icon }: Props) => (
|
const FormPlacementOption = ({ label, icon }: Props) => {
|
||||||
<div className="form-placement-option">
|
const [hover, setHover] = useState(false);
|
||||||
<div>
|
return (
|
||||||
<div className="form-placement-option-settings">
|
<div
|
||||||
<div className="form-placement-settings-icon">
|
className="form-placement-option"
|
||||||
{SettingsIcon}
|
onMouseEnter={() => setHover(true)}
|
||||||
|
onMouseLeave={() => setHover(false)}
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<div className="form-placement-option-settings">
|
||||||
|
<div
|
||||||
|
className={
|
||||||
|
classnames(
|
||||||
|
'form-placement-settings-icon',
|
||||||
|
{ 'form-placement-settings-icon-hover': hover }
|
||||||
|
)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{SettingsIcon}
|
||||||
|
</div>
|
||||||
|
{
|
||||||
|
hover
|
||||||
|
&& <div className="form-placement-settings-oval" />
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<div className="form-placement-option-icon">
|
||||||
|
{icon}
|
||||||
</div>
|
</div>
|
||||||
{/* todo next line only show on hover */}
|
|
||||||
<div className="form-placement-settings-oval" />
|
|
||||||
</div>
|
</div>
|
||||||
<div className="form-placement-option-icon">
|
<div className="form-placement-option-label">
|
||||||
{icon}
|
<p>{label}</p>
|
||||||
</div>
|
</div>
|
||||||
|
{
|
||||||
|
hover
|
||||||
|
&& <div className="form-placement-settings-overlay" />
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
<div className="form-placement-option-label">
|
);
|
||||||
<p>{label}</p>
|
};
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
|
|
||||||
export default FormPlacementOption;
|
export default FormPlacementOption;
|
||||||
|
Reference in New Issue
Block a user