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(footer): better naming for different layout & re-org#1105
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
3 changes: 3 additions & 0 deletionsconfig/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
45 changes: 45 additions & 0 deletionssrc/components/BlinkCursor/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,45 @@ | ||
/* | ||
* | ||
* BlinkCursor | ||
* | ||
*/ | ||
import { FC, memo } from 'react' | ||
import { buildLog } from '@/utils' | ||
import { Wrapper } from './styles' | ||
/* eslint-disable-next-line */ | ||
const log = buildLog('c:BlinkCursor:index') | ||
type TProps = { | ||
testid?: string | ||
height?: number | ||
top?: number | ||
left?: number | ||
right?: number | ||
duration?: number | ||
} | ||
const BlinkCursor: FC<TProps> = ({ | ||
testid = 'blink-cursor', | ||
height = 12, | ||
top = 2, | ||
left = 10, | ||
right = 10, | ||
duration = 2, | ||
}) => { | ||
return ( | ||
<Wrapper | ||
testid={testid} | ||
height={height} | ||
top={top} | ||
left={left} | ||
right={right} | ||
duration={duration} | ||
/> | ||
) | ||
} | ||
export default memo(BlinkCursor) |
35 changes: 35 additions & 0 deletionssrc/components/BlinkCursor/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import styled from 'styled-components' | ||
import type { TTestable } from '@/spec' | ||
// import Img from '@/Img' | ||
import { animate } from '@/utils' | ||
export type TWrapper = TTestable & { | ||
height: number | ||
top: number | ||
left: number | ||
right: number | ||
duration: number | ||
} | ||
export const Wrapper = styled.div.attrs(({ testid }: TTestable) => ({ | ||
'data-test-id': testid, | ||
}))<TWrapper>` | ||
background-color: #139c9e; | ||
height: ${({ height }) => `${height}px`}; | ||
margin-top: ${({ top }) => `${top}px`}; | ||
margin-left: ${({ left }) => `${left}px`}; | ||
margin-right: ${({ right }) => `${right}px`}; | ||
width: 1px; | ||
opacity: 1; | ||
animation: ${animate.blink} 2s linear infinite alternate; | ||
animation-duration: ${({ duration }) => `${duration}s`}; | ||
` | ||
export const Title = styled.div`` |
10 changes: 10 additions & 0 deletionssrc/components/BlinkCursor/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 BlinkCursor from '../index' | ||
describe('TODO <BlinkCursor />', () => { | ||
it('Expect to have unit tests specified', () => { | ||
expect(true).toEqual(true) | ||
}) | ||
}) |
9 changes: 2 additions & 7 deletionssrc/components/CommunityFaceLogo/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
10 changes: 8 additions & 2 deletionssrc/components/Navigator/DigestView.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
10 changes: 0 additions & 10 deletionssrc/components/Navigator/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
11 changes: 1 addition & 10 deletionssrc/containers/unit/Footer/SocialList.tsx → src/containers/unit/Footer/ContactList.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
11 changes: 5 additions & 6 deletions...ers/unit/Footer/DesktopView/BriefView.tsx → ...s/unit/Footer/DesktopView/ArticleView.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
5 changes: 0 additions & 5 deletionssrc/containers/unit/Footer/DesktopView/BottomInfo.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
84 changes: 84 additions & 0 deletionssrc/containers/unit/Footer/DesktopView/CommunityView.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,84 @@ | ||
import { FC, memo } from 'react' | ||
import type { TArticle, TC11NLayout } from '@/spec' | ||
import { ISSUE_ADDR, API_SERVER_ADDR } from '@/config' | ||
import TopInfo from './TopInfo' | ||
import BottomInfo from './BottomInfo' | ||
import { VIEW } from '../constants' | ||
import { | ||
Wrapper, | ||
InnerWrapper, | ||
MainInfos, | ||
BaseInfo, | ||
Item, | ||
} from '../styles/desktop_view/community_view' | ||
type TProps = { | ||
viewingArticle: TArticle | ||
metric: string | ||
layout: TC11NLayout | ||
} | ||
const CommunityView: FC<TProps> = ({ metric, layout }) => { | ||
return ( | ||
<Wrapper metric={metric} layout={layout}> | ||
<InnerWrapper> | ||
<TopInfo type={VIEW.COMMUNITY} title="javascript" noBottomBorder /> | ||
<MainInfos> | ||
<BaseInfo> | ||
<Item href="/home/post/1" rel="noopener noreferrer" target="_blank"> | ||
关于 | ||
</Item> | ||
<Item | ||
href="/cps-support/posts" | ||
rel="noopener noreferrer" | ||
target="_blank" | ||
> | ||
创建社区 | ||
</Item> | ||
<Item | ||
href="/cps-support/posts" | ||
rel="noopener noreferrer" | ||
target="_blank" | ||
> | ||
加入我们 | ||
</Item> | ||
<Item | ||
href={`${API_SERVER_ADDR}`} | ||
rel="noopener noreferrer" | ||
target="_blank" | ||
> | ||
OpenSource | ||
</Item> | ||
<Item | ||
href={`${API_SERVER_ADDR}`} | ||
rel="noopener noreferrer" | ||
target="_blank" | ||
> | ||
特别感谢 | ||
</Item> | ||
<Item | ||
href={`${ISSUE_ADDR}`} | ||
rel="noopener noreferrer" | ||
target="_blank" | ||
> | ||
反馈与建议 | ||
</Item> | ||
<Item | ||
href={`${ISSUE_ADDR}`} | ||
rel="noopener noreferrer" | ||
target="_blank" | ||
> | ||
开放数据 | ||
</Item> | ||
</BaseInfo> | ||
</MainInfos> | ||
</InnerWrapper> | ||
<BottomInfo metric={metric} /> | ||
</Wrapper> | ||
) | ||
} | ||
export default memo(CommunityView) |
12 changes: 6 additions & 6 deletions...t/Footer/DesktopView/DigestView/index.tsx → ...ners/unit/Footer/DesktopView/HomeView.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
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
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.