|
1 | 1 | import styled from 'styled-components' |
2 | 2 |
|
| 3 | +import { values, includes } from 'ramda' |
| 4 | +import type { TThread } from '@/spec' |
| 5 | +import { CARD_THREAD } from '@/constant' |
3 | 6 | import { theme } from '@/utils/themes' |
4 | 7 | import css from '@/utils/css' |
5 | 8 |
|
6 | 9 | export const Wrapper = styled.div` |
7 | 10 | ${css.flex()}; |
8 | 11 | width: 100%; |
9 | 12 | ` |
10 | | -export const MainWrapper = styled.div` |
| 13 | +export const MainWrapper = styled.div<{ thread: TThread }>` |
11 | 14 | flex-grow: 1; |
12 | 15 | width: 100%; |
13 | | - background: ${theme('content.bg')}; |
| 16 | +
|
| 17 | + background: ${({ thread }) => |
| 18 | + includes(thread, values(CARD_THREAD)) |
| 19 | + ? 'transparent' |
| 20 | + : theme('content.bg')}; |
| 21 | +
|
14 | 22 | border-radius: 6px; |
15 | 23 |
|
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'}; |
20 | 32 | ` |
21 | | -export const FilterWrapper = styled.div` |
| 33 | +export const FilterWrapper = styled.div<{ thread: TThread }>` |
22 | 34 | ${css.flex('align-center')}; |
23 | 35 | margin-bottom: 3px; |
| 36 | + margin-left: ${({ thread }) => |
| 37 | + includes(thread, values(CARD_THREAD)) ? '5px' : '-3px'}; |
| 38 | +
|
24 | 39 | ${css.media.mobile`margin-bottom: 4px;`}; |
25 | | - margin-left: -3px; |
26 | 40 | ` |
0 commit comments