1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

fixed date on recent items

This commit is contained in:
Fedor Katurov 2019-11-05 17:17:07 +07:00
parent 8a37fa1f1b
commit fc57a6224b
2 changed files with 3 additions and 8 deletions

View file

@ -1,7 +1,7 @@
import React, { FC } from 'react';
import * as styles from './styles.scss';
import { IFlowState } from '~/redux/flow/reducer';
import { getURL } from '~/utils/dom';
import { getURL, getPrettyDate } from '~/utils/dom';
import { Link } from 'react-router-dom';
import { URLS } from '~/constants/urls';
import classNames from 'classnames';
@ -23,7 +23,7 @@ const FlowRecent: FC<IProps> = ({ recent, updated }) => (
<div className={styles.info}>
<div className={styles.title}>{node.title}</div>
<div className={styles.comment}>{node.created_at}</div>
<div className={styles.comment}>{getPrettyDate(node.created_at)}</div>
</div>
</Link>
))}
@ -37,7 +37,7 @@ const FlowRecent: FC<IProps> = ({ recent, updated }) => (
/>
<div className={styles.info}>
<div className={styles.title}>{node.title}</div>
<div className={styles.comment}>{node.created_at}</div>
<div className={styles.comment}>{getPrettyDate(node.created_at)}</div>
</div>
</Link>
))}

View file

@ -80,11 +80,6 @@ export const formatText = (text: string): string =>
.replace(/:\|--\|/gim, '://')
.split('\n')
.map(el => `<p>${el}</p>`)
// .map((el, index) =>
// index === 0
// ? `${author ? `<p><b class="comment-author">${author}: </b>` : ''}${el}</p>`
// : `<p>${el}</p>`
// )
.join('');
export const formatCommentText = (author: string, text: string): string =>