Skip to content

Commit ebcee72

Browse files
committed
style: update fireblog page ui
1 parent 9dda20a commit ebcee72

11 files changed

+74
-69
lines changed

src/app/app.routes.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,7 @@ export const routes: Routes = [
3333
loadComponent: () => import('../app/components/fireblog-page/fireblog-page.component')
3434
.then(mod => mod.FireblogPageComponent)
3535
},
36-
{
37-
path:'blog-detail',
38-
loadComponent: () => import('../app/components/fireblog-detail/fireblog-detail.component')
39-
.then(mod => mod.FireblogDetailComponent)
40-
}
36+
4137
]
4238
}
4339
];

src/app/components/create-post/create-post.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
</div>
99
</div>
1010
<div class="content-grp">
11-
<textarea name="content" id="post" [(ngModel)]="content"></textarea>
11+
<textarea name="content" id="post" placeholder="Share your thoughts or start writing your story here..." [(ngModel)]="content"></textarea>
1212
<button mat-raised-button color="primary" (click)="createPost()" title="create post">
13-
Create Post
13+
create post
1414
</button>
1515
</div>
1616
</section>

src/app/components/create-post/create-post.component.scss

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
@use '../../../partials/variables' as *;
22

3-
4-
53
section {
64
display: flex;
7-
gap: 2.75rem;
5+
flex-direction: column;
6+
gap: 1rem;
87
position: fixed !important;
98
padding: 1.25rem;
109
bottom: 0;
1110
background-color: #fff;
12-
width: 100%;
11+
width: 100% !important;
1312
left: 0;
1413
right: 0;
1514
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
@@ -23,7 +22,7 @@ section {
2322
display: flex;
2423
gap: .25rem;
2524

26-
img{
25+
img {
2726
width: 12px;
2827
height: 12px;
2928
}
@@ -39,28 +38,34 @@ section {
3938
.content-grp {
4039
display: flex;
4140
flex-direction: column;
42-
gap: .5rem;
41+
align-items: stretch;
42+
gap: 1rem;
4343
width: 100%;
4444

4545
textarea {
46-
resize: none;
46+
resize: vertical;
4747
border: none;
4848
outline: none;
4949
padding: 1rem;
5050
font-size: 1.25rem;
5151
width: 100%;
52-
max-width: 40rem;
53-
min-width: 20rem;
52+
min-height: 100px;
53+
max-height: 300px;
5454
border-radius: 0.375rem;
5555
background-color: #f4f4f4;
5656
color: $palesky;
57+
58+
&:focus{
59+
border: 1px solid $oxfordblue;
60+
box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
61+
transition: box-shadow 0.3s ease-in-out;
62+
}
5763
}
5864

5965
button {
6066
cursor: pointer;
61-
align-self: end;
62-
margin-right: 7rem;
63-
width: 8rem;
67+
align-self: flex-end;
68+
width: 10rem;
6469
height: 2.125rem;
6570
border: none;
6671
border-radius: 0.375rem;
@@ -71,3 +76,24 @@ section {
7176
}
7277
}
7378
}
79+
80+
@media (min-width: 768px) {
81+
section {
82+
flex-direction: row;
83+
align-items: flex-start;
84+
85+
.content-grp {
86+
flex-direction: row;
87+
align-items: flex-start;
88+
89+
textarea {
90+
flex-grow: 1;
91+
min-width: 0;
92+
}
93+
94+
button {
95+
align-self: flex-start;
96+
}
97+
}
98+
}
99+
}

src/app/components/fireblog-detail/fireblog-detail.component.html

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/app/components/fireblog-detail/fireblog-detail.component.scss

Whitespace-only changes.

src/app/components/fireblog-detail/fireblog-detail.component.spec.ts

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/app/components/fireblog-detail/fireblog-detail.component.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/app/components/fireblog-page/fireblog-page.component.html

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,17 @@
77
<mat-sidenav-content>
88
<div class="fireblog-content">
99
<section class="posts-section">
10-
<h2><span>Fire</span>blog Posts</h2>
11-
<ul>
12-
<app-post-card *ngFor="let post of blogPosts" [blogPost]="post"></app-post-card>
13-
</ul>
10+
<div>
11+
<h2><span>Fire</span>blog Posts</h2>
12+
<p>({{ blogPosts.length }})</p>
13+
</div>
14+
@if(blogPosts.length > 0){
15+
<ul>
16+
<app-post-card *ngFor="let post of blogPosts" [blogPost]="post"></app-post-card>
17+
</ul>
18+
} @else {
19+
20+
}
1421
</section>
1522
<app-create-post class="create-post-section" (toggleSidebar)="toggleSidebar($event)"></app-create-post>
1623
</div>

src/app/components/fireblog-page/fireblog-page.component.scss

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@use '../../../partials/mixins' as *;
33

44
.fireblog-container {
5-
padding-top: 2rem;
5+
// padding-top: 2rem;
66
height: 100vh;
77
width: 100vw;
88
display: flex;
@@ -25,7 +25,6 @@
2525
mat-sidenav-content {
2626
display: flex;
2727
justify-content: center !important;
28-
2928
overflow: hidden;
3029

3130
.fireblog-content {
@@ -37,18 +36,28 @@
3736
.posts-section {
3837
display: flex;
3938
flex-direction: column;
39+
justify-items: center;
40+
align-items: center;
41+
border: 2px solid;
4042
padding: 1.25rem;
41-
padding-bottom: 7rem;
43+
44+
div{
45+
display: flex;
46+
color: $oxfordblue;
47+
font-weight: 500;
48+
}
4249

4350
ul {
44-
padding: 1.25rem 1.25rem 0 3rem;
51+
width: 80%;
52+
padding: 1.25rem 1.25rem 10rem 3rem;
53+
margin-bottom: 6rem !important;
4554
display: flex;
4655
flex-direction: column;
4756
gap: 1.25rem;
48-
49-
max-height: 45rem;
57+
max-height: 38rem;
5058
overflow-y: auto;
5159

60+
5261
&::-webkit-scrollbar {
5362
width: 8px;
5463
}
@@ -59,12 +68,12 @@
5968
}
6069

6170
&::-webkit-scrollbar-thumb {
62-
background: #fff;
71+
background: darken($blueviolet, 5%);
6372
border-radius: 4px;
6473
}
6574

6675
&::-webkit-scrollbar-thumb:hover {
67-
background: darken(#fff, 10%);
76+
background: darken($oxfordblue, 10%);
6877
}
6978
}
7079

src/app/components/post-card/post-card.component.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
@use '../../../partials/variables' as *;
22

33
.post-card {
4-
width: 100%;
4+
width: 80%;
5+
position: relative;
6+
left: 9.875%;
7+
right: 15%;
58
border-radius: 0.5rem;
69
background-color: #fff;
710
padding: 1.5rem;

src/app/views/fireblog/fireblog.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
main{
44
height: 100%;
5-
width: 100%;
5+
// width: 100%;
66
display: flex;
77
justify-content: center;
88
// align-items: center;

0 commit comments

Comments
 (0)