diff --git a/src/components/flow/FlowRecent/index.tsx b/src/components/flow/FlowRecent/index.tsx index 51440bb9..7923851c 100644 --- a/src/components/flow/FlowRecent/index.tsx +++ b/src/components/flow/FlowRecent/index.tsx @@ -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 = ({ recent, updated }) => (
{node.title}
-
{node.created_at}
+
{getPrettyDate(node.created_at)}
))} @@ -37,7 +37,7 @@ const FlowRecent: FC = ({ recent, updated }) => ( />
{node.title}
-
{node.created_at}
+
{getPrettyDate(node.created_at)}
))} diff --git a/src/utils/dom.ts b/src/utils/dom.ts index 08ee639c..65e9e0de 100644 --- a/src/utils/dom.ts +++ b/src/utils/dom.ts @@ -80,11 +80,6 @@ export const formatText = (text: string): string => .replace(/:\|--\|/gim, '://') .split('\n') .map(el => `

${el}

`) - // .map((el, index) => - // index === 0 - // ? `${author ? `

${author}: ` : ''}${el}

` - // : `

${el}

` - // ) .join(''); export const formatCommentText = (author: string, text: string): string =>