mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
NodeNoComments
This commit is contained in:
parent
ea87b50a83
commit
b5b8d78cea
7 changed files with 69 additions and 9 deletions
|
@ -7,8 +7,12 @@ type IProps = React.HTMLAttributes<HTMLDivElement> & {}
|
||||||
const Card: FC<IProps> = ({
|
const Card: FC<IProps> = ({
|
||||||
className,
|
className,
|
||||||
children,
|
children,
|
||||||
|
...props
|
||||||
}) => (
|
}) => (
|
||||||
<div className={classNames(styles.card, className)}>
|
<div
|
||||||
|
className={classNames(styles.card, className)}
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,18 +1,28 @@
|
||||||
import React, { FC } from 'react';
|
import React, {FC, HTMLAttributes} from 'react';
|
||||||
import { Card } from "~/components/containers/Card";
|
import { Card } from "~/components/containers/Card";
|
||||||
import * as styles from './styles.scss';
|
import * as styles from './styles.scss';
|
||||||
|
import classNames = require("classnames");
|
||||||
|
|
||||||
interface IProps {}
|
type IProps = HTMLAttributes<HTMLDivElement> & {
|
||||||
|
is_empty?: boolean;
|
||||||
|
is_loading?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
const Comment: FC<IProps> = () => (
|
const Comment: FC<IProps> = ({
|
||||||
<Card className={styles.wrap}>
|
is_empty,
|
||||||
|
is_loading,
|
||||||
|
className,
|
||||||
|
...props
|
||||||
|
}) => (
|
||||||
|
<Card
|
||||||
|
className={classNames(styles.wrap, className, { is_empty, is_loading })}
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
<div className={styles.thumb}>
|
<div className={styles.thumb}>
|
||||||
<div className={styles.thumb_image} />
|
<div className={styles.thumb_image} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={styles.text}>
|
<div className={styles.text} />
|
||||||
Lorem Ipsum
|
|
||||||
</div>
|
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,12 @@
|
||||||
.wrap {
|
.wrap {
|
||||||
background: $comment_bg;
|
background: $comment_bg;
|
||||||
min-height: 200px;
|
min-height: 64px;
|
||||||
display: flex;
|
display: flex;
|
||||||
box-shadow: $comment_shadow;
|
box-shadow: $comment_shadow;
|
||||||
|
|
||||||
|
&:global(.is_empty) {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.text {
|
.text {
|
||||||
|
|
16
src/components/node/NodeNoComments/index.tsx
Normal file
16
src/components/node/NodeNoComments/index.tsx
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
import React, { FC } from "react";
|
||||||
|
import { Comment } from "~/components/node/Comment";
|
||||||
|
import * as styles from './styles.scss';
|
||||||
|
import {Group} from "~/components/containers/Group";
|
||||||
|
|
||||||
|
interface IProps {}
|
||||||
|
|
||||||
|
const NodeNoComments: FC<IProps> = () => (
|
||||||
|
<Group className={styles.wrap}>
|
||||||
|
<Comment is_empty={true} is_loading={false} style={{ height: 94 }} />
|
||||||
|
<Comment is_empty={true} is_loading={false} style={{ height: 104 }} />
|
||||||
|
<Comment is_empty={true} is_loading={false} style={{ height: 100 }} />
|
||||||
|
</Group>
|
||||||
|
);
|
||||||
|
|
||||||
|
export { NodeNoComments };
|
6
src/components/node/NodeNoComments/styles.scss
Normal file
6
src/components/node/NodeNoComments/styles.scss
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
.wrap {
|
||||||
|
height: 300px;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
@include after_shade($node_bg);
|
||||||
|
}
|
|
@ -9,6 +9,7 @@ import { NodePanel } from "~/components/node/NodePanel";
|
||||||
import { NodeRelated } from "~/components/node/NodeRelated";
|
import { NodeRelated } from "~/components/node/NodeRelated";
|
||||||
import { Tags } from "~/components/node/Tags";
|
import { Tags } from "~/components/node/Tags";
|
||||||
import { MenuButton } from "~/components/node/MenuButton";
|
import { MenuButton } from "~/components/node/MenuButton";
|
||||||
|
import { NodeNoComments } from "~/components/node/NodeNoComments";
|
||||||
|
|
||||||
interface IProps {}
|
interface IProps {}
|
||||||
|
|
||||||
|
@ -26,6 +27,8 @@ const ImageExample: FC<IProps> = () => (
|
||||||
<Padder>
|
<Padder>
|
||||||
<Group horizontal className={styles.content}>
|
<Group horizontal className={styles.content}>
|
||||||
<Group className={styles.comments}>
|
<Group className={styles.comments}>
|
||||||
|
<NodeNoComments />
|
||||||
|
|
||||||
{
|
{
|
||||||
range(1,6).map(el => (
|
range(1,6).map(el => (
|
||||||
<Comment
|
<Comment
|
||||||
|
|
|
@ -81,3 +81,20 @@ $tag_height: 22px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@mixin after_shade($color, $position: relative) {
|
||||||
|
position: $position;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
content: ' ';
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
height: 120px;
|
||||||
|
width: 100%;
|
||||||
|
background: linear-gradient(transparentize($color, 1), $color);
|
||||||
|
border-radius: $radius;
|
||||||
|
pointer-events: none;
|
||||||
|
touch-action: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue