mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-05-01 15:46:40 +07:00
added deletion badge
This commit is contained in:
parent
3c844e9b27
commit
6eafc227da
3 changed files with 69 additions and 45 deletions
10
src/components/node/NodeDeletedBadge/index.tsx
Normal file
10
src/components/node/NodeDeletedBadge/index.tsx
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
import React, { FC } from 'react';
|
||||||
|
import styles from './styles.scss';
|
||||||
|
|
||||||
|
interface IProps {}
|
||||||
|
|
||||||
|
const NodeDeletedBadge: FC<IProps> = ({}) => {
|
||||||
|
return <div className={styles.badge}>Эта ячейка заблокирована. Её не никто не увидит.</div>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export { NodeDeletedBadge };
|
9
src/components/node/NodeDeletedBadge/styles.scss
Normal file
9
src/components/node/NodeDeletedBadge/styles.scss
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
.badge {
|
||||||
|
padding: $gap;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: $radius;
|
||||||
|
color: $red;
|
||||||
|
padding: $gap * 4 $gap;
|
||||||
|
text-transform: uppercase;
|
||||||
|
font: $font_18_semibold;
|
||||||
|
}
|
|
@ -19,6 +19,7 @@ import { CommentForm } from '~/components/node/CommentForm';
|
||||||
import { selectUser } from '~/redux/auth/selectors';
|
import { selectUser } from '~/redux/auth/selectors';
|
||||||
import pick from 'ramda/es/pick';
|
import pick from 'ramda/es/pick';
|
||||||
import { NodeRelatedPlaceholder } from '~/components/node/NodeRelated/placeholder';
|
import { NodeRelatedPlaceholder } from '~/components/node/NodeRelated/placeholder';
|
||||||
|
import { NodeDeletedBadge } from '~/components/node/NodeDeletedBadge';
|
||||||
|
|
||||||
const mapStateToProps = state => ({
|
const mapStateToProps = state => ({
|
||||||
node: selectNode(state),
|
node: selectNode(state),
|
||||||
|
@ -108,6 +109,9 @@ const NodeLayoutUnconnected: FC<IProps> = memo(
|
||||||
is_loading={is_loading}
|
is_loading={is_loading}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
{node.deleted_at ? (
|
||||||
|
<NodeDeletedBadge />
|
||||||
|
) : (
|
||||||
<Group>
|
<Group>
|
||||||
<Padder>
|
<Padder>
|
||||||
<Group horizontal className={styles.content}>
|
<Group horizontal className={styles.content}>
|
||||||
|
@ -157,6 +161,7 @@ const NodeLayoutUnconnected: FC<IProps> = memo(
|
||||||
</Group>
|
</Group>
|
||||||
</Padder>
|
</Padder>
|
||||||
</Group>
|
</Group>
|
||||||
|
)}
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue