mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
updated boris layout
This commit is contained in:
parent
36997875ee
commit
67848ae061
4 changed files with 32 additions and 13 deletions
|
@ -1,4 +1,4 @@
|
|||
import React, { FC } from 'react';
|
||||
import React, { FC, useMemo } from 'react';
|
||||
import * as styles from './styles.scss';
|
||||
import { Group } from '~/components/containers/Group';
|
||||
import classNames from 'classnames';
|
||||
|
@ -8,14 +8,21 @@ import { t } from '~/utils/trans';
|
|||
|
||||
interface IProps {
|
||||
is_loading?: boolean;
|
||||
count?: number;
|
||||
}
|
||||
|
||||
const NodeNoComments: FC<IProps> = ({ is_loading = false }) => (
|
||||
<Group className={classNames(styles.wrap, { is_loading })}>
|
||||
<div className={styles.card} />
|
||||
<div className={styles.card}>{!is_loading && t(ERRORS.NO_COMMENTS)}</div>
|
||||
<div className={styles.card} />
|
||||
</Group>
|
||||
);
|
||||
const NodeNoComments: FC<IProps> = ({ is_loading = false, count = 3 }) => {
|
||||
const items = useMemo(
|
||||
() => [...new Array(count)].map((_, i) => <div className={styles.card} key={i} />),
|
||||
[count]
|
||||
);
|
||||
|
||||
return (
|
||||
<Group className={classNames(styles.wrap, { is_loading })}>
|
||||
{items}
|
||||
<div className={styles.nothing}>{!is_loading && t(ERRORS.NO_COMMENTS)}</div>
|
||||
</Group>
|
||||
);
|
||||
};
|
||||
|
||||
export { NodeNoComments };
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
.wrap {
|
||||
user-select: none;
|
||||
// height: 300px;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
flex: 0 0 auto;
|
||||
|
@ -38,8 +37,17 @@
|
|||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-transform: uppercase;
|
||||
font: $font_18_semibold;
|
||||
color: transparentize(white, 0.5);
|
||||
flex: 0 0 $comment_height;
|
||||
}
|
||||
|
||||
.nothing {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
font: $font_18_semibold;
|
||||
text-transform: uppercase;
|
||||
color: darken(white, 75%);
|
||||
height: 20px;
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ const BorisLayoutUnconnected: FC<IProps> = ({
|
|||
{is_user && <NodeCommentForm is_before />}
|
||||
|
||||
{is_loading_comments ? (
|
||||
<NodeNoComments is_loading />
|
||||
<NodeNoComments is_loading count={7} />
|
||||
) : (
|
||||
<NodeComments
|
||||
comments={comments}
|
||||
|
|
|
@ -14,6 +14,10 @@
|
|||
box-shadow: inset transparentize(mix($wisegreen, white, 60%), 0.6) 0 1px;
|
||||
|
||||
@include desktop {
|
||||
flex: 2.5;
|
||||
}
|
||||
|
||||
@media(max-width: 1024px) {
|
||||
flex: 2;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue