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/components/Buttons/DropdownButton/OptionPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import T from 'prop-types'

import { ICON } from '@/config'
import { cutFrom } from '@/utils'
import { cutRest } from '@/utils'

import {
Wrapper,
Expand Down Expand Up @@ -56,7 +56,7 @@ const OptionPanel = ({ options, onClick, panelMinWidth }) => {
<Title>{item.title}</Title>
{item.link && <LinkIcon src={`${ICON}/shape/link-hint.svg`} />}
</Header>
<Desc>{cutFrom(item.desc, 26)}</Desc>
<Desc>{cutRest(item.desc, 26)}</Desc>
</Intro>
</OptionBlock>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const Header = styled.div`
color: ${theme('thread.articleTitle')};
`
export const Title = styled.div`
${css.cutFrom('90%')};
${css.cutRest('90%')};
font-size: 14px;
`
export const LinkIcon = styled(Img)`
Expand Down
2 changes: 1 addition & 1 deletion src/components/CollapseMenu/styles/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const Title = styled.div`
margin-left: 4px;
font-size: 14px;
margin-right: 8px;
${css.cutFrom('85px')};
${css.cutRest('85px')};

${Header}:hover & {
opacity: 0.65;
Expand Down
2 changes: 1 addition & 1 deletion src/components/CollapseMenu/styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const Title = styled.div`
margin-left: 4px;
font-size: 14px;
margin-right: 8px;
${css.cutFrom('85px')};
${css.cutRest('85px')};

${Header}:hover & {
opacity: 0.65;
Expand Down
2 changes: 1 addition & 1 deletion src/components/CollapseMenu/styles/item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const Wrapper = styled.div<TActive>`
`
export const Title = styled.div<TActive>`
color: ${theme('tags.text')};
${css.cutFrom('200px')};
${css.cutRest('200px')};
font-size: 14px;
opacity: 0.9;
font-weight: ${({ active }) => (active ? 'bold' : 'normal')};
Expand Down
2 changes: 1 addition & 1 deletion src/components/ContentBanner/styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const Title = styled.div`
font-size: 1.5em;
color: ${theme('thread.articleTitle')};

${css.cutFrom('100%')};
${css.cutRest('100%')};
`
export const Desc = styled.div`
${css.flex('align-center')};
Expand Down
2 changes: 1 addition & 1 deletion src/components/DiscussLinker/styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const GithubIcon = styled(Img)`

export const IssueLink = styled.a`
color: ${theme('banner.title')};
${css.cutFrom('230px')};
${css.cutRest('230px')};

transition: color 0.2s;
&:hover {
Expand Down
2 changes: 1 addition & 1 deletion src/components/FeedsBar/styles/source_selector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const Icon = styled(Img)`
${css.circle(34)};
`
export const Title = styled.div`
${css.cutFrom('60px')};
${css.cutRest('60px')};
text-align: center;
padding-left: 5px;
color: ${theme('thread.articleDigest')};
Expand Down
6 changes: 3 additions & 3 deletions src/components/GalleryHub/PeopleGallery/DeveloperGallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import React from 'react'
import T from 'prop-types'

import { ICON, ASSETS_ENDPOINT } from '@/config'
import { buildLog, cutFrom } from '@/utils'
import { buildLog, cutRest } from '@/utils'

import IconText from '@/components/IconText'
import CardHeader from './CardHeader'
Expand Down Expand Up @@ -83,8 +83,8 @@ const DeveloperGallery = ({ items }) => {
<Body>
<Avatar src={item.icon} />
<Intro>
<Title>{cutFrom(item.title, 18)}</Title>
<Digest>{cutFrom(item.desc, 35)}</Digest>
<Title>{cutRest(item.title, 18)}</Title>
<Digest>{cutRest(item.desc, 35)}</Digest>
</Intro>
<SocialWrapper>social list</SocialWrapper>
</Body>
Expand Down
4 changes: 2 additions & 2 deletions src/components/GalleryHub/PeopleGallery/FamePeopleGallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import React from 'react'
import T from 'prop-types'

import { ICON } from '@/config'
import { buildLog, cutFrom } from '@/utils'
import { buildLog, cutRest } from '@/utils'

import IconText from '@/components/IconText'
import CardHeader from './CardHeader'
Expand Down Expand Up @@ -85,7 +85,7 @@ const FamePeopleList = ({ items }) => {
</Intro>
</Body>

<Digest>{cutFrom(item.desc, 50)}</Digest>
<Digest>{cutRest(item.desc, 50)}</Digest>

<Footer>
<IconText iconSrc={`${ICON}/article/heart-solid.svg`}>22</IconText>
Expand Down
4 changes: 2 additions & 2 deletions src/components/GalleryHub/ProductGallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import T from 'prop-types'
import { isEmpty } from 'ramda'

import { ICON } from '@/config'
import { buildLog, cutFrom } from '@/utils'
import { buildLog, cutRest } from '@/utils'

import { ArrowButton } from '@/components/Buttons'

Expand Down Expand Up @@ -142,7 +142,7 @@ const ProductGallery = ({ items }) => {
</IntroHead>
</Header>

{item.desc && <Desc>{cutFrom(item.desc, 50)}</Desc>}
{item.desc && <Desc>{cutRest(item.desc, 50)}</Desc>}
{!item.desc && !isEmpty(item.tags) && (
<InlineTags items={item.tags} />
)}
Expand Down
4 changes: 2 additions & 2 deletions src/components/GalleryHub/SponsorGallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import React from 'react'
import T from 'prop-types'

import { ASSETS_ENDPOINT } from '@/config'
import { buildLog, cutFrom } from '@/utils'
import { buildLog, cutRest } from '@/utils'

import { ArrowButton } from '@/components/Buttons'

Expand Down Expand Up @@ -137,7 +137,7 @@ const SponsorGallery = ({ items, column }) => {
<IntroImg src={`${ASSETS_ENDPOINT}/works/market1.jpeg`} />
)}
{item.desc && (
<Desc level={item.level}>{cutFrom(item.desc, 30)}</Desc>
<Desc level={item.level}>{cutRest(item.desc, 30)}</Desc>
)}
<LinkWrapper>
<ArrowButton size="tiny">{item.addr}</ArrowButton>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const Title = styled.div`
color: ${theme('thread.articleTitle')};
font-size: 18px;
cursor: pointer;
${css.cutFrom('200px')};
${css.cutRest('200px')};
`
export const AKA = styled.div`
color: ${theme('thread.articleDigest')};
Expand Down
4 changes: 2 additions & 2 deletions src/components/GithubRepoPage/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'

import { ICON_CMD } from '@/config'

import { numberWithCommas, cutFrom } from '@/utils'
import { numberWithCommas, cutRest } from '@/utils'
import Tooltip from '@/components/Tooltip'

import {
Expand Down Expand Up @@ -33,7 +33,7 @@ const TitlesInfo = ({ repo }) => (
</TitleLink>
<Slash>/</Slash>
<TitleLink href={repo.repoUrl} rel="noopener noreferrer" target="_blank">
{cutFrom(repo.title, 20)}
{cutRest(repo.title, 20)}
</TitleLink>{' '}
</TitlesWrapper>
)
Expand Down
4 changes: 2 additions & 2 deletions src/components/JobItem/CompanyInfo.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { isEmpty } from 'ramda'

import { cutFrom } from '@/utils'
import { cutRest } from '@/utils'
import {
Wrapper,
TopHalf,
Expand All @@ -24,7 +24,7 @@ const CompanyInfo = ({
<TopHalf>
<BaseInfo>
<Header>
<Title>{cutFrom(company, 12)}</Title>
<Title>{cutRest(company, 12)}</Title>
</Header>
<Middle>
<StatesWrapper>
Expand Down
4 changes: 2 additions & 2 deletions src/components/JobItem/JobInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import TimeAgo from 'timeago-react'

import { HCN } from '@/constant'
import { cutFrom } from '@/utils'
import { cutRest } from '@/utils'
import InlineCommunities from '@/components/InlineCommunities'
import InlineTags from '@/components/InlineTags'
import DotDivider from '@/components/DotDivider'
Expand Down Expand Up @@ -44,7 +44,7 @@ const JobInfo = ({
}) => (
<Wrapper>
<Header>
<Title onClick={onPreview}>{cutFrom(title, 30)}</Title>
<Title onClick={onPreview}>{cutRest(title, 30)}</Title>
<CommunitiesWrapper>
<InlineCommunities data={communities} show={community === HCN} />
</CommunitiesWrapper>
Expand Down
4 changes: 2 additions & 2 deletions src/components/JobItem/ListView.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import TimeAgo from 'timeago-react'

import { ICON_CMD } from '@/config'
import { cutFrom, parseDomain } from '@/utils'
import { cutRest, parseDomain } from '@/utils'
import InlineTags from '@/components/InlineTags'
import DotDivider from '@/components/DotDivider'

Expand Down Expand Up @@ -32,7 +32,7 @@ const ListView = ({ entry, onPreview }) => (
<TopHalf>
<Brief onClick={() => onPreview(entry)}>
<Title>
【 {entry.company} 】{cutFrom(entry.title, 45)}
【 {entry.company} 】{cutRest(entry.title, 45)}
</Title>
{entry.linkAddr && (
<TitleLink>
Expand Down
4 changes: 2 additions & 2 deletions src/components/JobItem/styles/company_info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ export const Footer = styled.div`
font-size: 0.8rem;
color: ${theme('thread.articleDigest')};
${css.media.mobile`
${css.cutFrom('100px')};
${css.cutRest('100px')};
`};
`
export const Title = styled.div`
color: ${theme('thread.articleTitle')};
font-size: 0.9rem;
${css.media.mobile`
${css.cutFrom('90px')};
${css.cutRest('90px')};
`};
`
export const StatesWrapper = styled.div`
Expand Down
2 changes: 1 addition & 1 deletion src/components/JobItem/styles/job_info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const Title = styled.div`
color: ${theme('thread.articleTitle')};
font-size: 1rem;
${css.media.mobile`
${css.cutFrom('150px')};
${css.cutRest('150px')};
`};
`
export const CommunitiesWrapper = styled.div`
Expand Down
2 changes: 1 addition & 1 deletion src/components/LinksCard/styles/item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const Wrapper = styled.div`
`
export const Title = styled.div`
/* ${css.flex('align-center')}; */
${css.cutFrom('200px')};
${css.cutRest('200px')};
color: ${theme('banner.desc')};

${Wrapper}:hover & {
Expand Down
2 changes: 1 addition & 1 deletion src/components/LoadingEffects/styles/community_holder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ export const CommunitiesText = styled.div`
margin-bottom: 8px;
`
export const BannerText = styled.div`
${css.cutFrom('45px')};
${css.cutRest('45px')};
text-align: center;
`
2 changes: 1 addition & 1 deletion src/components/Navigator/styles/brief_view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const CommunityTitle = styled.div`
font-weight: bold;
margin-top: -2px;

${css.cutFrom('90px')};
${css.cutRest('90px')};
`
export const Breadcrumbs = styled.div`
${css.flex('align-center')};
Expand Down
2 changes: 1 addition & 1 deletion src/components/Navigator/styles/more_panel/mobile_view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const Title = styled.div`
`
export const Desc = styled.div`
color: ${theme('thread.articleDigest')};
${css.cutFrom('100px')};
${css.cutRest('100px')};
font-size: 11px;
margin-top: 2px;
`
Expand Down
4 changes: 2 additions & 2 deletions src/components/PostItem/DigestView/DesktopView/Body.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import TimeAgo from 'timeago-react'

import { ICON } from '@/config'
import { cutFrom } from '@/utils'
import { cutRest } from '@/utils'

import Tooltip from '@/components/Tooltip'
import { SpaceGrow } from '@/components/Common'
Expand Down Expand Up @@ -48,7 +48,7 @@ const Body = ({ item, onPreview }) => {
</Extra>

<DigestSentence top={5} right={140} onPreview={() => onPreview(item)}>
{cutFrom(item.digest, 90)}
{cutRest(item.digest, 90)}
</DigestSentence>
</Wrapper>
)
Expand Down
4 changes: 2 additions & 2 deletions src/components/PostItem/DigestView/MobileView/Footer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'

import { cutFrom } from '@/utils'
import { cutRest } from '@/utils'
import { ICON_CMD } from '@/config'

import DotDivider from '@/components/DotDivider'
Expand Down Expand Up @@ -28,7 +28,7 @@ const Footer = ({ item }) => {
{item.commentsCount}
</ExtraTexts>
</Extra>
<BodyDigest>{cutFrom(item.digest, 20)}</BodyDigest>
<BodyDigest>{cutRest(item.digest, 20)}</BodyDigest>
</Wrapper>
)
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/PostItem/ListView.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import TimeAgo from 'timeago-react'

import { ICON_CMD } from '@/config'

import { cutFrom, parseDomain } from '@/utils'
import { cutRest, parseDomain } from '@/utils'
import InlineTags from '@/components/InlineTags'

import {
Expand All @@ -27,7 +27,7 @@ const ListView = ({ entry, onPreview }) => (
<Main>
<TopHalf>
<Brief onClick={() => onPreview(entry)}>
<Title>{cutFrom(entry.title, 45)}</Title>
<Title>{cutRest(entry.title, 45)}</Title>
{entry.linkAddr && (
<TitleLink>
<LinkIcon src={`${ICON_CMD}/link.svg`} />
Expand Down
2 changes: 1 addition & 1 deletion src/components/PostItem/styles/list_view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const BodyDigest = styled.li`
max-width: 85%;

${css.media.mobile`
${css.cutFrom('250px')};
${css.cutRest('250px')};
`};
`
export const CommentWrapper = styled.div`
Expand Down
4 changes: 2 additions & 2 deletions src/components/RepoItem/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'

import { ICON_CMD } from '@/config'

import { cutFrom, numberWithCommas } from '@/utils'
import { cutRest, numberWithCommas } from '@/utils'
import Tooltip from '@/components/Tooltip'
import { Space } from '@/components/Common'
import InlineTags from '@/components/InlineTags'
Expand Down Expand Up @@ -34,7 +34,7 @@ const Header = ({ entry, onPreview }) => {
<LangDot color={entry.primaryLanguage.color} />
</Tooltip>
<Owner>{entry.ownerName}</Owner>
<RepoName> / {cutFrom(entry.title, 20)}</RepoName>
<RepoName> / {cutRest(entry.title, 20)}</RepoName>
<TagsWrapper>
<InlineTags data={entry.tags} />
</TagsWrapper>
Expand Down
4 changes: 2 additions & 2 deletions src/components/RepoItem/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import React from 'react'
import T from 'prop-types'

import { buildLog, cutFrom } from '@/utils'
import { buildLog, cutRest } from '@/utils'
import { C11N } from '@/constant'

import ArticleItemPrefixLabel from '@/components/ArticleItemPrefixLabel'
Expand All @@ -28,7 +28,7 @@ const RepoItem = ({ entry, active, onPreview, accountInfo }) => (
topOffset="22px"
/>
<Header entry={entry} onPreview={() => onPreview(entry)} />
<BodyDigest>{cutFrom(entry.desc, 180)}</BodyDigest>
<BodyDigest>{cutRest(entry.desc, 180)}</BodyDigest>
<Footer
contributors={entry.contributors}
author={entry.author}
Expand Down
Loading