Skip to content
Snippets Groups Projects
Commit 2148cd4d authored by Jonny Ngo Luong's avatar Jonny Ngo Luong
Browse files

feat: Code cleanup and fixes (#31)

parent e45cffac
No related branches found
No related tags found
1 merge request!28Resolve "Sette opp kjøp og tilbakemeldingssystem"
<div class="profile">
<div class="profile_info">
<div class="titleWrapper">
<div class="img"></div>
<div class="info">
<p class="name">{{user.getUsername}} Doe</p>
<p class="email">{{user.getEmail}}</p>
<p class="phone_number">+47 123 45 678</p>
<div class="infoWrapper">
<div class="profile_info">
<div class="titleWrapper">
<div class="img"></div>
<div class="info">
<p class="name">{{user.getUsername}} Doe</p>
<p class="email">{{user.getEmail}}</p>
<p class="phone_number">+47 123 45 678</p>
</div>
</div>
</div>
<div class="cardWrapper">
<div class="rating">
Mine omtaler:
<i class="material-icons">star</i>
<i class="material-icons">star</i>
<i class="material-icons">star</i>
<i class="material-icons">star_half</i>
<i class="material-icons">star_border</i>
</div>
<div class="location">
Geografi: Trondheim, Oslo
</div>
<div class="description">
<pre>
<div class="cardWrapper">
<div class="rating">
Mine omtaler:
<i class="material-icons">star</i>
<i class="material-icons">star</i>
<i class="material-icons">star</i>
<i class="material-icons">star_half</i>
<i class="material-icons">star_border</i>
</div>
<div class="location">
Geografi: Trondheim, Oslo
</div>
<div class="description">
<pre>
Om profilen min:
Fiskeboller er digg
Fotball er livet
......@@ -30,15 +31,17 @@ Fotball er livet
(=’.’) + (=’.’) = (=’.’)=’,’)
(,(‘’)(‘’) (,(‘’)(‘’) (,(“)(“)(“)(“)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
</pre>
</pre>
</div>
</div>
</div>
</div>
<div class="post_list">
<h2>Brukerens annonser</h2>
<h2>Aktive annonser</h2>
<div class="posts">
<!-- All users posts for now :) -->
<app-post-thumbnail *ngFor="let post of userPosts" [post]="post"></app-post-thumbnail>
</div>
<a href="#">Se flere annonser</a>
</div>
</div>
\ No newline at end of file
</div>
:host > .profile {
margin-top: 300px;
margin-top: 200px;
display:flex;
justify-content: center;
padding: 0 5% 5% 5%;
font-family: 'Josefin Sans', sans-serif;
transform: translateY(-100px);
.profile_info {
.infoWrapper {
order: 2;
margin-top: 40px;
}
}
div.profile_info {
......@@ -49,6 +50,7 @@ div.profile_info {
padding: 20px 10px;
pre {
font-size: 0.75rem;
padding: 5px;
}
}
}
......@@ -69,5 +71,18 @@ div.post_list {
}
& > a {
align-self: flex-end;
margin-top: 20px;
}
}
div.posts {
display: grid;
grid-template-columns: repeat(auto-fill,300px);
grid-gap: 10px;
}
:host ::ng-deep app-post-thumbnail div.postthumb {
width: 300px;
& > img {
width: 280px !important;
height: 280px !important;
}
}
\ No newline at end of file
......@@ -28,7 +28,7 @@ export class UserGuestProfileComponent implements OnInit {
// Redirects to /profile if the user is accessing their own profile
const currentUser: User = this.authService.getCurrentUser();
if (currentUser.getUserId == this.user.getUserId) {
this.router.navigateByUrl("/profile");
this.router.navigateByUrl("/profil");
} else {
this.getPosts();
}
......
<div class="registrationForm">
<h3>Rediger bruker</h3>
<app-input [(inputModel)]="username" label="Brukernavn" (blur)="checkForm()"></app-input>
<app-input [(inputModel)]="email" label="Epost" (blur)="checkForm()"></app-input>
<app-input type="password" [(inputModel)]="password" label="Passord" (blur)="checkForm()"></app-input>
<app-input type="password" [(inputModel)]="confirm_password" label="Bekreft passord" (blur)="checkForm()"></app-input>
<p>{{statusMessage}}</p>
<app-button (click)="updateUser()" text="Lagre endringer"></app-button>
<div class="cardWrapper">
<h3>Rediger bruker</h3>
<div>
<app-input [(inputModel)]="username" label="Brukernavn" (blur)="checkForm()"></app-input>
<app-input [(inputModel)]="email" label="Epost" (blur)="checkForm()"></app-input>
<app-input type="password" [(inputModel)]="password" label="Passord" (blur)="checkForm()"></app-input>
<app-input type="password" [(inputModel)]="confirm_password" label="Bekreft passord" (blur)="checkForm()"></app-input>
<p class="status">{{statusMessage}}</p>
<app-button (click)="updateUser()" text="Lagre endringer"></app-button>
</div>
</div>
</div>
\ No newline at end of file
:host > .registrationForm {
padding: 5%;
display:flex;
justify-content: center;
h3 {
font-family: 'Josefin Sans', sans-serif;
font-size: 1.5rem;
font-weight: 500;
padding: 10px;
}
& > div.cardWrapper {
color: #fff;
display: flex;
flex-direction: column;
background: linear-gradient(90deg, #14A35A 0%, #24e072 100%);
padding: 10px;
width: 70%;
min-width: 300px;
max-width: 900px;
}
}
div.cardWrapper > div {
color: #000;
display: flex;
flex-direction: column;
background-color: #fff;
box-shadow: inset 0px 4px 4px rgb(0 0 0 / 50%);
gap: 10px;
padding: 20px 10px;
}
p.status {
margin: 10px 0 5px 5px;
font-style: italic;
}
\ No newline at end of file
......@@ -33,7 +33,7 @@ Fotball er livet
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
</pre>
</div>
<app-button (click)="placeholder()" text="Rediger profil" class="btn pink"></app-button>
<a href="/profil/rediger"><app-button text="Rediger profil" class="btn pink"></app-button></a>
</div>
</div>
</div>
......
......@@ -71,6 +71,7 @@ div.post_list {
}
& > a {
align-self: flex-end;
margin-top: 20px;
}
}
div.posts {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment