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

Commit dd51b54

Browse files
authored
refactor(js-css): rename cutFrom -> cutRest (#1036)
1 parent 341232e commit dd51b54

File tree

75 files changed

+130
-130
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+130
-130
lines changed

src/components/Buttons/DropdownButton/OptionPanel.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react'
22
import T from 'prop-types'
33

44
import { ICON } from '@/config'
5-
import { cutFrom } from '@/utils'
5+
import { cutRest } from '@/utils'
66

77
import {
88
Wrapper,
@@ -56,7 +56,7 @@ const OptionPanel = ({ options, onClick, panelMinWidth }) => {
5656
<Title>{item.title}</Title>
5757
{item.link && <LinkIcon src={`${ICON}/shape/link-hint.svg`} />}
5858
</Header>
59-
<Desc>{cutFrom(item.desc, 26)}</Desc>
59+
<Desc>{cutRest(item.desc, 26)}</Desc>
6060
</Intro>
6161
</OptionBlock>
6262
))}

src/components/Buttons/styles/dropdown_button/option_panel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const Header = styled.div`
5858
color: ${theme('thread.articleTitle')};
5959
`
6060
export const Title = styled.div`
61-
${css.cutFrom('90%')};
61+
${css.cutRest('90%')};
6262
font-size: 14px;
6363
`
6464
export const LinkIcon = styled(Img)`

src/components/CollapseMenu/styles/group.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const Title = styled.div`
3232
margin-left: 4px;
3333
font-size: 14px;
3434
margin-right: 8px;
35-
${css.cutFrom('85px')};
35+
${css.cutRest('85px')};
3636
3737
${Header}:hover & {
3838
opacity: 0.65;

src/components/CollapseMenu/styles/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const Title = styled.div`
3232
margin-left: 4px;
3333
font-size: 14px;
3434
margin-right: 8px;
35-
${css.cutFrom('85px')};
35+
${css.cutRest('85px')};
3636
3737
${Header}:hover & {
3838
opacity: 0.65;

src/components/CollapseMenu/styles/item.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const Wrapper = styled.div<TActive>`
1515
`
1616
export const Title = styled.div<TActive>`
1717
color: ${theme('tags.text')};
18-
${css.cutFrom('200px')};
18+
${css.cutRest('200px')};
1919
font-size: 14px;
2020
opacity: 0.9;
2121
font-weight: ${({ active }) => (active ? 'bold' : 'normal')};

src/components/ContentBanner/styles/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const Title = styled.div`
3636
font-size: 1.5em;
3737
color: ${theme('thread.articleTitle')};
3838
39-
${css.cutFrom('100%')};
39+
${css.cutRest('100%')};
4040
`
4141
export const Desc = styled.div`
4242
${css.flex('align-center')};

src/components/DiscussLinker/styles/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export const GithubIcon = styled(Img)`
5555

5656
export const IssueLink = styled.a`
5757
color: ${theme('banner.title')};
58-
${css.cutFrom('230px')};
58+
${css.cutRest('230px')};
5959
6060
transition: color 0.2s;
6161
&:hover {

src/components/FeedsBar/styles/source_selector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const Icon = styled(Img)`
3030
${css.circle(34)};
3131
`
3232
export const Title = styled.div`
33-
${css.cutFrom('60px')};
33+
${css.cutRest('60px')};
3434
text-align: center;
3535
padding-left: 5px;
3636
color: ${theme('thread.articleDigest')};

src/components/GalleryHub/PeopleGallery/DeveloperGallery.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import React from 'react'
88
import T from 'prop-types'
99

1010
import { ICON, ASSETS_ENDPOINT } from '@/config'
11-
import { buildLog, cutFrom } from '@/utils'
11+
import { buildLog, cutRest } from '@/utils'
1212

1313
import IconText from '@/components/IconText'
1414
import CardHeader from './CardHeader'
@@ -83,8 +83,8 @@ const DeveloperGallery = ({ items }) => {
8383
<Body>
8484
<Avatar src={item.icon} />
8585
<Intro>
86-
<Title>{cutFrom(item.title, 18)}</Title>
87-
<Digest>{cutFrom(item.desc, 35)}</Digest>
86+
<Title>{cutRest(item.title, 18)}</Title>
87+
<Digest>{cutRest(item.desc, 35)}</Digest>
8888
</Intro>
8989
<SocialWrapper>social list</SocialWrapper>
9090
</Body>

src/components/GalleryHub/PeopleGallery/FamePeopleGallery.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import React from 'react'
88
import T from 'prop-types'
99

1010
import { ICON } from '@/config'
11-
import { buildLog, cutFrom } from '@/utils'
11+
import { buildLog, cutRest } from '@/utils'
1212

1313
import IconText from '@/components/IconText'
1414
import CardHeader from './CardHeader'
@@ -85,7 +85,7 @@ const FamePeopleList = ({ items }) => {
8585
</Intro>
8686
</Body>
8787

88-
<Digest>{cutFrom(item.desc, 50)}</Digest>
88+
<Digest>{cutRest(item.desc, 50)}</Digest>
8989

9090
<Footer>
9191
<IconText iconSrc={`${ICON}/article/heart-solid.svg`}>22</IconText>

0 commit comments

Comments
 (0)