Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commita4ba049

Browse files
committed
chore: Merge branch 'tooltip' into dev
2 parentsb34bfe6 +301e7fe commita4ba049

File tree

4 files changed

+24
-28
lines changed

4 files changed

+24
-28
lines changed

‎components/Tooltip/styles/index.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ export const Wrapper = styled(Tippy)`
1616
}
1717
&[x-placement^='bottom'] {
1818
.tippy-arrow {
19-
border-top-color:${theme('tooltip.bg')};
19+
border-bottom-color:${theme('tooltip.bg')};
2020
}
2121
}
2222
&[x-placement^='left'] {
2323
.tippy-arrow {
24-
border-top-color:${theme('tooltip.bg')};
24+
border-left-color:${theme('tooltip.bg')};
2525
}
2626
}
2727
&[x-placement^='right'] {
2828
.tippy-arrow {
29-
border-top-color:${theme('tooltip.bg')};
29+
border-right-color:${theme('tooltip.bg')};
3030
}
3131
}
3232
`

‎components/UserBrief/SocialIcons.js‎

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
importReactfrom'react'
22
importRfrom'ramda'
3-
importReactTooltipfrom'react-tooltip'
43

54
import{ICON_CMD}from'@config'
6-
75
import{nilOrEmpty,SOCIAL_LISTS}from'@utils'
8-
import{Wrapper,Linker,SocialIcon}from'./styles/social_icons'
96

10-
consttooltipOffset=JSON.stringify({left:3})
7+
importTooltipfrom'@components/Tooltip'
8+
import{Wrapper,Linker,SocialIcon}from'./styles/social_icons'
119

1210
constDisplayIcon=({ user, social})=>{
1311
if(user[social.key]&&!R.contains(social.key,['qq','weichat'])){
@@ -25,17 +23,18 @@ const DisplayIcon = ({ user, social }) => {
2523
)
2624
}
2725
return(
28-
<div
26+
<Tooltip
2927
key={social.key}
30-
data-tip={user.social[social.key]}
31-
data-for="social_icons"
32-
data-offset={tooltipOffset}
28+
content={user.social[social.key]}
29+
placement="bottom"
3330
>
34-
<SocialIcon
35-
src={`${ICON_CMD}/${social.key}.svg`}
36-
active={!nilOrEmpty(user.social[social.key])}
37-
/>
38-
</div>
31+
<div>
32+
<SocialIcon
33+
src={`${ICON_CMD}/${social.key}.svg`}
34+
active={!nilOrEmpty(user.social[social.key])}
35+
/>
36+
</div>
37+
</Tooltip>
3938
)
4039
}
4140

@@ -44,7 +43,6 @@ const SocialIcons = ({ user }) => (
4443
{SOCIAL_LISTS.map(social=>(
4544
<DisplayIconkey={social.key}user={user}social={social}/>
4645
))}
47-
<ReactTooltipeffect="solid"place="bottom"id="social_icons"/>
4846
</Wrapper>
4947
)
5048

‎containers/AccountViewer/Planets.js‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
importReactfrom'react'
2-
importReactTooltipfrom'react-tooltip'
32
importRfrom'ramda'
43

54
import{sortByIndex}from'@utils'
5+
importTooltipfrom'@components/Tooltip'
6+
67
import{
78
Wrapper,
89
HeaderWrapper,
@@ -12,7 +13,6 @@ import {
1213
PlanetsIcon,
1314
}from'./styles/planets'
1415

15-
consttooltipOffset=JSON.stringify({top:10,left:5})
1616
constPlanets=({ subscribedCommunities, viewingType})=>{
1717
if(!subscribedCommunities)returnnull
1818

@@ -38,17 +38,17 @@ const Planets = ({ subscribedCommunities, viewingType }) => {
3838
</HeaderWrapper>
3939
<IconList>
4040
{sortedCommunities.map(community=>(
41-
<div
41+
<Tooltip
4242
key={community.raw}
43-
data-tip={community.title}
44-
data-for="planet_icon"
45-
data-offset={tooltipOffset}
43+
content={community.title}
44+
placement="top"
4645
>
47-
<PlanetsIconsrc={community.logo}/>
48-
</div>
46+
<div>
47+
<PlanetsIconsrc={community.logo}/>
48+
</div>
49+
</Tooltip>
4950
))}
5051
</IconList>
51-
<ReactTooltipeffect="solid"place="bottom"id="planet_icon"/>
5252
</Wrapper>
5353
)
5454
}

‎containers/AccountViewer/index.js‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
importReactfrom'react'
88
importRfrom'ramda'
9-
importReactTooltipfrom'react-tooltip'
109

1110
import{connectStore,buildLog}from'@utils'
1211

@@ -41,7 +40,6 @@ const AccountViewerContainer = ({ accountViewer, user }) => {
4140
<AccountWrapper>
4241
{!R.isEmpty(userInfoData.id)&&(
4342
<React.Fragment>
44-
<ReactTooltipeffect="solid"place="bottom"/>
4543
<AccountContent>
4644
<UserBrief
4745
user={userInfoData}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp