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

submit bar

This commit is contained in:
Fedor Katurov 2019-10-16 10:10:27 +07:00
parent 6bb24fc869
commit 3fdf14d680
10 changed files with 131 additions and 24 deletions

View file

@ -1,14 +1,8 @@
.place {
position: relative;
height: 64px;
height: $bar_height;
flex: 0 1 500px;
display: flex;
&:hover {
.seeker {
transform: translate(0, -64px);
}
}
}
.wrap {
@ -22,7 +16,7 @@
top: 0;
left: 0;
width: 100%;
height: 64px;
height: $bar_height;
flex-direction: column;
transform: translate(0, 0);
z-index: 3;
@ -30,18 +24,18 @@
}
.status {
flex: 0 0 64px;
flex: 0 0 $bar_height;
display: flex;
flex-direction: row;
width: 100%;
position: absolute;
z-index: 1;
height: 64px;
height: $bar_height;
}
.playpause,
.close {
flex: 0 0 48px;
flex: 0 0 $bar_height;
display: flex;
align-items: center;
justify-content: center;

View file

@ -0,0 +1,39 @@
import React, { FC, useCallback } from 'react';
import { connect } from 'react-redux';
import { Icon } from '~/components/input/Icon';
import * as MODAL_ACTIONS from '~/redux/modal/actions';
import { DIALOGS } from '~/redux/modal/constants';
import * as styles from './styles.scss';
const mapStateToProps = null;
const mapDispatchToProps = {
showDialog: MODAL_ACTIONS.modalShowDialog,
};
type IProps = typeof mapDispatchToProps & {};
const SubmitBarUnconnected: FC<IProps> = ({ showDialog }) => {
const onOpenImageEditor = useCallback(() => showDialog(DIALOGS.EDITOR_IMAGE), [showDialog]);
return (
<div className={styles.wrap}>
<div className={styles.panel}>
<div onClick={onOpenImageEditor}>
<Icon icon="image" />
</div>
</div>
<div className={styles.button}>
<Icon icon="plus" />
</div>
</div>
);
};
const SubmitBar = connect(
mapStateToProps,
mapDispatchToProps
)(SubmitBarUnconnected);
export { SubmitBar };

View file

@ -0,0 +1,65 @@
.wrap {
position: absolute;
right: -($bar_height + $gap);
&:hover {
.panel {
transform: translate(0, 0);
}
}
@include tablet {
position: relative;
right: 0;
margin-left: $gap;
}
}
.button {
background: $red_gradient;
width: $bar_height;
height: $bar_height;
border-radius: $bar_height / 2;
display: flex;
align-items: center;
justify-content: center;
border-radius: $radius $radius 0 0;
cursor: pointer;
position: relative;
z-index: 2;
svg {
width: 32px;
height: 32px;
}
}
.panel {
background: lighten($content_bg, 4%);
position: absolute;
bottom: 0;
z-index: 1;
padding-bottom: $bar_height;
border-radius: $radius $radius 0 0;
transform: translate(0, 100%);
transition: transform 250ms;
div {
@include outer_shadow;
height: $bar_height;
width: $bar_height;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
svg {
width: 32px;
height: 32px;
}
&:first-child {
border-radius: $radius $radius 0 0;
}
}
}

View file

@ -12,9 +12,7 @@ import * as MODAL_ACTIONS from '~/redux/modal/actions';
import { DIALOGS } from '~/redux/modal/constants';
import { pick } from 'ramda';
import { Icon } from '~/components/input/Icon';
import { url } from 'inspector';
import { getURL } from '~/utils/dom';
import path from 'ramda/es/path';
const mapStateToProps = state => ({
user: pick(['username', 'is_user', 'photo'])(selectUser(state)),
@ -29,7 +27,6 @@ type IProps = ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps & {
const HeaderUnconnected: FC<IProps> = ({ user: { username, is_user, photo }, showDialog }) => {
const onLogin = useCallback(() => showDialog(DIALOGS.LOGIN), [showDialog]);
const onOpenEditor = useCallback(() => showDialog(DIALOGS.EDITOR), [showDialog]);
return (
<div className={style.container}>
@ -38,7 +35,6 @@ const HeaderUnconnected: FC<IProps> = ({ user: { username, is_user, photo }, sho
<Filler />
<div className={style.plugs}>
<div onClick={onOpenEditor}>editor</div>
<Link to="/">flow</Link>
</div>