Skip to content

Commit 0dcd60d

Browse files
committed
Quick responsive design for series page
It looks bit ugly. Might need to enhance the design later on
1 parent 94b0de9 commit 0dcd60d

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

src/components/velog/SeriesPostItem.tsx

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { formatDate } from '../../lib/utils';
66
import PostLink from '../common/PostLink';
77
import SkeletonTexts from '../common/SkeletonTexts';
88
import Skeleton from '../common/Skeleton';
9+
import media from '../../lib/styles/media';
910

1011
const SeriesPostItemBlock = styled.div<{ edit?: boolean }>`
1112
font-family: 'Spoqa Han Sans', -apple-system, BlinkMacSystemFont,
@@ -35,6 +36,9 @@ const SeriesPostItemBlock = styled.div<{ edit?: boolean }>`
3536
3637
& + & {
3738
margin-top: 4rem;
39+
${media.small} {
40+
margin-top: 6rem;
41+
}
3842
}
3943
section {
4044
margin-top: 1rem;
@@ -44,6 +48,12 @@ const SeriesPostItemBlock = styled.div<{ edit?: boolean }>`
4448
min-width: 0;
4549
letter-spacing: -0.02em;
4650
height: 6.25rem;
51+
52+
${media.small} {
53+
flex-direction: column;
54+
height: auto;
55+
}
56+
4757
.post-info {
4858
flex: 1;
4959
min-width: 0;
@@ -69,10 +79,22 @@ const SeriesPostItemBlock = styled.div<{ edit?: boolean }>`
6979
height: 6.25rem;
7080
object-fit: cover;
7181
box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.15);
82+
${media.small} {
83+
width: 100%;
84+
height: auto;
85+
}
86+
&.empty-thumbnail {
87+
${media.small} {
88+
display: none;
89+
}
90+
}
7291
}
7392
.date {
7493
color: ${palette.gray5};
7594
font-size: 0.875rem;
95+
${media.small} {
96+
margin-top: 1rem;
97+
}
7698
}
7799
78100
${props =>
@@ -123,7 +145,11 @@ const SeriesPostItem: React.FC<SeriesPostItemProps> = ({
123145
<img src={thumbnail || emptyThumbnail} alt="post-thumbnail" />
124146
) : (
125147
<PostLink username={username} urlSlug={urlSlug}>
126-
<img src={thumbnail || emptyThumbnail} alt="post-thumbnail" />
148+
<img
149+
src={thumbnail || emptyThumbnail}
150+
alt="post-thumbnail"
151+
className={thumbnail ? '' : 'empty-thumbnail'}
152+
/>
127153
</PostLink>
128154
)}
129155
<div className="post-info">
@@ -165,6 +191,10 @@ const SkeletonBlock = styled(SeriesPostItemBlock)`
165191
width: 12rem;
166192
height: 6.25rem;
167193
margin-right: 1rem;
194+
${media.small} {
195+
width: 100%;
196+
height: 320px;
197+
}
168198
}
169199
.post-info {
170200
p {

src/pages/velog/SeriesPage.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@ import styled from 'styled-components';
33
import VelogResponsive from '../../components/velog/VelogResponsive';
44
import SeriesPosts from '../../containers/velog/SeriesPosts';
55
import { RouteComponentProps } from 'react-router';
6+
import media from '../../lib/styles/media';
67

78
const SeriesPageBlock = styled(VelogResponsive)`
89
margin-top: 90px;
10+
${media.medium} {
11+
margin-top: 2rem;
12+
padding-left: 1rem;
13+
padding-right: 1rem;
14+
}
915
`;
1016

1117
export interface SeriesPageProps

0 commit comments

Comments
 (0)