mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
#23 added boris UI tab
This commit is contained in:
parent
e38090c755
commit
5f57314eec
11 changed files with 206 additions and 74 deletions
|
@ -95,7 +95,11 @@ const EditorDialogUnconnected: FC<IProps> = ({
|
|||
maxLength={256}
|
||||
/>
|
||||
|
||||
<Button title="Сохранить" iconRight="check" />
|
||||
<Button
|
||||
title="Сохранить"
|
||||
iconRight="check"
|
||||
color={data.is_promoted ? 'primary' : 'secondary'}
|
||||
/>
|
||||
</Group>
|
||||
</Padder>
|
||||
);
|
||||
|
|
|
@ -2,16 +2,11 @@ import React, { FC, useEffect } from 'react';
|
|||
import { selectNode, selectNodeComments } from '~/redux/node/selectors';
|
||||
import { selectUser } from '~/redux/auth/selectors';
|
||||
import { useDispatch } from 'react-redux';
|
||||
import { NodeComments } from '~/components/node/NodeComments';
|
||||
import styles from './styles.module.scss';
|
||||
import { Group } from '~/components/containers/Group';
|
||||
import boris from '~/sprites/boris_robot.svg';
|
||||
import { NodeNoComments } from '~/components/node/NodeNoComments';
|
||||
import { useRandomPhrase } from '~/constants/phrases';
|
||||
import { NodeCommentForm } from '~/components/node/NodeCommentForm';
|
||||
import isBefore from 'date-fns/isBefore';
|
||||
import { Card } from '~/components/containers/Card';
|
||||
import { Footer } from '~/components/main/Footer';
|
||||
import { BorisStats } from '~/components/boris/BorisStats';
|
||||
import { useShallowSelect } from '~/utils/hooks/useShallowSelect';
|
||||
import { selectBorisStats } from '~/redux/boris/selectors';
|
||||
|
@ -20,6 +15,10 @@ import { nodeLoadNode } from '~/redux/node/actions';
|
|||
import { borisLoadStats } from '~/redux/boris/actions';
|
||||
import { Container } from '~/containers/main/Container';
|
||||
import StickyBox from 'react-sticky-box/dist/esnext';
|
||||
import { BorisComments } from '~/components/boris/BorisComments';
|
||||
import { URLS } from '~/constants/urls';
|
||||
import { Route, Switch } from 'react-router-dom';
|
||||
import { BorisUIDemo } from '~/components/boris/BorisUIDemo';
|
||||
|
||||
type IProps = {};
|
||||
|
||||
|
@ -69,24 +68,18 @@ const BorisLayout: FC<IProps> = () => {
|
|||
</div>
|
||||
|
||||
<div className={styles.container}>
|
||||
<Card className={styles.content}>
|
||||
<Group className={styles.grid}>
|
||||
{user.is_user && <NodeCommentForm isBefore nodeId={node.current.id} />}
|
||||
{
|
||||
<Switch>
|
||||
<Route path={`${URLS.BORIS}/ui`} component={BorisUIDemo} />
|
||||
|
||||
{node.is_loading_comments ? (
|
||||
<NodeNoComments is_loading count={7} />
|
||||
) : (
|
||||
<NodeComments
|
||||
comments={comments}
|
||||
count={node.comment_count}
|
||||
user={user}
|
||||
order="ASC"
|
||||
/>
|
||||
)}
|
||||
</Group>
|
||||
|
||||
<Footer />
|
||||
</Card>
|
||||
<BorisComments
|
||||
isLoadingComments={node.is_loading_comments}
|
||||
commentCount={node.comment_count}
|
||||
node={node.current}
|
||||
comments={node.comments}
|
||||
/>
|
||||
</Switch>
|
||||
}
|
||||
|
||||
<Group className={styles.stats}>
|
||||
<StickyBox className={styles.sticky} offsetTop={72} offsetBottom={10}>
|
||||
|
|
|
@ -7,22 +7,6 @@
|
|||
flex-direction: column;
|
||||
}
|
||||
|
||||
.content {
|
||||
flex: 4;
|
||||
z-index: 2;
|
||||
border-radius: $radius;
|
||||
padding: 0;
|
||||
background: $node_bg;
|
||||
box-shadow: inset transparentize(mix($wisegreen, white, 60%), 0.6) 0 1px;
|
||||
|
||||
@include desktop {
|
||||
flex: 2.5;
|
||||
}
|
||||
|
||||
@media(max-width: 1024px) {
|
||||
flex: 2;
|
||||
}
|
||||
}
|
||||
|
||||
.grid {
|
||||
padding: $gap;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue