Skip to content

Commit e5a8eaa

Browse files
committed
implemented temp save UI
1 parent 327830f commit e5a8eaa

File tree

13 files changed

+196
-1
lines changed

13 files changed

+196
-1
lines changed

velog-frontend/src/components/App.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { Route, Switch } from 'react-router-dom';
3-
import { Home, Register, Write, Post, User } from 'pages';
3+
import { Home, Register, Write, Post, User, Saves } from 'pages';
44
import EmailLogin from 'containers/etc/EmailLogin';
55
import Core from 'containers/base/Core';
66

@@ -17,6 +17,7 @@ const App = () => (
1717
<Route exact path="/@:username/:tab(collections|popular)" component={User} />
1818
<Route path="/@:username/:urlSlug" component={Post} />
1919
<Route path="/posts/preview/:id" component={Post} />
20+
<Route path="/saves" component={Saves} />
2021
</Switch>
2122
<Core />
2223
</React.Fragment>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// @flow
2+
import React from 'react';
3+
import DeleteIcon from 'react-icons/lib/md/delete';
4+
import './SavePostCard.scss';
5+
6+
type Props = {};
7+
8+
const SavePostCard = (props: Props) => (
9+
<div className="SavePostCard">
10+
<div className="img-wrapper">
11+
<img
12+
src="https://images.velog.io/post-images/velopert/1d26a150-6747-11e8-9dff-1b161279fc07/goodb.png"
13+
alt="thumbnail"
14+
/>
15+
</div>
16+
<div className="white-area">
17+
<div className="post-info">
18+
<h3>제목이 있다리</h3>
19+
<div className="date">4 초 전</div>
20+
</div>
21+
<button className="remove-button">
22+
<DeleteIcon />
23+
</button>
24+
</div>
25+
</div>
26+
);
27+
28+
export default SavePostCard;
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
@import 'utils';
2+
.SavePostCard {
3+
border: 1px solid $oc-gray-3;
4+
font-family: initial;
5+
.img-wrapper {
6+
padding-top: 52.63%;
7+
position: relative;
8+
img {
9+
position: absolute;
10+
height: 100%;
11+
top: 0;
12+
left: 0;
13+
width: 100%;
14+
display: block;
15+
}
16+
}
17+
.white-area {
18+
padding: 1.5rem 1rem;
19+
display: flex;
20+
align-items: center;
21+
.post-info {
22+
flex: 1;
23+
h3 {
24+
margin: 0;
25+
font-size: 1.5rem;
26+
font-weight: 500;
27+
}
28+
.date {
29+
color: $oc-gray-7;
30+
font-size: 0.875rem;
31+
margin-top: 0.25rem;
32+
}
33+
}
34+
.remove-button {
35+
width: 2.5rem;
36+
height: 2.5rem;
37+
font-size: 1.75rem;
38+
color: $oc-gray-3;
39+
border-radius: 1.5rem;
40+
border: 2px solid $oc-gray-2;
41+
display: flex;
42+
align-items: center;
43+
justify-content: center;
44+
cursor: pointer;
45+
&:hover {
46+
color: $oc-red-6;
47+
border: 2px solid $oc-red-6;
48+
}
49+
}
50+
}
51+
&+& {
52+
margin-top: 2rem;
53+
}
54+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// @flow
2+
export { default } from './SavePostCard';
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// @flow
2+
import React from 'react';
3+
import './SavePostCardList.scss';
4+
import SavePostCard from '../SavePostCard';
5+
6+
type Props = {};
7+
8+
const SavePostCardList = (props: Props) => (
9+
<div className="SavePostCardList">
10+
<SavePostCard />
11+
<SavePostCard />
12+
<SavePostCard />
13+
<SavePostCard />
14+
<SavePostCard />
15+
<SavePostCard />
16+
<SavePostCard />
17+
<SavePostCard />
18+
<SavePostCard />
19+
<SavePostCard />
20+
<SavePostCard />
21+
<SavePostCard />
22+
<SavePostCard />
23+
<SavePostCard />
24+
<SavePostCard />
25+
<SavePostCard />
26+
<SavePostCard />
27+
<SavePostCard />
28+
<SavePostCard />
29+
</div>
30+
);
31+
32+
export default SavePostCardList;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@import 'utils';
2+
.SavePostCardList {
3+
margin-top: 3rem;
4+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// @flow
2+
export { default } from './SavePostCardList';
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// @flow
2+
import React, { type Node } from 'react';
3+
import './SavesTemplate.scss';
4+
5+
type Props = {
6+
header: Node,
7+
children: Node,
8+
};
9+
10+
const SavesTemplate = ({ header, children }: Props) => (
11+
<div className="SavesTemplate">
12+
{header}
13+
<main>
14+
<h2>임시 글 목록</h2>
15+
{children}
16+
</main>
17+
</div>
18+
);
19+
20+
export default SavesTemplate;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@import 'utils';
2+
.SavesTemplate {
3+
main {
4+
width: $medium-w;
5+
margin: 0 auto;
6+
margin-top: 4rem;
7+
h2 {
8+
margin: 0;
9+
font-weight: 500;
10+
font-size: 2.5rem;
11+
padding-bottom: 1rem;
12+
border-bottom: 1px solid $oc-gray-4;
13+
}
14+
}
15+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// @flow
2+
export { default } from './SavesTemplate';

0 commit comments

Comments
 (0)