diff --git a/src/components/ArticleImgWindow/index.tsx b/src/components/ArticleImgWindow/index.tsx new file mode 100755 index 000000000..d41a3e98a --- /dev/null +++ b/src/components/ArticleImgWindow/index.tsx @@ -0,0 +1,29 @@ +/* + * + * ArticleImgWindow + * + */ + +import { FC, memo } from 'react' + +import { buildLog } from '@/utils' + +import { Wrapper, Block } from './styles' + +/* eslint-disable-next-line */ +const log = buildLog('c:ArticleImgWindow:index') + +type TProps = { + testid?: string +} + +const ArticleImgWindow: FC = ({ testid = 'article-img-window' }) => { + return ( + + + + + ) +} + +export default memo(ArticleImgWindow) diff --git a/src/components/ArticleImgWindow/styles/index.ts b/src/components/ArticleImgWindow/styles/index.ts new file mode 100755 index 000000000..33c0b76f0 --- /dev/null +++ b/src/components/ArticleImgWindow/styles/index.ts @@ -0,0 +1,19 @@ +import styled from 'styled-components' + +import type { TTestable } from '@/spec' + +// import Img from '@/Img' +import { css } from '@/utils' + +export const Wrapper = styled.div.attrs(({ testid }: TTestable) => ({ + 'data-test-id': testid, +}))` + ${css.flex('align-center')}; +` +export const Block = styled.div` + width: 30%; + height: 60px; + background: #06303b; + margin-right: 10px; + border-radius: 5px; +` diff --git a/src/components/ArticleImgWindow/tests/index.test.ts b/src/components/ArticleImgWindow/tests/index.test.ts new file mode 100755 index 000000000..d61ee9267 --- /dev/null +++ b/src/components/ArticleImgWindow/tests/index.test.ts @@ -0,0 +1,10 @@ +// import React from 'react' +// import { shallow } from 'enzyme' + +// import ArticleImgWindow from '../index' + +describe('TODO ', () => { + it('Expect to have unit tests specified', () => { + expect(true).toEqual(true) + }) +}) diff --git a/src/components/AvatarsRow/index.tsx b/src/components/AvatarsRow/index.tsx index 4c5cb046a..d499cb1b3 100755 --- a/src/components/AvatarsRow/index.tsx +++ b/src/components/AvatarsRow/index.tsx @@ -42,8 +42,9 @@ const getUniqueArray = (arr, comp) => { export type TProps = { users?: TUser[] size?: TAvatarSize - total: number + total?: number | null limit: number + showMore?: boolean showTotalNumber?: boolean reverse?: boolean scrollPosition?: any @@ -54,11 +55,12 @@ export type TProps = { const AvatarsRow: FC = ({ size = SIZE.SMALL, - total, + total = null, users = [], limit = AVATARS_LIST_LENGTH.POSTS, onUserSelect = log, onTotalSelect = log, + showMore = true, showTotalNumber = false, reverse = true, // see https://github.com/Aljullu/react-lazy-load-image-component/issues/42 @@ -68,23 +70,25 @@ const AvatarsRow: FC = ({ return } + const totalCount = total || users.length + users = filter(validUser, getUniqueArray(users, 'id')) const sortedUsers = reverse ? users : reverseFn(users) return ( - - {total <= 1 ? ( + + {totalCount <= 1 || !showMore ? ( ) : ( )} - {total === 1 ? ( + {totalCount === 1 ? ( { switch (size) { case SIZE.LARGE: { - return '14px' + return '16px' } case SIZE.MEDIUM: { - return '13px' + return '15px' } case SIZE.TINY: { return '11px' @@ -26,6 +26,9 @@ export const getTextSize = (size: TSIZE): string => { case SIZE.LARGE: { return '15px' } + case SIZE.MEDIUM: { + return '14px' + } case SIZE.TINY: { return '11px' } diff --git a/src/components/JobItem/DesktopView/Footer.tsx b/src/components/JobItem/DesktopView/Footer.tsx index 240bc428f..a96469f98 100644 --- a/src/components/JobItem/DesktopView/Footer.tsx +++ b/src/components/JobItem/DesktopView/Footer.tsx @@ -1,13 +1,26 @@ import { FC, memo } from 'react' +import { ICON } from '@/config' +import Upvote from '@/components/Upvote' +import DotDivider from '@/components/DotDivider' +import IconText from '@/components/IconText' + +import { Wrapper, PublishWrapper, Bottom } from '../styles/desktop_view/footer' + const Footer: FC = () => { return ( -
-
mydearxym 发布于: 3 天前
-
- 你和 头像 Raw 等 24 人觉得不错 -- 评论 35,收藏, 分享, 举报(more 里面) -
-
+ + + mydearxym 3 天前 + + + {/* 你和 头像 Raw 等 24 人觉得很赞 -- 评论 35,收藏, 分享, 举报(more 里面) */} + + + 9 + + + ) } diff --git a/src/components/JobItem/DesktopView/index.tsx b/src/components/JobItem/DesktopView/index.tsx index 8a34afd75..e4152fb8c 100644 --- a/src/components/JobItem/DesktopView/index.tsx +++ b/src/components/JobItem/DesktopView/index.tsx @@ -4,7 +4,8 @@ import type { TJob } from '@/spec' import { cutRest } from '@/utils' import DigestSentence from '@/components/DigestSentence' -import { Br } from '@/components/Common' +import { Br, SpaceGrow } from '@/components/Common' +import ArticleImgWindow from '@/components/ArticleImgWindow' import Header from './Header' import Footer from './Footer' @@ -28,9 +29,10 @@ const DesktopView: FC = ({ entry }) => { 100, )} -
-
图片列表,可预览
-
+
+ +
+