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

Commit 1da0473

Browse files
committed
refactor(article-thread): adjust article card based on thread
1 parent ebace36 commit 1da0473

File tree

10 files changed

+53
-21
lines changed

10 files changed

+53
-21
lines changed

src/components/ArticleImgWindow/styles/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const Wrapper = styled.div.attrs(({ testid }: TTestable) => ({
1313
export const Block = styled.div`
1414
width: 30%;
1515
height: 60px;
16-
background: #06303b;
16+
background: #002a34;
1717
margin-right: 10px;
1818
border-radius: 5px;
1919
`

src/components/JobItem/styles/index.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import styled from 'styled-components'
22

33
import type { TJob, TC11N } from '@/spec'
44
import css from '@/utils/css'
5+
import { theme } from '@/utils/themes'
56

67
import { getOpacity } from './metric'
78

@@ -13,8 +14,10 @@ export const Wrapper = styled.article<TWrapper>`
1314
margin-top: 10px;
1415
margin-bottom: 18px;
1516
margin-right: 0;
16-
background: #0d3644;
17-
border-radius: 8px;
17+
background: ${theme('content.bg')};
18+
border-radius: 12px;
19+
border: 1px solid;
20+
border-color: transparent;
1821
1922
position: relative;
2023
padding: 14px;
@@ -23,6 +26,10 @@ export const Wrapper = styled.article<TWrapper>`
2326
opacity: ${({ entry, c11n }) => getOpacity(entry, c11n)};
2427
2528
transition: all 0.2s;
29+
30+
&:hover {
31+
border-color: #124d61;
32+
}
2633
`
2734

2835
export const holder = 1

src/components/PagedArticles/ArticleList.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
/* eslint-disable react/display-name */
22

33
import { Fragment, memo } from 'react'
4-
import { isEmpty } from 'ramda'
54

65
import { THREAD, TYPE } from '@/constant'
7-
86
import PostItem from '@/components/PostItem'
97
import JobItem from '@/components/JobItem'
108
import BlogItem from '@/components/BlogItem'

src/components/RadarItem/styles/index.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import styled from 'styled-components'
22

33
import type { TRadar, TC11N } from '@/spec'
44
import css from '@/utils/css'
5+
import { theme } from '@/utils/themes'
56

67
import { getOpacity } from './metric'
78

@@ -13,15 +14,21 @@ export const Wrapper = styled.article<TWrapper>`
1314
margin-top: 10px;
1415
margin-bottom: 18px;
1516
margin-right: 0;
16-
background: #0d3644;
17-
border-radius: 8px;
17+
background: ${theme('content.bg')};
18+
border-radius: 12px;
19+
border: 1px solid;
20+
border-color: transparent;
1821
1922
position: relative;
2023
padding: 14px;
2124
padding-top: 16px;
2225
opacity: ${({ entry, c11n }) => getOpacity(entry, c11n)};
2326
2427
transition: all 0.25s;
28+
29+
&:hover {
30+
border-color: #124d61;
31+
}
2532
`
2633

2734
export const holder = 1

src/containers/thread/ArticlesThread/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ const ArticlesThreadContainer: FC<TProps> = ({ articlesThread: store }) => {
5454

5555
return (
5656
<Wrapper>
57-
<MainWrapper>
57+
<MainWrapper thread={curThread}>
5858
<ViewportTracker onEnter={inAnchor} onLeave={outAnchor} />
5959
{showFilters && (
60-
<FilterWrapper>
60+
<FilterWrapper thread={curThread}>
6161
<ArticlesFilter
6262
resState={resState}
6363
onSelect={onFilterSelect}
Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,40 @@
11
import styled from 'styled-components'
22

3+
import { values, includes } from 'ramda'
4+
import type { TThread } from '@/spec'
5+
import { CARD_THREAD } from '@/constant'
36
import { theme } from '@/utils/themes'
47
import css from '@/utils/css'
58

69
export const Wrapper = styled.div`
710
${css.flex()};
811
width: 100%;
912
`
10-
export const MainWrapper = styled.div`
13+
export const MainWrapper = styled.div<{ thread: TThread }>`
1114
flex-grow: 1;
1215
width: 100%;
13-
background: ${theme('content.bg')};
16+
17+
background: ${({ thread }) =>
18+
includes(thread, values(CARD_THREAD))
19+
? 'transparent'
20+
: theme('content.bg')};
21+
1422
border-radius: 6px;
1523
16-
padding-top: 15px;
17-
padding-left: 25px;
18-
padding-right: 24px;
19-
margin-right: 42px;
24+
padding-top: ${({ thread }) =>
25+
includes(thread, values(CARD_THREAD)) ? '13px' : '16px'};
26+
padding-left: ${({ thread }) =>
27+
includes(thread, values(CARD_THREAD)) ? '15px' : '25px'};
28+
padding-right: ${({ thread }) =>
29+
includes(thread, values(CARD_THREAD)) ? 0 : '24px'};
30+
margin-right: ${({ thread }) =>
31+
includes(thread, values(CARD_THREAD)) ? '35px' : '42px'};
2032
`
21-
export const FilterWrapper = styled.div`
33+
export const FilterWrapper = styled.div<{ thread: TThread }>`
2234
${css.flex('align-center')};
2335
margin-bottom: 3px;
36+
margin-left: ${({ thread }) =>
37+
includes(thread, values(CARD_THREAD)) ? '5px' : '-3px'};
38+
2439
${css.media.mobile`margin-bottom: 4px;`};
25-
margin-left: -3px;
2640
`

utils/constant/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export { default as TYPE } from './type'
77
export { default as EVENT } from './event'
88
export { default as ERR } from './err'
99
export { default as ROUTE } from './route'
10-
export { ARTICLE_THREAD, THREAD } from './thread'
10+
export { ARTICLE_THREAD, CARD_THREAD, THREAD } from './thread'
1111
export { default as USER_THREAD } from './user_thread'
1212
export { default as FILTER } from './filter'
1313
export { default as ACTION } from './action'

utils/constant/thread.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
import type { TArticleThread, TThread } from '@/spec'
22

3+
export const CARD_THREAD = {
4+
JOB: 'job',
5+
RADAR: 'radar',
6+
MEETUP: 'meetup',
7+
}
8+
39
export const ARTICLE_THREAD = {
410
REPO: 'repo',
511
POST: 'post',

utils/ssr.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010

1111
import { DEFAULT_THEME } from '@/config'
1212
import { TYPE, ARTICLE_THREAD } from '@/constant'
13-
import { plural } from '@/utils/helper'
13+
import { plural } from './helper'
1414

1515
import { makeGQClient } from './graphql'
1616
import { ssrParseURL, akaTranslate, queryStringToJSON } from './route'

utils/themes/skins/solarized_dark.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const primaryColor = '#2d7eb1'
88

99
const bannerBg = '#003B4A'
1010
const contentBg = '#002A35'
11-
const contentBoxBg = '#10313e' // '#0e303c' // #072d3a
11+
const contentBoxBg = '#08313e' // '#10313e' // '#0e303c' // #072d3a
1212
const fontColor = primaryColor
1313
const sidebarBg = '#001B21'
1414
const markdownFont = '#687F82'
@@ -75,7 +75,7 @@ const solarizedDark = {
7575
banner: {
7676
title: '#889fa0',
7777
bg: bannerBg,
78-
desc: '#6c8084',
78+
desc: darken(0.03, '#6c8084'), // '#6c8084',
7979
spliter: darken(0.03, bannerBg),
8080
number: '#889fa0',
8181
active: primaryMate,

0 commit comments

Comments
 (0)