Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit 69a7d1b

Browse files
committed
style: adjust digest & badge hint
1 parent a9b7187 commit 69a7d1b

File tree

7 files changed

+49
-30
lines changed

7 files changed

+49
-30
lines changed

src/components/AvatarsRow/RealAvatar.tsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,13 @@ type TProps = {
2222

2323
const RealAvatar: FC<TProps> = ({ user, size, onUserSelect }) => {
2424
return (
25-
<Tooltip
26-
content={<UserPopContent>{user.nickname}</UserPopContent>}
27-
delay={0}
28-
contentHeight={getAvatarSize(size, 'number') as string}
29-
showArrow={false}
30-
noPadding
31-
>
32-
<Wrapper key={user.id} size={size}>
25+
<Wrapper size={size}>
26+
<Tooltip
27+
content={<UserPopContent>{user.nickname}</UserPopContent>}
28+
delay={0}
29+
contentHeight={getAvatarSize(size, 'number') as string}
30+
noPadding
31+
>
3332
<AvatarsImg
3433
src={user.avatar}
3534
size={size}
@@ -42,8 +41,8 @@ const RealAvatar: FC<TProps> = ({ user, size, onUserSelect }) => {
4241
/>
4342
}
4443
/>
45-
</Wrapper>
46-
</Tooltip>
44+
</Tooltip>
45+
</Wrapper>
4746
)
4847
}
4948

src/components/AvatarsRow/styles/more_item.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const BaseAvatarItem = styled.li<{ size: string }>`
1111
padding: 0px 0px 0px 0px;
1212
position: relative;
1313
width: ${({ size }) => getAvatarSize(size)};
14-
opacity: 0.75;
14+
opacity: 1;
1515
z-index: 1;
1616
&:hover {
1717
opacity: 1;

src/components/DigestSentence/index.tsx

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import { Space } from '@/components/Common'
1515

1616
import {
1717
Wrapper,
18+
// Text,
19+
HintWrapper,
1820
MediaHintWrapper,
1921
HintIcon,
2022
HintText,
@@ -60,18 +62,20 @@ const DigestSentence: FC<TProps> = ({
6062
>
6163
{children}
6264
<Space left={8} />
63-
<MediaHintWrapper>
64-
<HintIcon src={`${ICON}/shape/image.svg`} />
65-
<HintText>3</HintText>
66-
</MediaHintWrapper>
67-
<MediaHintWrapper>
68-
<HintIcon src={`${ICON}/shape/video.svg`} />
69-
<HintText>1</HintText>
70-
</MediaHintWrapper>
71-
<PreviewWrapper>
72-
<PreviewText>预览</PreviewText>
73-
<ThunderIcon />
74-
</PreviewWrapper>
65+
<HintWrapper>
66+
<MediaHintWrapper>
67+
<HintIcon src={`${ICON}/shape/image.svg`} />
68+
<HintText>3</HintText>
69+
</MediaHintWrapper>
70+
<MediaHintWrapper>
71+
<HintIcon src={`${ICON}/shape/video.svg`} />
72+
<HintText>1</HintText>
73+
</MediaHintWrapper>
74+
<PreviewWrapper>
75+
<PreviewText>预览</PreviewText>
76+
<ThunderIcon />
77+
</PreviewWrapper>
78+
</HintWrapper>
7579
</Wrapper>
7680
)
7781
}

src/components/DigestSentence/styles/index.ts

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,23 @@ export const Wrapper = styled.div.attrs(({ testid }: TTestable) => ({
2828
2929
transition: color 0.2s;
3030
`
31+
// export const Text = styled.div`
32+
// display: -webkit-box;
33+
// -webkit-line-clamp: 2;
34+
// overflow: hidden;
35+
// text-overflow: ellipsis;
36+
// -webkit-box-orient: vertical;
37+
// border: 1px solid;
38+
39+
// &:after {
40+
// content: '';
41+
// margin-right: 20px;
42+
// }
43+
// `
44+
45+
export const HintWrapper = styled.div`
46+
display: inline;
47+
`
3148
export const MediaHintWrapper = styled.div`
3249
position: relative;
3350
margin-left: 5px;
@@ -48,17 +65,16 @@ export const HintText = styled.div`
4865
margin-right: 5px;
4966
padding-left: 17px;
5067
`
51-
5268
export const PreviewWrapper = styled.div`
5369
display: inline-flex;
5470
opacity: 0;
5571
margin-left: 8px;
5672
align-items: center;
5773
5874
${Wrapper}:hover & {
59-
opacity: 0.6;
75+
opacity: 0.8;
6076
}
61-
transition: opacity 0.25s;
77+
transition: opacity 0.2s;
6278
`
6379
export const PreviewIcon = styled(Img)`
6480
fill: ${theme('thread.extraInfo')};

src/components/DigestSentence/styles/metric.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import { SIZE } from '@/constant'
44
export const getFontSize = (size: TSIZE_SM): string => {
55
switch (size) {
66
case SIZE.MEDIUM: {
7-
return '14px'
7+
return '14.5px'
88
}
99

1010
default:
11-
return '13px'
11+
return '13.5px'
1212
}
1313
}
1414

src/components/PostItem/DigestView/DesktopView/Body.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const Body: FC<TProps> = ({ item }) => {
5252
right={140}
5353
onPreview={() => send(EVENT.PREVIEW_ARTICLE, { article: item })}
5454
>
55-
{cutRest(item.digest, 90)}
55+
{cutRest(`${item.digest}`, 70)}
5656
</DigestSentence>
5757
</Wrapper>
5858
)

src/components/PostItem/styles/digest_view/active_badge.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const Wrapper = styled.div<{ hasComments: boolean }>`
1010
position: absolute;
1111
top: 6px;
1212
right: 0;
13-
color: ${theme('thread.articleDigest')};
13+
color: ${theme('thread.articleTitle')};
1414
margin-right: 6px;
1515
margin-top: 8px;
1616

0 commit comments

Comments
 (0)