mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-26 05:16:41 +07:00
clearing search
This commit is contained in:
parent
9498c7b7a0
commit
47adbdf6f0
13 changed files with 215 additions and 195 deletions
30
src/components/flow/FlowRecentItem/index.tsx
Normal file
30
src/components/flow/FlowRecentItem/index.tsx
Normal file
|
@ -0,0 +1,30 @@
|
|||
import React, { FC } from 'react';
|
||||
import { INode } from '~/redux/types';
|
||||
import styles from './styles.scss';
|
||||
import { URLS } from '~/constants/urls';
|
||||
import { NodeRelatedItem } from '~/components/node/NodeRelatedItem';
|
||||
import { getPrettyDate } from '~/utils/dom';
|
||||
import { Link } from 'react-router-dom';
|
||||
import classNames from 'classnames';
|
||||
|
||||
interface IProps {
|
||||
node: Partial<INode>;
|
||||
has_new?: boolean;
|
||||
}
|
||||
|
||||
const FlowRecentItem: FC<IProps> = ({ node, has_new }) => {
|
||||
return (
|
||||
<Link key={node.id} className={styles.item} to={URLS.NODE_URL(node.id)}>
|
||||
<div className={classNames(styles.thumb, { [styles.new]: has_new })}>
|
||||
<NodeRelatedItem item={node} />
|
||||
</div>
|
||||
|
||||
<div className={styles.info}>
|
||||
<div className={styles.title}>{node.title}</div>
|
||||
<div className={styles.comment}>{getPrettyDate(node.created_at)}</div>
|
||||
</div>
|
||||
</Link>
|
||||
);
|
||||
};
|
||||
|
||||
export { FlowRecentItem };
|
57
src/components/flow/FlowRecentItem/styles.scss
Normal file
57
src/components/flow/FlowRecentItem/styles.scss
Normal file
|
@ -0,0 +1,57 @@
|
|||
.item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font: $font_12_regular;
|
||||
border-radius: $radius;
|
||||
flex-direction: row;
|
||||
margin-bottom: $gap;
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.thumb {
|
||||
height: 48px;
|
||||
margin-right: $gap;
|
||||
background: 50% 50% no-repeat;
|
||||
background-size: cover;
|
||||
border-radius: $radius;
|
||||
flex: 0 0 48px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
|
||||
&.new {
|
||||
&::after {
|
||||
content: ' ';
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 100%;
|
||||
background: $red;
|
||||
box-shadow: $content_bg 0 0 0 5px;
|
||||
position: absolute;
|
||||
right: -2px;
|
||||
bottom: -2px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.title {
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
font: $font_16_semibold;
|
||||
text-transform: capitalize;
|
||||
}
|
||||
|
||||
.comment {
|
||||
font: $font_12_regular;
|
||||
margin-top: 4px;
|
||||
opacity: 0.5;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue