mirror of
https://github.com/zoriya/flood.git
synced 2026-06-05 19:54:18 +00:00
Move textbox-repeater button to floating-action object
This commit is contained in:
@@ -1,48 +1,16 @@
|
||||
.textbox-repeater {
|
||||
|
||||
&__button-group {
|
||||
margin-top: -8px;
|
||||
position: absolute;
|
||||
right: -8px;
|
||||
top: 50%;
|
||||
}
|
||||
.floating-action {
|
||||
|
||||
&__button {
|
||||
background: $textbox-repeater--button--background;
|
||||
border: none;
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 0 0 1px $textbox-repeater--button--border;
|
||||
cursor: pointer;
|
||||
height: 16px;
|
||||
outline: none;
|
||||
margin-right: 8px;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
transition: background 0.25s, box-shadow 0.25s;
|
||||
width: 16px;
|
||||
|
||||
&:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: $textbox-repeater--button--background--hover;
|
||||
box-shadow: 0 0 0 1px $textbox-repeater--button--border--hover;
|
||||
|
||||
.icon {
|
||||
fill: $textbox-repeater--button--foreground--hover;
|
||||
}
|
||||
}
|
||||
|
||||
.icon {
|
||||
height: 8px;
|
||||
fill: $textbox-repeater--button--foreground;
|
||||
left: 50%;
|
||||
&__group {
|
||||
margin-top: -8px;
|
||||
position: absolute;
|
||||
right: -8px;
|
||||
top: 50%;
|
||||
transition: fill 0.25s;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 8px;
|
||||
}
|
||||
|
||||
&__button {
|
||||
position: relative;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ export default class TextboxRepeater extends React.Component {
|
||||
getTextboxes() {
|
||||
let textboxes = this.props.textboxes.map((textbox, index) => {
|
||||
let addButton = (
|
||||
<button className="textbox-repeater__button textbox-repeater__add"
|
||||
<button className="textbox-repeater__add floating-action__button"
|
||||
onClick={this.props.handleTextboxAdd.bind(textbox, index)}>
|
||||
<Icon icon="addMini" size="mini" />
|
||||
</button>
|
||||
@@ -30,7 +30,7 @@ export default class TextboxRepeater extends React.Component {
|
||||
|
||||
if (index > 0) {
|
||||
removeButton = (
|
||||
<button className="textbox-repeater__button textbox-repeater__remove"
|
||||
<button className="textbox-repeater__remove floating-action__button"
|
||||
onClick={this.props.handleTextboxRemove.bind(textbox, index)}>
|
||||
<Icon icon="removeMini" size="mini" />
|
||||
</button>
|
||||
@@ -44,7 +44,7 @@ export default class TextboxRepeater extends React.Component {
|
||||
placeholder={this.props.placeholder}
|
||||
value={textbox.value}
|
||||
type="text" />
|
||||
<div className="textbox-repeater__button-group">
|
||||
<div className="floating-action__group">
|
||||
{removeButton}
|
||||
{addButton}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user