Skip to content

Commit 03d767a

Browse files
committed
responsive fixes
1 parent 3eb8db1 commit 03d767a

File tree

4 files changed

+90
-25
lines changed

4 files changed

+90
-25
lines changed

src/components/header/style.css

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@
5858
}
5959

6060
@media all and (max-width: 728px) {
61-
nav {
62-
display: none;
61+
.header h1{
62+
font-size: 2rem;
63+
}
64+
.header nav a{
65+
line-height: 100px;
66+
margin: 0 8px;
6367
}
6468
}

src/routes/blogs/index.js

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,47 @@ import style from './style';
55

66
const blogs = (props) => {
77
const [data, isLoading] = usePrerenderData(props);
8+
return (
9+
<div class={style.pageBlogs}>
10+
<h1 class={style.pageTitle}>My Blogs</h1>
11+
{ getBlogsListing(data, isLoading) }
12+
</div>
13+
);
14+
};
15+
16+
function getBlogsListing(data, isLoading) {
817
if (isLoading) {
9-
return (<h1>Loading</h1>);
18+
return (
19+
<article class={style.loadingPlaceholder}>
20+
<h2 class={`${style.blogtitle} loading`}>&nbsp;</h2>
21+
<div class={`${style.loadingBody} loading`}>&nbsp;</div>
22+
<div class={`${style.loadingBody} loading`}>&nbsp;</div>
23+
<div class={`${style.loadingBody} loading`}>&nbsp;</div>
24+
</article>
25+
);
1026
}
1127
if (data && data.data) {
1228
const { data: blogs } = data;
1329
return (
14-
<div class={style.pageBlogs}>
15-
<h1 class={style.pageTitle}>My Blogs</h1>
30+
<>
1631
{blogs.edges.map(blog => (
17-
<Link href={`/blog/${blog.id}`}>
18-
<article>
19-
<h2>{blog.details.title}</h2>
20-
<div>
21-
{
22-
(blog.details.tags.substr(1, blog.details.tags.length - 2).split(',') || []).map(tag => <span class={style.tag}>{tag}</span>)
23-
}
24-
</div>
25-
<p class={style.preview}>
26-
{blog.preview}
27-
</p>
28-
</article>
29-
</Link>
30-
))}
31-
</div>
32+
<Link href={`/blog/${blog.id}`}>
33+
<article>
34+
<h2>{blog.details.title}</h2>
35+
<div>
36+
{
37+
(blog.details.tags.substr(1, blog.details.tags.length - 2).split(',') || []).map(tag => <span class={style.tag}>{tag}</span>)
38+
}
39+
</div>
40+
<p class={style.preview}>
41+
{blog.preview}
42+
</p>
43+
</article>
44+
</Link>
45+
))}
46+
</>
3247
);
3348
}
34-
35-
return (<h1>Error</h1>);
36-
};
49+
}
3750

3851
export default blogs;

src/routes/blogs/style.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,27 @@ h2 {
4747
text-overflow: ellipsis;
4848
}
4949

50+
.loadingPlaceholder .blogtitle {
51+
height: 24px;
52+
}
53+
54+
.loadingPlaceholder .loadingBody {
55+
height: 12px;
56+
margin-bottom: 8px;
57+
}
58+
59+
.loadingPlaceholder .loadingBody:nth-child(2) {
60+
width: 90%;
61+
}
62+
63+
.loadingPlaceholder .loadingBody:nth-child(3) {
64+
width: 80%;
65+
}
66+
67+
.loadingPlaceholder .loadingBody:nth-child(4) {
68+
width: 65%;
69+
}
70+
5071
@media all and (max-width: 728px) {
5172
.preview {
5273
width: 100%;

src/routes/home/style.css

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
justify-content: center;
4848
}
4949

50-
.bioleft,.bioright{
50+
.bioleft, .bioright{
5151
max-width: 25%;
5252
text-align: justify;
5353
}
@@ -58,4 +58,31 @@
5858

5959
.bioright{
6060
padding-left: 16px;
61-
}
61+
}
62+
63+
@media all and (max-width: 728px) {
64+
.home {
65+
padding: 16px;
66+
}
67+
68+
.about, .bio {
69+
flex-direction: column;
70+
}
71+
72+
.details {
73+
padding: 16px 0 0 0;
74+
font-size: 1.5rem;
75+
}
76+
77+
.image {
78+
height: auto;
79+
width: 100%;
80+
}
81+
82+
.bioleft, .bioright{
83+
max-width: 100%;
84+
text-align: justify;
85+
padding: 0;
86+
}
87+
}
88+

0 commit comments

Comments
 (0)