-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
326 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,8 @@ | |
{ | ||
"button-name": "off" | ||
} | ||
] | ||
], | ||
"button-type": "off", | ||
"no-inline-styles": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,16 @@ | ||
<section class="create-post"> | ||
<div class="content"> | ||
<div class="profile"> | ||
<img id="profile-img" src="../../../assets/images/avatars/image-juliusomo.png" alt="" title="edit profile"> | ||
<div class="profile" (click)="toggleSidebarEvent()"> | ||
<img id="profile-img" src="../../../assets/images/avatars/image-juliusomo.png" alt="" title="toggle sidebar"> | ||
<div> | ||
<img src="../../../assets/images/icon-edit.svg" alt=""> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
<div class="content-grp"> | ||
<textarea name="content" id="post"></textarea> | ||
<button (click)="createPost()" title="create post"> | ||
create post | ||
<textarea name="content" id="post" [(ngModel)]="content"></textarea> | ||
<button mat-raised-button color="primary" (click)="createPost()" title="create post"> | ||
Create Post | ||
</button> | ||
</div> | ||
|
||
|
||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 16 additions & 0 deletions
16
src/app/components/fireblog-page/fireblog-page.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<mat-sidenav-container class="fireblog-container"> | ||
<mat-sidenav #sidenav [opened]="!isSidebarOpen" mode="over" position="start"> | ||
<!-- Add your sidebar content here --> | ||
<app-user-profile/> | ||
</mat-sidenav> | ||
|
||
<mat-sidenav-content> | ||
<div class="fireblog-content"> | ||
<section class="posts-section"> | ||
<h2>Fireblog Posts</h2> | ||
<app-post-card></app-post-card> | ||
</section> | ||
<app-create-post class="create-post-section" (toggleSidebar)="toggleSidebar($event)"></app-create-post> | ||
</div> | ||
</mat-sidenav-content> | ||
</mat-sidenav-container> |
108 changes: 108 additions & 0 deletions
108
src/app/components/fireblog-page/fireblog-page.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
@use '../../../partials/variables' as *; | ||
|
||
.fireblog-container { | ||
padding-top: 2rem; | ||
flex: 1; | ||
display: flex; | ||
flex-direction: column; | ||
background-color: transparent; | ||
height: 100%; | ||
overflow: hidden; | ||
|
||
mat-sidenav-container { | ||
flex: 1; | ||
overflow: hidden; | ||
} | ||
|
||
mat-sidenav { | ||
width: 300px; | ||
padding: 1rem; | ||
} | ||
|
||
mat-sidenav-content { | ||
display: flex; | ||
flex-direction: column; | ||
background-color: transparent; | ||
overflow: hidden; | ||
|
||
.fireblog-content { | ||
flex: 1; | ||
display: flex; | ||
flex-direction: column; | ||
overflow: hidden; | ||
|
||
.posts-section { | ||
flex: 1; | ||
display: flex; | ||
flex-direction: column; | ||
overflow-y: auto; | ||
padding: 1.25rem; | ||
padding-bottom: 7rem; | ||
|
||
h2 { | ||
text-align: center; | ||
color: $blueviolet; | ||
font-family: $titlefont; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
.create-post-section { | ||
position: fixed; | ||
bottom: 0; | ||
left: 0; | ||
right: 0; | ||
z-index: 1000; | ||
} | ||
|
||
// New styles for user profile | ||
.user-profile { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
padding: 1rem; | ||
|
||
h3 { | ||
color: $blueviolet; | ||
font-family: $titlefont; | ||
margin-bottom: 1rem; | ||
} | ||
|
||
.profile-form { | ||
width: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
|
||
.profile-image { | ||
position: relative; | ||
margin-bottom: 1rem; | ||
|
||
img { | ||
width: 150px; | ||
height: 150px; | ||
border-radius: 50%; | ||
object-fit: cover; | ||
} | ||
|
||
.upload-btn { | ||
position: absolute; | ||
bottom: 0; | ||
right: 0; | ||
background-color: $blueviolet; | ||
} | ||
} | ||
|
||
mat-form-field { | ||
width: 100%; | ||
margin-bottom: 1rem; | ||
} | ||
|
||
button[mat-raised-button] { | ||
background-color: $blueviolet; | ||
color: white; | ||
} | ||
} | ||
} |
File renamed without changes.
47 changes: 47 additions & 0 deletions
47
src/app/components/fireblog-page/fireblog-page.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core'; | ||
import { MatSidenav, MatSidenavModule } from '@angular/material/sidenav'; | ||
import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar'; | ||
import { MatFormFieldModule } from '@angular/material/form-field'; | ||
import { MatInputModule } from '@angular/material/input'; | ||
import { MatButtonModule } from '@angular/material/button'; | ||
import { MatIconModule } from '@angular/material/icon'; | ||
import { FormsModule } from '@angular/forms'; | ||
import { CommonModule } from '@angular/common'; | ||
import { PostCardComponent } from "../post-card/post-card.component"; | ||
import { CreatePostComponent } from "../create-post/create-post.component"; | ||
import { UserProfileComponent } from "../../views/auth/user-profile/user-profile.component"; | ||
|
||
@Component({ | ||
selector: 'app-fireblog-page', | ||
templateUrl: './fireblog-page.component.html', | ||
styleUrls: ['./fireblog-page.component.scss'], | ||
standalone: true, | ||
imports: [ | ||
CommonModule, | ||
FormsModule, | ||
MatSidenavModule, | ||
MatFormFieldModule, | ||
MatInputModule, | ||
MatButtonModule, | ||
MatIconModule, | ||
MatSnackBarModule, | ||
PostCardComponent, | ||
CreatePostComponent, | ||
UserProfileComponent | ||
] | ||
}) | ||
export class FireblogPageComponent implements OnInit { | ||
@ViewChild('sidenav') sidenav!: MatSidenav; | ||
|
||
isSidebarOpen = false; | ||
|
||
|
||
ngOnInit(): void {} | ||
|
||
toggleSidebar(event: boolean) { | ||
this.isSidebarOpen = event; | ||
this.sidenav.toggle(); | ||
} | ||
|
||
|
||
} |
25 changes: 24 additions & 1 deletion
25
src/app/views/auth/user-profile/user-profile.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,24 @@ | ||
<p>user-profile works!</p> | ||
<section> | ||
<h3>User Profile</h3> | ||
<form class="profile-form"> | ||
<div class="profile-image"> | ||
<img id="profile-img" #userAvatar src="../../../assets/images/avatars/image-juliusomo.png" alt="User Avatar" id="userAvatar"> | ||
<button mat-mini-fab color="primary" class="upload-btn" (click)="onUploadButtonClick()"> | ||
<mat-icon>add_a_photo</mat-icon> | ||
</button> | ||
<input #imageUpload type="file" id="imageUpload" accept="image/*" style="display: none;" (change)="onImageSelected($event)"> | ||
</div> | ||
<mat-form-field appearance="outline"> | ||
<mat-label>Username</mat-label> | ||
<input matInput placeholder="Enter your username"> | ||
</mat-form-field> | ||
<mat-form-field appearance="outline"> | ||
<mat-label>Email</mat-label> | ||
<input matInput placeholder="Enter your email" type="email"> | ||
</mat-form-field> | ||
<div class="button-group"> | ||
<button mat-raised-button color="primary" (click)="saveChanges()">Save Changes</button> | ||
<button mat-raised-button color="warn" (click)="logOut()">Log Out</button> | ||
</div> | ||
</form> | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
section { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1.5rem; | ||
|
||
.profile-form { | ||
display: flex; | ||
flex-direction: column; | ||
gap: .5rem; | ||
|
||
.profile-image { | ||
position: relative; | ||
width: 4rem; | ||
height: 4rem; | ||
|
||
img { | ||
width: 100%; | ||
height: 100%; | ||
object-fit: cover; | ||
border-radius: 50%; | ||
} | ||
|
||
.upload-btn { | ||
position: absolute; | ||
bottom: -0.5rem; | ||
right: -1.75rem; | ||
transform: scale(0.7); | ||
} | ||
} | ||
|
||
.button-group{ | ||
display: flex; | ||
gap: 0.5rem; | ||
justify-content: flex-end; | ||
} | ||
} | ||
} |
Oops, something went wrong.