Skip to content
This repository was archived by the owner on Mar 3, 2020. It is now read-only.

Commit 2e35b63

Browse files
committed
Merge branch 'feature'
2 parents 38086cd + a0b442a commit 2e35b63

File tree

2 files changed

+28
-20
lines changed

2 files changed

+28
-20
lines changed

velog-frontend/src/components/common/PostCard/PostCard.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,9 @@ const PostCard = ({
4343
const link = `/@${username}/${urlSlug}`;
4444
return (
4545
<div className={cx('PostCard', { 'one-column': oneColumn, empty: !thumbnail })}>
46-
{(!oneColumn || thumbnail) && (
46+
{thumbnail && (
4747
<Link to={link} className={cx('thumbnail-wrapper')}>
48-
{thumbnail ? (
49-
<img src={resizeImage(thumbnail, oneColumn ? 768 : 512)} alt={title} />
50-
) : (
51-
<div className="image-placeholder">
52-
<ImageIcon />
53-
</div>
54-
)}
48+
{thumbnail && <img src={resizeImage(thumbnail, oneColumn ? 768 : 512)} alt={title} />}
5549
<div className="white-mask" />
5650
</Link>
5751
)}

velog-frontend/src/components/common/PostCard/PostCard.scss

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,42 @@
1-
@import "utils";
1+
@import 'utils';
22
.PostCard {
33
margin: 0.875rem;
44
width: calc((100% - 8.75rem) / 5);
55
position: relative;
6+
background: white;
7+
margin-top: 1.5rem;
8+
margin-bottom: 1.5rem;
69
box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.05);
7-
@include media("<=x-wide") {
10+
display: flex;
11+
flex-direction: column;
12+
@include media('<=x-wide') {
813
width: calc(25% - 1.75rem);
914
}
10-
@include media("<=wide") {
15+
@include media('<=wide') {
1116
width: calc(33.333% - 1.75rem);
1217
}
13-
@include media("<=x-large") {
18+
@include media('<=x-large') {
1419
width: calc(50% - 1.75rem);
1520
}
16-
@include media("<=large") {
21+
@include media('<=large') {
1722
width: calc(100% - 1.75rem);
1823
margin-top: 1.25rem;
1924
margin-bottom: 1.25rem;
2025
}
21-
@include media("<medium") {}
26+
@include media('<medium') {
27+
}
2228
&.one-column {
2329
box-shadow: none;
2430
border: 1px solid $oc-gray-3;
2531
width: calc(100% - 1.75rem);
26-
&+& {
32+
& + & {
2733
margin-top: 2.5rem;
2834
}
2935
.card-content {
3036
box-shadow: none;
3137
}
3238
}
33-
&>.thumbnail-wrapper {
39+
& > .thumbnail-wrapper {
3440
width: 100%;
3541
padding-top: 52.63%;
3642
position: relative;
@@ -75,6 +81,9 @@
7581
}
7682
}
7783
.card-content {
84+
display: flex;
85+
flex-direction: column;
86+
flex: 1;
7887
box-shadow: 0px -4px 16px rgba(0, 0, 0, 0.05);
7988
position: relative;
8089
border-bottom-left-radius: 4px;
@@ -148,11 +157,11 @@
148157
font-size: 0.875rem;
149158
margin-top: 0.5rem;
150159
color: #8aa6c1;
151-
span+span::before {
160+
span + span::before {
152161
color: $oc-gray-5;
153162
padding-left: 0.25rem;
154163
padding-right: 0.25rem;
155-
content: "\00B7";
164+
content: '\00B7';
156165
}
157166
}
158167
}
@@ -171,10 +180,15 @@
171180
}
172181
}
173182
&.empty {
174-
@include media("<large") {
183+
.description {
184+
height: 12rem;
185+
-webkit-line-clamp: 8;
186+
-webkit-box-orient: vertical;
187+
}
188+
@include media('<large') {
175189
.thumbnail-wrapper {
176190
display: none;
177191
}
178192
}
179193
}
180-
}
194+
}

0 commit comments

Comments
 (0)