1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 20:36:40 +07:00

fixed comment button appearance on small devices

This commit is contained in:
Fedor Katurov 2022-01-02 17:20:18 +07:00
parent 5b2bf82d48
commit 85c7888c41
4 changed files with 21 additions and 35 deletions

View file

@ -15,6 +15,7 @@ import { UploadDropzone } from '~/components/upload/UploadDropzone';
import styles from './styles.module.scss'; import styles from './styles.module.scss';
import { ERROR_LITERAL } from '~/constants/errors'; import { ERROR_LITERAL } from '~/constants/errors';
import { useInputPasteUpload } from '~/utils/hooks/useInputPasteUpload'; import { useInputPasteUpload } from '~/utils/hooks/useInputPasteUpload';
import { Filler } from '~/components/containers/Filler';
interface IProps { interface IProps {
comment?: IComment; comment?: IComment;
@ -67,11 +68,13 @@ const CommentForm: FC<IProps> = ({ comment, nodeId, onCancelEdit }) => {
<CommentFormAttaches /> <CommentFormAttaches />
<div className={styles.buttons}> <div className={styles.buttons}>
<div className={styles.buttons_attach}> <div className={styles.button_column}>
<CommentFormAttachButtons onUpload={uploader.uploadFiles} /> <CommentFormAttachButtons onUpload={uploader.uploadFiles} />
</div> </div>
<div className={styles.buttons_format}> <Filler />
<div className={styles.button_column}>
{!!textarea && ( {!!textarea && (
<CommentFormFormatButtons <CommentFormFormatButtons
element={textarea} element={textarea}
@ -80,7 +83,7 @@ const CommentForm: FC<IProps> = ({ comment, nodeId, onCancelEdit }) => {
)} )}
</div> </div>
<div className={styles.buttons_submit}> <div className={styles.button_column}>
{isLoading && <LoaderCircle size={20} />} {isLoading && <LoaderCircle size={20} />}
{isEditing && ( {isEditing && (

View file

@ -20,42 +20,15 @@
.buttons { .buttons {
position: relative; position: relative;
z-index: 1; z-index: 1;
display: grid; display: flex;
background: transparentize(black, 0.8); background: transparentize(black, 0.8);
padding: $gap / 2;
border-radius: 0 0 $radius $radius; border-radius: 0 0 $radius $radius;
flex-wrap: wrap; flex-wrap: wrap;
column-gap: $gap; padding: $gap / 4;
grid-template-columns: auto 1fr auto; }
grid-template-rows: 1fr;
grid-template-areas: "attach format submit";
@media(max-width: 470px) { .button_column {
padding: $gap; padding: $gap / 4;
grid-template-columns: 1fr auto;
grid-template-rows: 1fr 1fr;
grid-template-areas:
"attach format"
"submit submit";
row-gap: $gap;
}
&_attach {
grid-area: attach;
}
&_format {
grid-area: format;
}
&_submit {
grid-area: submit;
display: grid;
grid-auto-flow: column;
align-items: flex-end;
justify-content: flex-end;
column-gap: $gap / 2;
}
} }
.uploads { .uploads {

View file

@ -66,6 +66,7 @@ const CommentFormFormatButtons: FC<IProps> = ({ element, handler }) => {
iconOnly iconOnly
type="button" type="button"
label="Жирный Ctrl+B" label="Жирный Ctrl+B"
className={styles.button}
/> />
<Button <Button
@ -76,6 +77,7 @@ const CommentFormFormatButtons: FC<IProps> = ({ element, handler }) => {
iconOnly iconOnly
type="button" type="button"
label="Наклонный Ctrl+I" label="Наклонный Ctrl+I"
className={styles.button}
/> />
<Button <Button
@ -86,6 +88,7 @@ const CommentFormFormatButtons: FC<IProps> = ({ element, handler }) => {
iconOnly iconOnly
type="button" type="button"
label="Заголовок" label="Заголовок"
className={styles.button}
/> />
<Button <Button
@ -96,6 +99,7 @@ const CommentFormFormatButtons: FC<IProps> = ({ element, handler }) => {
iconOnly iconOnly
type="button" type="button"
label="Ссылка" label="Ссылка"
className={styles.button}
/> />
<Button <Button
@ -105,6 +109,7 @@ const CommentFormFormatButtons: FC<IProps> = ({ element, handler }) => {
iconOnly iconOnly
type="button" type="button"
label="Коммент" label="Коммент"
className={styles.button}
> >
{`/ /`} {`/ /`}
</Button> </Button>

View file

@ -6,4 +6,9 @@
height: 32px; height: 32px;
flex: 1; flex: 1;
width: 100%; width: 100%;
min-width: 0;
}
.button {
white-space: nowrap;
} }