Skip to content

Commit cd8c5af

Browse files
committed
complete styling
1 parent 60bc055 commit cd8c5af

File tree

2 files changed

+31
-12
lines changed

2 files changed

+31
-12
lines changed

src/views/ItemView.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515
{{ item.time | timeAgo }} ago
1616
</p>
1717
</div>
18-
<div v-if="item.kids" class="item-view-comments">
19-
<p class="item-view-comments-header">{{ item.descendants }} comments</p>
20-
<ul class="comment-children">
18+
<div class="item-view-comments">
19+
<p class="item-view-comments-header">
20+
{{ item.kids ? item.descendants + ' comments' : 'No comments yet.'}}
21+
</p>
22+
<ul v-if="item.kids" class="comment-children">
2123
<comment v-for="id in item.kids" :id="id"></comment>
2224
</ul>
2325
</div>

src/views/UserView.vue

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@
22
<div class="user-view">
33
<spinner :show="!user"></spinner>
44
<template v-if="user">
5-
<ul>
6-
<li><span class="label">user:</span> {{ user.id }}</li>
7-
<li><span class="label">created:</span> {{ user.created | timeAgo }} ago</li>
8-
<li><span class="label">karma:</span> {{user.karma}}</li>
9-
<li>
10-
<span class="label">about:</span>
11-
<div class="about" v-html="user.about"></div>
12-
</li>
5+
<h1>User : {{ user.id }}</h1>
6+
<ul class="meta">
7+
<li><span class="label">Created:</span> {{ user.created | timeAgo }} ago</li>
8+
<li><span class="label">Karma:</span> {{user.karma}}</li>
9+
<li v-if="user.about" v-html="user.about" class="about"></li>
1310
</ul>
1411
<p class="links">
15-
<a :href="'https://news.ycombinator.com/submitted?id=' + user.id">submissions</a><br>
12+
<a :href="'https://news.ycombinator.com/submitted?id=' + user.id">submissions</a> |
1613
<a :href="'https://news.ycombinator.com/threads?id=' + user.id">comments</a>
1714
</p>
1815
</template>
@@ -42,3 +39,23 @@ export default {
4239
}
4340
}
4441
</script>
42+
43+
<style lang="stylus">
44+
.user-view
45+
background-color #fff
46+
box-sizing border-box
47+
padding 2em 3em
48+
h1
49+
margin 0
50+
font-size 1.5em
51+
.meta
52+
list-style-type none
53+
padding 0
54+
.label
55+
display inline-block
56+
min-width 4em
57+
.about
58+
margin 1em 0
59+
.links a
60+
text-decoration underline
61+
</style>

0 commit comments

Comments
 (0)