Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/containers/content/WorksContent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { buildLog } from '@/utils/logger'
import { bond } from '@/utils/mobx'

import Pagi from '@/widgets/Pagi'
// import AvatarsRow from '@/widgets/AvatarsRow'
// import AvatarsGroup from '@/widgets/AvatarsGroup'

import type { TStore } from './store'

Expand Down Expand Up @@ -64,7 +64,7 @@ const WorksContentContainer: FC<TProps> = ({
<Pagi margin={{ top: '60px', bottom: '80px' }} />
{/* <PagiInfo>
<PagiInfoTitle>活跃用户</PagiInfoTitle>
<AvatarsRow users={tmpUsers} total={10} showTotalNumber />
<AvatarsGroup users={tmpUsers} total={10} showTotalNumber />
</PagiInfo> */}
</MainContent>
{!isMobile && <RightSidebar showSidebar={showSidebar} />}
Expand Down
2 changes: 1 addition & 1 deletion src/containers/thread/AboutThread/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const Sidebar: FC = () => {
<Block>
<Title>官方主页</Title>
<Desc>
<Linker src="https://groupher.com" left={-2} />
<Linker src="https://groupher.com" left={-2} top={12} />
</Desc>
</Block>
<Block>
Expand Down
12 changes: 6 additions & 6 deletions src/containers/thread/AboutThread/styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,33 @@ export const MainWrapper = styled.div`

background: transparent;
border-radius: 6px;
margin-top: 14px;
padding-left: 25px;
margin-top: 25px;
padding-left: 22px;
`
export const Block = styled.div`
margin-bottom: 30px;
padding-bottom: 30px;
border-bottom: 1px solid;
border-bottom-color: ${theme('border')};
width: 660px;
width: 620px;
`
export const IntroBlock = styled(Block)`
padding-right: 20px;
`
export const StateBlock = styled(Block)`
padding-right: 10px;
padding-right: 0;
`
export const MemberBlock = styled(Block)`
border-bottom: none;
`
export const Title = styled.div`
font-size: 14px;
font-size: 16px;
color: ${theme('thread.articleDigest')};
font-weight: 600;
margin-bottom: 15px;
`
export const Desc = styled.div`
font-size: 14px;
font-size: 15px;
color: ${theme('thread.articleDigest')};
line-height: 1.8;
`
2 changes: 1 addition & 1 deletion src/containers/thread/AboutThread/styles/members/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const Header = styled.div`
margin-bottom: 30px;
`
export const Title = styled.div`
font-size: 14px;
font-size: 16px;
color: ${theme('thread.articleDigest')};
font-weight: 600;
`
Expand Down
14 changes: 6 additions & 8 deletions src/containers/thread/AboutThread/styles/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ import css, { theme } from '@/utils/css'
export const Wrapper = styled.div`
width: 300px;
height: auto;
/* background: #f1f3f4; */
border: 1px solid;
border-color: ${theme('border')};
border-radius: 5px;
padding: 20px;
padding-top: 24px;
border-left: 1px solid;
border-left-color: ${theme('border')};
padding-left: 40px;
padding-top: 10px;
padding-bottom: 0;
margin-top: 18px;
margin-left: 80px;
margin-top: 19px;
margin-left: 60px;
`
export const Block = styled.div`
margin-bottom: 20px;
Expand Down
4 changes: 2 additions & 2 deletions src/containers/thread/KanbanThread/Actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ICON } from '@/config'
import { mockUsers } from '@/utils/mock'

import { IconSwitcher } from '@/widgets/Switcher'
import AvatarsRow from '@/widgets/AvatarsRow'
import AvatarsGroup from '@/widgets/AvatarsGroup'
import { Space } from '@/widgets/Common'

import {
Expand Down Expand Up @@ -51,7 +51,7 @@ const Actions: FC = () => {
</ModeWrapper>
<Space right={20} />
<JoinTitle>参与者</JoinTitle>
<AvatarsRow size="medium" users={mockUsers(6)} total={20} />
<AvatarsGroup size="medium" users={mockUsers(6)} total={20} />
{/* <Space right={25} /> */}
{/* <NewButton size="medium">
<BtnText>新增</BtnText>
Expand Down
3 changes: 1 addition & 2 deletions src/containers/tool/Drawer/Viewer/DesktopView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ const DesktopView: FC<TProps> = ({
articleNavi,
children,
}) => {
const visible2 = false

console.log('--> visible --> ', visible)
return (
<Fragment>
<DrawerOverlay
Expand Down
6 changes: 3 additions & 3 deletions src/containers/tool/Drawer/styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export const DrawerOverlay = styled.div<TActive>`
background: ${({ visible }) => (visible ? theme('drawer.mask') : 'none')};
opacity: ${({ visible }) => (visible ? 0.5 : 0)};

transition: visibility 0.25s linear, opacity 0.2s linear,
background 0.5s linear;
transition: visibility 0.1s ease-in, opacity 0.1s ease-in,
background 0.1s ease-in;
`
// see https://stackoverflow.com/questions/60079950/when-do-i-use-attrs-vs-passing-props-directly-with-styled-components

Expand Down Expand Up @@ -91,7 +91,7 @@ export const DrawerWrapper = styled.div.attrs(

will-change: transform, max-width, opacity;
// 在宽屏时滑出来时,是从内容页而不是实际的 window 页滑出, 加 delay 可以在视觉上抵消从外部滑入的跳动感
transition-delay: 0s, 0s, 0.06s;
transition-delay: 0s, 0s, 0.14s;

${css.media.mobile`
right: 0;
Expand Down
4 changes: 2 additions & 2 deletions src/containers/unit/Comments/HeadBar/PublishBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
Avatar,
UserName,
ActionsWrapper,
EditIcon,
Publishcon,
} from '../styles/head_bar/publish_bar'

type TProps = {
Expand All @@ -35,7 +35,7 @@ const PublishBar: FC<TProps> = ({ closeEditor }) => {
</Button>

<Button size="small" space={10}>
<EditIcon />
<Publishcon />
发布
</Button>
</ActionsWrapper>
Expand Down
8 changes: 4 additions & 4 deletions src/containers/unit/Comments/styles/head_bar/publish_bar.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import styled from 'styled-components'

import css, { theme } from '@/utils/css'
import EditPenSVG from '@/icons/EditPen'
import EditPublishSVG from '@/icons/EditPublish'
import Img from '@/Img'

export const Wrapper = styled.div`
Expand All @@ -22,8 +22,8 @@ export const UserName = styled.div`
export const ActionsWrapper = styled.div`
${css.flex('align-center')};
`
export const EditIcon = styled(EditPenSVG)`
${css.size(12)};
export const Publishcon = styled(EditPublishSVG)`
${css.size(13)};
fill: white;
margin-right: 5px;
margin-right: 6px;
`
8 changes: 4 additions & 4 deletions src/widgets/AvatarsRow/index.tsx → src/widgets/AvatarsGroup/index.tsx
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* AvatarsRow
* AvatarsGroup
*
*/

Expand Down Expand Up @@ -49,7 +49,7 @@ export const RealAvatar = dynamic(() => import('./RealAvatar'), {
})

/* eslint-disable-next-line */
const log = buildLog('c:AvatarsRow:index')
const log = buildLog('c:AvatarsGroup:index')

const validUser = compose(not, isNil)

Expand Down Expand Up @@ -83,7 +83,7 @@ export type TProps = {
onTotalSelect?: () => void
}

const AvatarsRow: FC<TProps> = ({
const AvatarsGroup: FC<TProps> = ({
size = SIZE.SMALL,
total = null,
users = [],
Expand Down Expand Up @@ -151,4 +151,4 @@ const AvatarsRow: FC<TProps> = ({
)
}

export default trackWindowScroll(AvatarsRow)
export default trackWindowScroll(AvatarsGroup)
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export const getTotalCountSize = (total: number): string => {
}

export const getMoreTextWidth = (total: number): string => {
if (total < 10) return '23px'
if (total >= 10 && total <= 99) return '32px'
if (total < 10) return '22px'
if (total >= 10 && total <= 99) return '28px'
if (total >= 100 && total <= 999) return '44px'

return '52px'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const AvatarsMore = styled.span<TAvatarsMore>`
min-width: ${({ size }) => getAvatarSize(size)};
height: ${({ size }) => getAvatarSize(size)};

padding-left: ${({ total }) => (total >= 1000 ? '5px' : '3px')};
padding-left: ${({ total }) => (total >= 1000 ? '5px' : '0')};
padding-top: 1px;

&:hover {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ export const Wrapper = styled(AvatarsMore)<TWrapper>`
height: ${({ size }) => getAvatarSize(size)};
width: ${({ total }) => getMoreTextWidth(total)};
font-weight: 400;
padding-left: 2px;
padding-left: 1px;
padding-top: 0.5px;
margin-left: 4px;
border-radius: 0 10px 10px 0;
font-size: 13px;
`
export const HighlightNumber = styled.div`
font-weight: 500;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// import React from 'react'
// import { shallow } from 'enzyme'

// import AvatarsRow from '../index'
// import AvatarsGroup from '../index'

describe('<AvatarsRow />', () => {
describe('<AvatarsGroup />', () => {
it('TODO: Expect to have unit tests specified', () => {
expect(true).toEqual(true)
})
Expand Down
16 changes: 16 additions & 0 deletions src/widgets/Icons/EditPublish.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { FC } from 'react'

const EditPublish: FC = (props) => (
<svg
className="icon"
viewBox="0 0 1024 1024"
xmlns="http://www.w3.org/2000/svg"
width={200}
height={200}
{...props}
>
<path d="m840.533 132.267-691.2 401.066c-25.6 17.067-25.6 51.2 4.267 64L311.467 665.6 742.4 285.867c8.533-8.534 21.333 4.266 12.8 12.8L392.533 738.133V857.6c0 34.133 42.667 51.2 64 25.6L550.4 768l187.733 76.8c21.334 8.533 46.934-4.267 51.2-25.6L896 170.667c4.267-29.867-29.867-51.2-55.467-38.4z" />
</svg>
)

export default EditPublish
4 changes: 2 additions & 2 deletions src/widgets/PostItem/DesktopView/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { EVENT } from '@/constant'

import { send } from '@/utils/helper'

import AvatarsRow from '@/widgets/AvatarsRow'
import AvatarsGroup from '@/widgets/AvatarsGroup'
// import TagsList from '@/widgets/TagsList'

import {
Expand Down Expand Up @@ -39,7 +39,7 @@ const Header: FC<TProps> = ({ item }) => {
<TagsList items={item.articleTags} left={12} />
</Brief>
<AvatarsWrapper>
<AvatarsRow
<AvatarsGroup
users={item.commentsParticipants}
total={item.commentsCount}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/Tooltip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export type TProps = {
noPadding?: boolean
showArrow?: boolean
behavior?: 'default' | 'confirm' | 'delete-confirm' | 'add'
// currently only for AvatarsRow, it will collapse the height
// currently only for AvatarsGroup, it will collapse the height
// for same reason, figure out later
contentHeight?: string

Expand Down
4 changes: 2 additions & 2 deletions src/widgets/Upvote/DefaultLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type { TUser } from '@/spec'
import { buildLog } from '@/utils/logger'

import { Space } from '@/widgets/Common'
import AvatarsRow from '@/widgets/AvatarsRow'
import AvatarsGroup from '@/widgets/AvatarsGroup'

import UpvoteBtn from './UpvoteBtn'
import Desc from './Desc'
Expand Down Expand Up @@ -61,7 +61,7 @@ const Upvote: FC<TProps> = ({
<Count noOne={noOne}>{count}</Count>
{!noOne && <LineDivider />}
{!noOne && !isMobile && (
<AvatarsRow users={avatarList} showMore={false} />
<AvatarsGroup users={avatarList} showMore={false} />
)}
{!noOne && (
<Desc
Expand Down
4 changes: 2 additions & 2 deletions src/widgets/Upvote/KanbanLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type { TUser } from '@/spec'
import { buildLog } from '@/utils/logger'

import { Space } from '@/widgets/Common'
import AvatarsRow from '@/widgets/AvatarsRow'
import AvatarsGroup from '@/widgets/AvatarsGroup'

import UpvoteBtn from './UpvoteBtn'

Expand Down Expand Up @@ -59,7 +59,7 @@ const Upvote: FC<TProps> = ({
<Space right={3} />
<Count noOne={noOne}>{count}</Count>
{!noOne && <LineDivider />}
{!noOne && !isMobile && <AvatarsRow users={avatarList} showMore />}
{!noOne && !isMobile && <AvatarsGroup users={avatarList} showMore />}
</Wrapper>
)
}
Expand Down
4 changes: 2 additions & 2 deletions src/widgets/Upvote/StickerLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { buildLog } from '@/utils/logger'

import { UPVOTE_LAYOUT } from '@/constant'
import AnimatedCount from '@/widgets/AnimatedCount'
import AvatarsRow from '@/widgets/AvatarsRow'
import AvatarsGroup from '@/widgets/AvatarsGroup'

import UpvoteBtn from './UpvoteBtn'
import {
Expand Down Expand Up @@ -54,7 +54,7 @@ const Upvote: FC<TProps> = ({
</CountWrapper>

<AvatarsWrapper count={count}>
<AvatarsRow users={avatarList} showMore={false} limit={3} />
<AvatarsGroup users={avatarList} showMore={false} limit={3} />
</AvatarsWrapper>
</Wrapper>
)
Expand Down
4 changes: 2 additions & 2 deletions src/widgets/Upvote/WorksArticleLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type { TUser } from '@/spec'
import { buildLog } from '@/utils/logger'
import { SIZE, UPVOTE_LAYOUT } from '@/constant'

import AvatarsRow from '@/widgets/AvatarsRow'
import AvatarsGroup from '@/widgets/AvatarsGroup'
import AnimatedCount from '@/widgets/AnimatedCount'

import Desc from './Desc'
Expand Down Expand Up @@ -69,7 +69,7 @@ const Upvote: FC<TProps> = ({
<DescWrapper>
{!noOne && (
<Avatars>
<AvatarsRow
<AvatarsGroup
users={avatarList}
showMore={false}
limit={7}
Expand Down
1 change: 1 addition & 0 deletions src/widgets/Upvote/styles/post_list_layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const Wrapper = styled.div.attrs(({ testid }: TTestable) => ({
`
export const UpWrapper = styled.div`
margin-left: 7px;
transform: scale(0.95);
`
export const CountWrapper = styled.div`
margin-top: -6px;
Expand Down
2 changes: 1 addition & 1 deletion utils/themes/skins/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const github = {
main: '#7DC0C5',
bodyBg: contentBg,
selectionBg: '#FFFEDE',
textBadge: '#f5f5f5',
textBadge: '#f6f6f6',

gtdBadge: {
feat: '#3871e0',
Expand Down