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

Changed lab gaps and colors

This commit is contained in:
Fedor Katurov 2021-03-30 17:49:17 +07:00
parent 19449f13b4
commit 330fdcf444
8 changed files with 53 additions and 9 deletions

View file

@ -31,14 +31,14 @@ const LabBottomPanel: FC<Props> = ({ node, hasNewComments, commentCount }) => {
horizontal
className={classNames(styles.comments, { [styles.active]: hasNewComments })}
>
<Icon icon={hasNewComments ? 'comment_new' : 'comment'} size={16} />
<Icon icon={hasNewComments ? 'comment_new' : 'comment'} size={24} />
<span>{commentCount}</span>
</Grid>
)}
{!!node.like_count && node.like_count > 0 && (
<Grid horizontal className={classNames(styles.like)}>
<Icon icon={node.is_liked ? 'heart_full' : 'heart'} size={16} />
<Icon icon={node.is_liked ? 'heart_full' : 'heart'} size={24} />
<span>{node.like_count}</span>
</Grid>
)}

View file

@ -11,13 +11,14 @@
.comments, .like {
flex: 0;
font: $font_14_semibold;
font: $font_16_semibold;
color: darken(white, 50%);
fill: currentColor;
stroke: none;
column-gap: $gap / 2 !important;
column-gap: $gap !important;
align-items: center;
justify-content: center;
padding-left: $gap;
&.active {
color: $red;

View file

@ -0,0 +1,20 @@
import React, { FC } from 'react';
import { INodeComponentProps } from '~/redux/node/constants';
import styles from './styles.module.scss';
import { Markdown } from '~/components/containers/Markdown';
import { formatText } from '~/utils/dom';
const LabDescription: FC<INodeComponentProps> = ({ node }) => {
if (!node.description) {
return null;
}
return (
<Markdown
className={styles.wrap}
dangerouslySetInnerHTML={{ __html: formatText(node.description) }}
/>
);
};
export { LabDescription };

View file

@ -0,0 +1,22 @@
@import "~/styles/variables.scss";
.wrap {
padding: $lab_gap $lab_gap 0;
line-height: 1.3em;
@include tablet {
position: relative;
max-height: 30vh;
overflow: hidden;
&::after {
content: ' ';
position: absolute;
background: linear-gradient(transparentize($lab_post_bg, 1), $lab_post_bg 80%);
bottom: 0;
left: auto;
width: 100%;
height: 100px;
}
}
}

View file

@ -23,7 +23,7 @@ const LabNodeTitle: FC<IProps> = ({ node }) => {
{node.is_heroic && (
<Tippy content="Важный пост">
<div className={styles.star}>
<Icon icon="star_full" />
<Icon icon="star_full" size={24} />
</div>
</Tippy>
)}

View file

@ -24,6 +24,6 @@
}
.star {
fill: $yellow;
fill: darken(white, 50%);
flex: 0 0 24px;
}

View file

@ -6,7 +6,7 @@
@include tablet {
position: relative;
max-height: 50vh;
max-height: 100vh;
overflow: hidden;
&::after {

View file

@ -19,6 +19,7 @@ import { LabNodeTitle } from '~/components/lab/LabNodeTitle';
import { LabText } from '~/components/lab/LabText';
import { LabImage } from '~/components/lab/LabImage';
import { LabPad } from '~/components/lab/LabPad';
import { LabDescription } from '~/components/lab/LabDescription';
const prefix = 'NODE.';
export const NODE_ACTIONS = {
@ -88,8 +89,8 @@ export type INodeComponentProps = {
export type INodeComponents = Record<ValueOf<typeof NODE_TYPES>, FC<INodeComponentProps>>;
export const LAB_PREVIEW_LAYOUT: Record<string, FC<INodeComponentProps>[]> = {
[NODE_TYPES.IMAGE]: [LabImage, LabPad, LabNodeTitle],
[NODE_TYPES.VIDEO]: [NodeVideoBlock, LabPad, LabNodeTitle],
[NODE_TYPES.IMAGE]: [LabImage, LabPad, LabNodeTitle, LabDescription],
[NODE_TYPES.VIDEO]: [NodeVideoBlock, LabPad, LabNodeTitle, LabDescription],
[NODE_TYPES.AUDIO]: [LabPad, LabNodeTitle, LabPad, NodeAudioImageBlock, NodeAudioBlock, LabPad],
[NODE_TYPES.TEXT]: [LabPad, LabNodeTitle, LabPad, LabText, LabPad],
};