This repository was archived by the owner on Nov 8, 2022. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork37
refactor(thread): common articles card comp#1111
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
2 changes: 1 addition & 1 deletion...components/JobItem/DesktopView/Footer.tsx → src/components/ArticleCard/Footer.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion...components/JobItem/DesktopView/Header.tsx → src/components/ArticleCard/Header.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletionssrc/components/ArticleCard/index.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { FC, memo } from 'react' | ||
import type { TJob } from '@/spec' | ||
// import { THREAD } from '@/constant' | ||
import { cutRest } from '@/utils' | ||
import DigestSentence from '@/components/DigestSentence' | ||
import { Br, SpaceGrow } from '@/components/Common' | ||
import ArticleImgWindow from '@/components/ArticleImgWindow' | ||
import Header from './Header' | ||
import Footer from './Footer' | ||
import { Wrapper } from './styles' | ||
import { SIZE } from '@/constant' | ||
type TProps = { | ||
data: TJob | ||
// thread?: TThread | ||
} | ||
const fakeDigest = | ||
'网络监测数据显示,从 7 月 12 日开始古巴限制了社交媒体和消息应用,此举被认为旨在限制信息流动。古巴上周末爆发了罕见的大规模反政府抗议。受到干扰的通讯平台包括了 WhatsApp、Facebook、Instagram 和部分 Telegram 服务。VPN 服务可以绕过这一干扰。古巴的反政府抗议与经济困难,疫苗短缺等问题有关。' | ||
const ArticleCard: FC<TProps> = ({ data }) => { | ||
const { title, tags } = data | ||
return ( | ||
<Wrapper> | ||
<Header title={title} tags={tags} /> | ||
<Br top={15} /> | ||
<DigestSentence | ||
top={5} | ||
bottom={15} | ||
size={SIZE.MEDIUM} | ||
onPreview={() => console.log('send preview')} | ||
> | ||
{cutRest(fakeDigest, 150)} | ||
</DigestSentence> | ||
<Br top={4} /> | ||
<ArticleImgWindow /> | ||
<Br top={16} /> | ||
<SpaceGrow /> | ||
<Footer /> | ||
</Wrapper> | ||
) | ||
} | ||
export default memo(ArticleCard) |
1 change: 1 addition & 0 deletions...nts/JobItem/styles/desktop_view/footer.ts → src/components/ArticleCard/styles/footer.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletionssrc/components/ArticleCard/tests/index.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// import React from 'react' | ||
// import { shallow } from 'enzyme' | ||
// import ArticleCard from '../index' | ||
describe('TODO <ArticleCard />', () => { | ||
it('Expect to have unit tests specified', () => { | ||
expect(true).toEqual(true) | ||
}) | ||
}) |
5 changes: 5 additions & 0 deletionssrc/components/DigestSentence/index.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
9 changes: 6 additions & 3 deletionssrc/components/DigestSentence/styles/index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletionssrc/components/DigestSentence/styles/metric.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type { TSIZE_SM } from '@/spec' | ||
import { SIZE } from '@/constant' | ||
export const getFontSize = (size: TSIZE_SM): string => { | ||
switch (size) { | ||
case SIZE.MEDIUM: { | ||
return '14px' | ||
} | ||
default: | ||
return '13px' | ||
} | ||
} | ||
export const holder = 1 |
41 changes: 0 additions & 41 deletionssrc/components/JobItem/DesktopView/index.tsx
This file was deleted.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
6 changes: 2 additions & 4 deletionssrc/components/JobItem/index.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.