1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

editor buttons fix on mobile

This commit is contained in:
Fedor Katurov 2020-04-29 18:52:27 +07:00
parent 3d398f23ed
commit b794a44c4f
3 changed files with 97 additions and 46 deletions

View file

@ -20,11 +20,11 @@
@include tablet { @include tablet {
margin-left: 0; margin-left: 0;
margin-right: 0; margin-right: 0;
border-radius: 0;
} }
} }
.image_container { .image_container {
border-radius: $panel_radius 0 0 $panel_radius;
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
justify-content: flex-start; justify-content: flex-start;
@ -45,6 +45,10 @@
border-radius: $radius; border-radius: $radius;
box-shadow: transparentize($color: white, $amount: 0.95) 0 -1px, box-shadow: transparentize($color: white, $amount: 0.95) 0 -1px,
transparentize($color: #000000, $amount: 0.6) 0 2px 5px; transparentize($color: #000000, $amount: 0.6) 0 2px 5px;
@include tablet {
border-radius: 0;
}
} }
&.is_dragging { &.is_dragging {

View file

@ -60,23 +60,29 @@ const NodePanelInner: FC<IProps> = memo(
</div> </div>
{can_edit && ( {can_edit && (
<div className={styles.editor_buttons}> <div className={styles.editor_menu}>
{can_star && ( <div className={styles.editor_menu_button}>
<div className={classNames(styles.star, { is_heroic })}> <Icon icon="dots-vertical" size={24} onClick={onStar} />
{is_heroic ? (
<Icon icon="star_full" size={24} onClick={onStar} />
) : (
<Icon icon="star" size={24} onClick={onStar} />
)}
</div>
)}
<div>
<Icon icon={deleted_at ? 'locked' : 'unlocked'} size={24} onClick={onLock} />
</div> </div>
<div> <div className={styles.editor_buttons}>
<Icon icon="edit" size={24} onClick={onEdit} /> {can_star && (
<div className={classNames(styles.star, { is_heroic })}>
{is_heroic ? (
<Icon icon="star_full" size={24} onClick={onStar} />
) : (
<Icon icon="star" size={24} onClick={onStar} />
)}
</div>
)}
<div>
<Icon icon={deleted_at ? 'locked' : 'unlocked'} size={24} onClick={onLock} />
</div>
<div>
<Icon icon="edit" size={24} onClick={onEdit} />
</div>
</div> </div>
</div> </div>
)} )}

View file

@ -1,3 +1,32 @@
@mixin button {
margin: 0 $gap;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
svg {
fill: darken(white, 50%);
transition: fill 0.25s;
}
&:hover {
svg {
fill: $red;
}
}
&::after {
content: ' ';
flex: 0 0 6px;
height: $gap;
width: 6px;
border-radius: 4px;
background: transparentize(black, 0.7);
margin-left: $gap * 2;
}
}
.wrap { .wrap {
display: flex; display: flex;
align-items: center; align-items: center;
@ -96,36 +125,7 @@
justify-content: center; justify-content: center;
& > * { & > * {
margin: 0 $gap; @include button;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
svg {
fill: darken(white, 50%);
transition: fill 0.25s;
}
&:hover {
svg {
fill: $red;
}
}
&::after {
content: ' ';
flex: 0 0 6px;
height: $gap;
width: 6px;
border-radius: 4px;
background: transparentize(black, 0.7);
margin-left: $gap * 2;
}
&:first-child {
margin-left: 0;
}
} }
@include tablet { @include tablet {
@ -148,6 +148,20 @@
.editor_buttons { .editor_buttons {
@include tablet { @include tablet {
display: none; display: none;
& > * {
&:last-child {
margin-right: 0;
&::after {
display: none;
}
}
&:first-child {
margin-left: 0;
}
}
} }
} }
@ -227,3 +241,30 @@
fill: $orange; fill: $orange;
} }
} }
.editor_menu_button {
display: none !important;
@include button();
@include tablet {
display: flex !important;
}
}
.editor_menu {
// position: relative;
&:hover {
.editor_buttons {
display: flex;
position: absolute;
right: 0;
top: 100%;
background: darken($content_bg, 4%);
padding: $gap $gap * 2;
border-radius: $radius;
box-shadow: transparentize(black, 0.8) 5px 5px 5px;
}
}
}